Posts

Showing posts from 2016

Deploying a static website efficiently on Google Cloud Storage

I have several static websites hosted on Google Cloud Storage for which the only thing missing is the ability to have a custom domain using SSL.

In my deploying process from the local file system I was using the gsutil cp command that enables gzipping the files by extension (html,css,js). However each time every file was copied which was a pain when I was using several unmodified images.

My first experience with gsutil rsync was bad:

I could not gzip the files I neededJust touching a file was causing it to be re-deployed However I was able to find an optimized way for deployment Split my local folder into 2 folders with the same hierarchy, one containing the content to be gzip (html,css,js...), the other the other filesGzip each file in my gzip folder (in place)Call gsutil rsync in for each folder to the same gs destination Of course, it is only a one way synchronization and deleted local files are not deleted remotely For the gzip folder the command is
gsutil -m -h Content-Encoding:gzip…

Test dartlang packages on Chrome using Travis

After giving up using content_shell in travis to test my packages, I was using firefox as it was available and good for basic browser testing. However it did hang on some extensive indexeddb testing or missing some feature like WebSql. And testing my components on a browser was needed

Thanks to Alexandre Ardhuin in issue https://github.com/travis-ci/travis-ci/issues/6683, I was able to setup a solution available here:

https://github.com/tekartik/chrome_travis.dart

Assuming you are familiar with Dart and Travis integration

Include chrome_travis.dart as a development dependencies in your pubspec.yaml file

dev_dependencies: test: any chrome_travis: git: git://github.com/tekartik/chrome_travis.dart
Create the following `.travis.yml` file

language: dart sudo: required dist: trusty dart: - stable - dev before_script: - source $(pub run chrome_travis:env_rc) script: - pub run test -p vm -p chrome
Configure your project to run in https://travis-ci.org

The project uses the solut…

Change WebStorm VCS modified file color

Image
On Ubuntu, using WebStorm 2016.2 (and other Intellij project such as Android Studio) and the standard Dracula theme, I can't barely see VCS (Git, Mercurial) modified files in the project view pane as here:

Hard to find the proper option. Turns out (thanks https://www.jetbrains.com/help/idea/2016.2/file-status-highlights.html) it can be found by typing "file status" in the Settings preferences and looking for the "Modified" entry...
Note that I had to restart WebStorm to see the change

Run appengine endpoint php client sample on windows

I'm no expert in php but i had to setup a simple windows php client for appengine (java) endpoint server. I used the client generator (https://github.com/google/apis-client-generator). While my sample was working like a charm on linux, on windows i had more pain

After installing php5 I had to enable (so uncomment in php.ini)
ssl (php_openssl.dll, php_sockets.dll) In my sample I had to disable gzip...
$client->setClassConfig("Google_Http_Request", "disable_gzip", true)



Temporarily install dev version of Dart on Ubuntu

I like to quickly be able to install rc version of the lastest dart available. Below is the quick way

sudo sh -c 'curl https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_unstable.list > /etc/apt/sources.list.d/dart_unstable.list' sudo apt-get update sudo apt-get install dart
And to switch back to the stable version

sudo rm /etc/apt/sources.list.d/dart_unstable.list sudo apt-get update sudo apt-get install dart
Or to force installation of the stable version

sudo apt-get install dart/stable
Dartium can be found here: https://www.dartlang.org/downloads/archive

Content shell can be found here:
dev: http://gsdview.appspot.com/dart-archive/channels/dev/release/latest/dartium/
stable: http://gsdview.appspot.com/dart-archive/channels/stable/release/latest/dartium/


AppEngine java solving You do not have permission to modify this app

Switching between multiple projects (and email), I had the following issue

WARNING: Error posting to URL: https://appengine.google.com/api/appversion/getresourcelimits?app_id=my_application_id&version=1& 403 Forbidden You do not have permission to modify this app (app_id=u'my_application_id').
Delete:

~/.appcfg_oauth2_tokens_java
so that you re-enter the oauth process

Also to have templating (here app.id) working, make sure your pom.xml contains

<plugin> <groupid>com.google.appengine</groupid> <artifactid>appengine-maven-plugin</artifactid> ... <configuration> ... <!-- Necessary for templating --> <appid>${app.id}</appid> <version>${app.version}</version> ... </configuration> ... </plugin>