October 2, 2014

What I learned today

Work

  • I learned that Google Analytics Reporting api has a limit in the number of characters that you can send as filters.

Found it the hard way, when doing a query, and filtering for a set of domains (excluding test sites, demo sites, etc), the api returned an error.

    400 : Invalid expression. Expression exceeds max size of 4096

which interestingly is not documented in Google Api Errors.

So if you see that error, you can fix it by splitting your filters in two sets, query twice and them merge.

  • I learned that there is a tool named gox that can compile a Golang project into an executable binary. Cool thing about it, it can add any files into the binary and it can build a binary to a specific os.

For example, if I had a web application with martini (with multiple files and templates), and I wanted to run it on a server running linux x64, i could just go to the root folder of the project and run:

    gox -osarch="linux/amd64" .

And a binary named project_name_linux_amd64 would be created containing all the folder and ready to run with ./project_name_linux_amd64.

How cool is that!

Life

  • If like me, you are using Ghost.js to host your blog, you can reset your password like this:

    apt-get install sqlite3
    sqlite3 content/data/ghost-dev.db
    

    then select a new password and encript it (using for example this tool)

    Once you have your password hash just do:

    sqlite> update users set password="<YOUR HASH>" where id = YOUR_USER_ID_IN_THE_TABLE>;
    .quit
    

    And you have changed our password! Thanks so much to gagor for this tip.

  • I learned what Moe means, which is like a modern version of kawaii, focused specificly in non real characters (such as Anime).

Powered by Hugo & Kiss.