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...

github.com

Uses FFI and works all relevant operating systems. If you'd try to do it yourself, you'd have to...

Validations should be covered by a model's spec. This card shows how to test an individual validation. This is...

A HTTP 302 Found redirect to PATCH and DELETE requests will be followed with PATCH or DELETE. Redirect responses to...

makandra dev

In JavaScript we often use Immediately Invoked Function Expessions (or IIFEs) to prevent local variables from bleeding into an outside...

During debugging you might pepper your code with lines like these: console.log('foo = ' + foo + ', bar = ' + bar) I recommend to use...

There are cases when you need to select DOM elements without jQuery, such as: when jQuery is not available

github.com

We will use this for new Angular code. Consider the guide in "beta". Things will still refine, but the general...

github.com

When using Sidekiq in your application, you must write thread-safe code. This wiki page also lists gems that are...

I recommend to go straight to 2.1.5+ without intermediate steps. Otherwhise you burden yourself with unnecessary work of encoding problems...

Ruby has the class Proc which encapsulates a "block of code". There are 2 "flavors" of Procs: Those with "block...

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

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

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

makandra dev

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

Our applications not only need to be functional, they need to be fast. But, to quote Donald Knuth, premature optimization...

The asset pipeline is one of Rails' two mechanisms how stylesheets, javascripts and images from your /assets folder are processed...

Some tasks in a web application are better not done live when a user request a page, but in the...

This is a guide on how to effectively use Git when working on a feature branch. It is designed to...

makandra dev

Starting with Ruby 1.9, most #each methods can be called without a block, and will return an enumerator. This is...

ma.ttias.be

Article shows how to make a script that fakes one kind of content when printed with cat, but uses different...

As the web is being used for more and more tasks, expectations rise. Not only should web pages offer rich...