With "attaching an event handler once" you possibly mean one of these two things: Register a function for an event...

makandra dev
github.com

Note This card does not reflect the current state of lazy loading technologies. The native lazy attribute could be used...

github.com

Ag (aka "the silver searcher") is a very fast replacement for grep. It will parse your .gitignore for additional speedup...

Lead by a discussion of this issue, I built in a middleware which answers those requests with [400] bad request...

Sometimes you just want to have a small web server that serves files to test something. Serve the current directory...

When you're developing a gem, never list the same dependency as both runtime and development dependency in your .gemspec...

While you can use Apache as a reverse proxy, it tries to be too smart. Try nginx instead, it's...

stackoverflow.com

There are many solutions, but a very concise one is this: hash.merge!(hash) do |key, old_value, new_value|

gist.github.com

A list of common computer I/O actions and how long they take. Visual comparison chart: http://i.imgur.com/k0t1e.png

makandra dev
stackoverflow.com

git rebase -i -> mark your commit with edit git reset HEAD~ (remove the marked commit, but keep its...

phili.pe

One useful postgres command I stumbled upon recently was \x. It gives you an expanded display which allows you to...

While you usually do not need a Content-Type on GET request (which have a blank body), an external API...

shrinerb.com

Now that CarrierWave is no longer maintained, Shrine might be worth a look.

blog.activecollab.com

A great walkthrough through several design iteration of the same landing page.

By pressing Ctrl + Shift + V you can select a recently copied string for pasting.

relishapp.com

You can configure RSpec 3.3+ to raise an error when attempting to stub or mock a non-existing method. We...

bugs.ruby-lang.org

This is basically Ruby-native syntax for andand.

stackoverflow.com

Ruby has a set of methods to convert an object to another representation. Most of them come in explicit and...

When you make a simple TCP connection to a remote server (like telnet), your client won't normally notice when...

If you get an error like: subprocess installed post-removal script returned error exit status 78 when installing/removing/updating a package...

If you have jQuery code like this: if (condition) { $element.show(); } else { $element.hide(); } ... you can shorten this to: $element.toggle(condition);

You want to test your 1GE or 10GE internet uplink? We needed to ensure we have full 10GE to the...

When dealing with AR scopes, you can remove conditions, order, etc by using the unscope method. It is available on...

makandra dev

Redactor is yet another WYSIWYG editor. It definitely has its weak points, but I want to point out that it...