There is no built in possibility to convert a float to an integer. You have to use an inline_template...

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

To check the currently running PG version from your Rails application (e.g. Rails console on your production server), simply do...

When you're nesting setTimeout(f, 0) calls, your browser will silently increase the delay to 5 milliseconds after the...

We're using Middleman for some static sites like our blog. Despite being very similar to Rails, Middleman does not...

makandra dev
piwik.org

Piwik is the leading open-source analytics platform. As such, it is an alternative to Google Analytics. Since it is...

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

PostgreSQL, unlike MySQL, treats strings as case sensitive in all circumstances. This includes comparison with = and LIKE collision detection in...

...or you can create a helper method that creates a string from an UTF-16 hex sequence: class String def self.from_utf16_hex(sequence) parts = sequence.scan(/..../) parts = parts.map { |part| part.to...

For some years Google Chrome has allowed you to add desktop icon for any web page by going to Tools...

When building a web application, one is tempted to claim it "done" too early. Make sure you check this list...

Chrome's developer tools automagically choose vertical or horizontal panel layout, based on their width. You can disable that magic...

So you downloaded a theme for Chrome a while ago and don't remember which one it is?

makandra dev
chir.ag

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

makandra dev
phrogz.net

...The and tags both come with some non-default behavior that you know from other tags.

makandra dev

To add a new panel in MATE: Right-click on an existing panel and choose New Panel

tenderlovemaking.com

...define_method and def actually increased a little, to a difference of about 5-10% for the example above (tested for 2.5.7, 2.6.5, 2.7.0). However, the above still applies: for...

So you want to use object-fit, but you also need to support Internet Explorer. One option is to use...

til.hashrocket.com

Apparently you can pash a second scope to a hash-condition and the whole thing will be evaluated as a...

When using ImageMagick to manipulate images, you might see that images get darker when beeing modified by newer versions of...

...they aligned properly on Linux, iOS and macOS, whereas with a vertical-align of -18%, it looked good on Windows and iOS, but not Linux. Further investigation showed that not...

makandra dev
thecodelesscode.com

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

This is quite an edge case, and appears like a bug in Rails (4.2.6) to me. Update: This is now...