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...
Deprecated ways to execute shell code in Ruby This is just a reference for legacy code. For new code, always...
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...
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...
What are Google’s plans for turning WebM into a genuinely open standard, one that is based on consensus like...
From time to time we're convinced that an error must be very close to the network card, OS IP...
It's that simple to allow one of your Linux users to run a single command as UID 0:
This is for those who already own an SSL certificate (e.g. using it in the Apache HTTP Server) and need...
You cannot use Array#join on an array of strings where some strings are html_safe and others are not...
If you want your application to display properly on iPad, iPhone or Android there are two things to do:
Update: This trick probably isn't very useful anymore in Ruby 2.x. The Ruby GC has improved a lot...
If you want to iterate over a Range, but only look at every n-th element, use the step method...
When your block takes an argument that should have an default, only in Ruby 1.9 you can say: block = lambda...
Styling button tags across all major browsers is not easy. Many times you should be fine by using the native...
If you need to do calculations inside the database and can not use Ruby objects you may run into problems...
This is non-trivial because you need to fake event objects and require different code for different browsers. Luckily, there...
For clarity and traceability, your commit messages should include the ID and title of the Pivotal Tracker story you're...
It can be useful to have a Ruby expression like condition ? positive_case : negative_case in MySQL queries:
If you have several submit elements (inputs or buttons with type="submit") that each cause different things to happen (e.g...