When you do something like this in your code: def var_value @var ||= some_expensive_calculation end
When you want to find out the data type of an attribute, you can just use ActiveRecord's columns_hash...
Ubuntu 12.04 LTS x64, Ruby 1.8.7, Rails 2.13, PDFKit 0.5.4, Phusion Passenger Apache 2 I ran into this, when I...
swaks is a very nice tool to test SMTP. For the most linux distributions you can easily install it with...
Weighttp is threaded and might exhaust resources of an application better than ApacheBench or httperf. You need libev installed.
Whenever you create a table from a database migration, remember to add updated_at and created_at timestamps to that...
Install and configure the AWS Command Line Interface Show existing certificates to test if the AWS Cli is working:
Ubuntu has a package mysql-sandbox that lets you install multiple MySQL versions into your user home: Install mysql-sandbox...
Rails has always included a scaffold script that generates a default controller implementation for you. Unfortunately that generated controller is...
There may be reasons to change the locale of your Postgres cluster. A popular one is your development system's...
So you're switching to PostgreSQL from MySQL? Here is some help... General hints on PostgreSQL \? opens the command overview...
| Chrome | CTRL+Shift+J | | Firefox / Firebug | CTRL+Shift+L |
For all late night coders: The program "redshift" changes your monitors' white balance according to your position on the planet...
Consul 0.10.0 now allows multiple power mappings for nested resources. When using nested resources you probably want two power
When you're writing migrations that do more than changing tables (like, modify many records) you may want some output...
Box shadows are awesome. Unfortunately they are also very costly to render. You will rarely notice the rendering time on...
Consul 0.9 comes with many new features to optimize powers that only check access to a given record. e.g. Power.current.post...
Create a 1 GB file to swap to (we have sufficient space on / on this machine. Use a different partition...
Next time you have to do more than trivial CSS changes on a project, you probably want to have live...
Set the hash to a dummy hash which doesn't hit any id at your page, for example: window.location.hash = "_";
Remember why preloading associations "randomly" uses joined tables or multiple queries? If you don't like the cleverness of this...
1. Saving files to a directory that is not shared between deploys or servers If you save your uploads to...
Active Record's select method allows you to make use of the power of MySQL select statements. On the one...
The Rails secret_token must be unique for each application and any instance of it. If not, someone could exploit...