To simulate Rails' to_sentence in your JavaScript application, you can use these few lines of CoffeeScript code: joinSentence = (array...
This pretty-prints a JSON object, with two spaces of indentation: JSON.stringify(object, null, 2)
Ruby's __FILE__ keyword returns the path to the current file. On popular for this are Ruby binaries: #!/usr/bin/env ruby...
When you're nesting setTimeout(f, 0) calls, your browser will silently increase the delay to 5 milliseconds after the...
Ruby 2.3.0 has been around since end of 2015. It brings some pretty nice new features! Make sure to read...
It claims to be even faster and brings a new plugin that polyfills object-fit and object-position. This allows...
to create a Gallery that has a name and has_many :images, which in turn have a...
You can use JavaScript to get or set cookie values on the client. Using the vanilla JavaScript API
While IE9 does support HTML5 tags, it fails to work until you force HTML5 mode. Here are two ways to...
You can find out about disk space usage of all tables within your database by running this: SELECT table_name...
The attached Coffeescript helper will let you create mouse events: $element = $('div') Trigger.mouseover($element) Trigger.mouseenter($element) Trigger.mousedown($element) Trigger.mouseup($element...
RSpec provides a nice diff when certain matchers fail. Here is an example where this diff is helpful while comparing...
Stackprof is a sampling call-stack profile for Ruby 2.1+. Instead of tracking all method calls, it will simply collect...
Don't use be_true to check if a value is true. It actually checks if it anything other than...
I got this error when running Rails 2.3 tests for Rails LTS. More stacktrace: NoMethodError: undefined method `cache' for Gem...
Geordi is now (partially) tested with Cucumber. Yay! geordi cucumber supports a new @solo tag. Scenarios tagged with @solo...
A comprehensive script to convert test suites from RSpec 2 to RSpec 3. This converts more than should/expect syntax.
Wondering which processes are placed in your swap you can use this bash oneliner: for file in /proc/*/status ; do...
I recommend to go straight to 2.1.5+ without intermediate steps. Otherwhise you burden yourself with unnecessary work of encoding problems...
Logging tcpdump output all the time can create a huge amount of data. This can be both: too much data...
Ruby has the class Proc which encapsulates a "block of code". There are 2 "flavors" of Procs: Those with "block...
Sometimes you just want to have a small web server that serves files to test something. Serve the current directory...
While you usually do not need a Content-Type on GET request (which have a blank body), an external API...
Ruby has a set of methods to convert an object to another representation. Most of them come in explicit and...