Posts about help

Nginx rewrite/redirect for blog URL

24 January 2015

When i moved my blog to a [middleman](http://middlemanapp.com) system, i found that i needed to provide redirects from `/2012/01/25/some-post` to `/blog/2012/01/25/some-post`. It's a relatively simple task, though i lost some time because i missed a detail that no one usually explains.

There are articles on the web explaining how to do url rewriting in Nginx. Most of them will tell you something like this:

location /2009/ { rewrite ^(/2009/.*)$ /blog$1 break; }

In a gist, th...

Automator service to resize image to several sizes

24 January 2015

Here's an Automator service to [resize an image into several sizes](/files/workflow.zip). Unzip and copy the package "Multiple Sizes.workflow" to your **~/Library/Services** folder and you will get a new entry on the finder services context menu. Just right click any image and choose "Multiple Sizes" from the services menu.

For instance, if you select an image named "image.png" it will create the following files on the same folder:

- image_512.png - image_256.png - image_128.png - im...

A collection of useful Ruby/Rails gems

24 January 2015

Since lately i've been working a lot with Ruby (Android and Java as well, but that's a different story), i figured i posted a couple of interesting gems that will make your life easier, especially but not only for rails.

Slim

Slim is a templating engine (like ERB or HAML) which pursues simplicity. It helps you write an insane amount less HTML and Rails code. You will not believe your eyes. An example:

In HTML

<body> <h1>Markup examples</h1> <div id="content"> <p>This exam...

Displaying all 3 posts