I had a huge MySQL dump that took forever (as in: days) to import, while I actually just wanted to...

tl;dr: Avoid to memoize methods with default (keyword) arguments! When you are using Memoized with default arguments or default...

We recently decided to put static content for HouseTrip.com to Amazon Cloudfront for a faster user experience. This happens fully...

In case you want to use pry with an older version of Ruby, you can try the following configurations.

Do all of the above, and also Remove all blocks and hooks belonging to craken from your config/deploy.rb. Delete vendor/plugins/craken. Check if you have lib/tasks/craken.rb. If so, delete...

makandra dev

The Rails asset pipeline improves delivery of application assets (javascripts, stylesheets, images, fonts). Here are some basic facts about its...

When making cross-domain AJAX requests with jQuery (using CORS or xdomain or similar), you will run into issues with...

xaprb.com

The linked article explains how to get a database-wide lock without creating table rows: This article explains how I...

We recently encountered a problem with GlusterFS (7.x) when an application used the flock syscall on a GlusterFS path...

Browsers blocks abusable JavaScript API calls until the user has interacted with the document. Examples would be opening new tab...

redis.io

In production, you (or your ops team) should configure a maximum number of bytes that Redis can use to store...

...per group but only one value can be picked for the results. The default behaviour of MySQL prior to version 5.7 will not complain and arbitrarily choose a value. But...

Download the dictionary from http://www.winedt.org/dict.html, e.g. http://www.winedt.org/dict/de_neu.zip unzip de_neu.zip mkdir ~/Documents/dic iconv -f UTF-16 -t...

const wordBreaks = { 'Fahrsicherheitstraining': "Fahr\xADsicherheits\xADtraining", 'Fahrsicherheitszentrum': 'Fahr\xADsicherheits\xADzentrum', 'Kreisverkehrswacht': 'Kreis\xADverkehrswacht', 'Berufsgenossenschaft': 'Berufs\xADgenossenschaft', } const keys = Object.keys(wordBreaks) function textNodes(node){ let textNodes = [] let walk = document.createTreeWalker(node...

...get rather expensive and doing it for every long word does not make it better, but in my case the pages are not very content-heavy and there is no...

Inside before :each blocks you can refer to variables that you introduce via let later on. They do not need...

Rails comes with grouped_collection_select that appears to be useful, but isn't. As an alternative, consider the flat...

When the Ruby parser module of Ruby-GetText comes across a file in one of its search directories (e.g. lib/scripts...

When you use the send_file method to send a local file to the browser, you can save resources on...

CoffeeScript and JavaScript (ECMAScript) both have operators in and of. Each language use them for more than one purpose. There...

...calls html_safe if you're not escaping. FWIW, an HTML string may easily become invalid when truncated, e.g. when a closing tag gets chopped off. However, when the input...

...to a value. The validation is skipped silently when terms is nil. While this behavior is useful to validate acceptance in the frontend and not the admin backend, it also...

...polymorphic association. class Event < ApplicationRecord has_many :letters, as: :record end class Letter < ApplicationRecord belongs_to :record, polymorphic: true end event = Event.new.letters.build event.save! # => ActiveRecord::RecordInvalid: Validation failed: Record must exist...

Active Record's select method allows you to make use of the power of MySQL select statements. On the one...

If you use transactional_fixtures or the database_cleaner gem with strategy :transaction, after_commit callbacks will not be fired...