commandlinefu.com

The colors in Rails log files are helpful when watching them but, since they are ANSI color codes like ^[[4...

makandra dev

This will reduce the filesize of foo and bar to 0 bytes: truncate -s0 foo bar If the files do...

makandra dev

cURL makes a web request and shows you the response body. You can redirect the response body to /dev/null just...

If you using gpg for your encrypted backup and it fails after you put it in crontab make sure you...

Use the PDF toolkit: sudo apt-get install pdftk To rotate page 1 by 90 degrees clockwise: pdftk in.pdf cat...

harvesthq.github.com

Chosen is a JavaScript plugin that makes long, unwieldy select boxes much more user-friendly. It is currently available in...

When you have a program running in a hidden X screen (like with Xvfb for Selenium tests) you may want...

The Javascript code below is a rough equivalent to the simple_format helper that ships with Rails: function simpleFormat(str...

Resque comes with its own dashboard (Resque server) that you can mount inside your Rails 3 application with #config/routes.rb:

When you create a temporary file (e.g. to store a generated Excel sheet) and try to send it to the...

When have you last used your caps lock key? On purpose? Right... In Gnome Make it an additional ESC key...

With gem dependency it is possible to check the dependencies for your gem before you install it.

You can say: $(element).is(':visible') and $(element).is(':hidden') jQuery considers an element to be visible if it...

When you render a nested form for a Movie which has_many :actors, you want to render the right number...

makandra dev

If you have to build a filename (e.g. for use in downloads) that contains user input, keep in mind that...

When rendering a number, you want to pretty up the string coming from #to_s: Render 0.0 as 0

For Email-Patterns see most recent E-Mail-Pattern. HOST = /\A[a-z0-9]+[a-z0-9\-\.]*[a-z0-9...

blog.jayfields.com

Deprecated ways to execute shell code in Ruby This is just a reference for legacy code. For new code, always...

Remember that your controller actions share the same method space with private methods defined in ActionController::Base. If your controller...

ActiveRecord models know how to cast a given string to the type of a given attribute (or column).

At times, it might be unavoidable to have different CSS rules for Internet Explorer than for sane browsers. Using Sass...

makandra dev
github.com

The shell variable PS1 holds your bash prompt. You might want to change it to serve your needs best. Here...

Depending on where you live, different rules are used to determine the number of the week and a weekday. You...

When calling a Sass mixins, you usually don't need to quote arguments: +tint_article(#f21) However, when a CSS...