We forked trusty memoizer to make two changes: Memoized methods now preserve their arity. Previously all memoized methods had an...
This note describes a Cucumber step definition that lets you say: Then "Mow lawn" should be an option for "Activity...
...iterated until the final design is ready – shiny, accepted and ready for implementation. I believe this works well when you get to work with the final decider in person.
As attachments to this card you will find a Cucumber feature and supplementing step definition that you can use to...
I had a huge MySQL dump that took forever (as in: days) to import, while I actually just wanted to...
We recently decided to put static content for HouseTrip.com to Amazon Cloudfront for a faster user experience. This happens fully...
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...
The Rails asset pipeline improves delivery of application assets (javascripts, stylesheets, images, fonts). Here are some basic facts about its...
...switches to the clicked link. In a Jasmine spec I wanted to test this behaviour. Unpoly's up.hello emits an up:fragment:inserted event, in whose callback function I can...
When using the asset pipeline your assets (images, javascripts, stylesheets, fonts) live in folders inside app: app/assets/fonts app/assets/images...
...export_path = Dir.mktmpdir('exports') # ... ensure FileUtils.remove_entry(export_path) end Option 3: Using a before/after block before { @export_path = Dir.mktmpdir('exports') } after do if @export_path.present? FileUtils.remove_entry(@export_path)
ActiveRecord provides the ids method to pluck ids from a scope, but what if you need to pluck Global IDs...
The linked article explains how to get a database-wide lock without creating table rows: This article explains how I...
When logging in Rails, you can use the log_tags configuration option to add extra information to each line, like...
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...
Inspired by recent "git shortcut" cards I figured it would be nice to have one of these for rebasing a...
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...
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...
On some of our older projects, we use the mysql2 gem. Unfortunately, versions 0.2.x (required for Rails 2.3) and...
Our CI setup frequently sees this error while running yarn install: yarn install v1.22.19 [1/4] Resolving packages... [2/4] Fetching packages...
tl;dr Since Rails 7+ you can use ComparisonValidator for validations like greater_than, less_than, etc. on dates, numerics...