When working with times and dates in Rails applications, you need to deal with the following problem: In Rails, Time...

regular-expressions.info

You can write regular expressions some different ways, e.g. /regex/ and %r{regex}. For examples, look here. Remember that it...

popthis is awesome when used with inaction_mailer. Setup inaction_mailer Install the gem: sudo gem install popthis

makandra dev

To pause and send a task to the background ctrl+z to reactivate the task fg to run task in...

wiki.github.com

The following example is from the Cucumber wiki: Given a blog post named "Random" with Markdown body """ Some Title, Eh...

makandra dev

The following counts all the lines in all *.rb files in the app directory. Run several of these commands to...

gnuu.org

YARD 0.6 adds the ability to serve documentation for gems as well as the current project with yard server. Just...

github.com

An alternative to this technique is using VCR. VCR allows you to record and replay real HTTP responses, saving you...

This will tunnel HTTP requests to one given domain and port through an intermediary SSH server: ssh -L 8080:targethost...

Open the configuration file: gksudo gedit /usr/share/vte/termcap/xterm Find a line like this: :co#80:it#8:li#24:\

makandra dev

Ubuntu lets you mount an SSH shell into Nautilus from Places -> Connect to server (select "SSH" as server type).

In a nutshell: to avoid your shell character set from messing with imports, use -r to export and SOURCE when...

makandra dev

From the shell: ls -l | wc -l

makandra dev

This may be awkward to set up, but will work once you're done. Fun facts:

Unless all MySQL server defaults are set to UTF-8, mysqldump encodes UTF-8 characters incorrectly and only outputs correct...

morris-photographics.com

Some browsers render PNG images with color profiles and other shenanigans, some don't. The cleanest way to have consistent...

script/runner -e development 'Article.all.each { |a| a.image.reprocess! if a.image.exists? }; "done"'

makandra dev
github.com

We built cucumber_spinner to have a progress bar for Cucumber features, which also outputs failing scenarios as soon as...

makandra dev

To test concurrent code, you will need to run multiple threads. Unfortunately, when you use blocking system calls (e.g. locks...

See the lemonade descriptions. Unfortunately, the gem has a few problems: it does not work with Sass2...

When you need to patch an existing gem, one way is to "vendor" the gem by copying it into the...

To improve installation times of gems you can use the following approach: gem install xyz --no-document To permanently ignore...

web.archive.org

This note shows how to merge an ugly feature branch with multiple dirty WIP commits back into the master as...

Append this to your ~/.bashrc: export PS1='\[\033[01;32m\]\h\[\033[01;34m\] \w\[\033[31m\]$(__git_ps1 "(%s...