To simulate Rails' to_sentence in your JavaScript application, you can use these few lines of CoffeeScript code: joinSentence = (array...

When your controller action raises an unhandled exception, Rails will look at the exception's class and choose an appropriate...

Is your application doing something expensive every few seconds? Maybe an animated slider that rotates images? Maybe you are updating...

By convention, common protocols use a defined port, like 80 for HTTP or 443 for HTTPS. You can use nmap...

makandra dev
chir.ag

This service gives you a kind-of standard color name for any hex code. This is useful if you want...

The default Google Analytics might not work as expected with your Unpoly app. This is because your app only has...

tenderlovemaking.com

You can define methods using def or define_method. In the real world, there is no performance difference.

makandra dev
thecodelesscode.com

The Codeless Code is a charming series of stories about monks and nuns at a programming monastery. Some stories to...

Note: This applies to plain Ruby scripts, Rails does not have this issue. When you work with Ruby strings, those...

Reading user input in console applications is usually done using Kernel#gets. Stubbing that can be a bit hairy.

When testing Ruby code that prints something to the terminal, you can test that output. Since RSpec 3.0 there is...

to create a Gallery that has a name and has_many :images, which in turn have a...

Many of our developers love to use the "awesome" window manager on Linux. However, RubyMine dialogs occasionally defocus while typing...

brandcolors.net

brandcolors.net provides you with the colors of the world's biggest brands, easily searchable.

When you paste copied code with CTRL+V, RubyMine will change the indentation of the pasted code. You can prevent...

blog.skylight.io

Helix allows you to implement performance-critical code of your Ruby app in Rust, without requiring glue code to bridge...

Instead of using this hack you might want to use MariaDB 10.x which can work with both old and...

jQuery's deferred objects behave somewhat like standard promises, but not really. One of many subtle differences is that there...

gist.github.com

The NestedHash class allows you to read and write hashes of any depth. Examples: hash = {} NestedHash.write hash, 'a', 'b', 'c...

explainshell.com

Enter any command into explainshell and it will explain it to you: split into separate commands (if present), with each...

If you want to inspect the compiled code of your erb (or haml) templates, you can run the following code...

RSpec provides a nice diff when certain matchers fail. Here is an example where this diff is helpful while comparing...

github.com

Stackprof is a sampling call-stack profile for Ruby 2.1+. Instead of tracking all method calls, it will simply collect...

nginx.org

If you want to configure your nginx to drop connections to a specific location, you can do so by responding...