JavaScript Start-up Performance

Posted About 7 years ago by Henning Koch.
medium.com

As web developers, we know how easy it is to end up with web page bloat. But loading a webpage...

Never use SET GLOBAL sql_slave_skip_counter with a value higher than 1

Posted About 7 years ago by Kim Klotz.

If you have a replication error with MySQL and you know the "error" is okay (e.g. you've executed the...

Error "undefined method last_comment"

Posted About 7 years ago by Dominik Schöler.
stackoverflow.com

This error message may occur when rspec gets loaded by rake, e.g. when you migrate the test database. NoMethodError: undefined...

Geordi hints

Posted About 7 years ago by Dominik Schöler.
github.com

Reminder of what you can do with Geordi. Note: If you alias Geordi to something short like g, running commands...

[jruby] TruffleRuby Status, start of 2017

Posted Over 7 years ago by Henning Koch.
lists.ruby-lang.org

TruffleRuby is an experimental Ruby implementation that tries to achieve ~10x performance over MRI. This has been on our radar...

How to tackle complex refactorings in big projects

Posted Over 7 years ago.

Sometimes huge refactorings or refactoring of core concepts of your application are necessary for being able to meet new requirements...

JavaScript: Don't throw synchronous exceptions from functions that return a Promise

Posted Over 7 years ago by Henning Koch.

TLDR: A function is hard to use when it sometimes returns a promise and sometimes throws an exception. When writing...

An Introduction to Sending HTML Email for Web Developers

Posted Over 7 years ago by Dominik Schöler.
smashingmagazine.com

A comprehensive introduction to sending HTML emails. Intro: HTML email: Two words that, when combined, brings tears to a developer...

CarrierWave: When your uploader generates filenames dynamically, use model.save! instead of uploader.recreate_versions!

Posted Over 7 years ago by Dominik Schöler.

If your Carrierwave uploader dynamically generates the filename (e.g. by incorporating a user's name), you must call model.save! after...

Howto use ActiveRecord preload with plain SQL inner joins

Posted Over 7 years ago by Emanuel.

Like you know from "How to tell ActiveRecord how to preload associations (either JOINs or separate queries)", you can tell...

Debugging cucumber feature with javascript + firefox vnc

Posted Over 7 years ago by Emanuel.

TL;DR Debugging problems with javascript errors in cucumber tests is sometimes easier in the browser. Run the test, stop...

Ruby: Writing specs for (partially) memoized code

Posted Over 7 years ago by Dominik Schöler.

When you're writing specs for ActiveRecord models that use memoization, a simple #reload will not do: it 'updates on...

Copy to clipboard without flash (clipboard.js)

Posted Over 7 years ago.
clipboardjs.com

We used zeroclipboard.js in some of our projects but now we switched to clipboard.js because it does not rely on...

mceachen/closure_tree: Easily and efficiently make your ActiveRecord models support hierarchies

Posted Over 7 years ago by Henning Koch.
github.com

Closure_tree lets your ActiveRecord models act as nodes in a tree data structure. This promises a few improvements over...

Rails: Talking to the database without instantiating ActiveRecord objects

Posted Over 7 years ago by Dominik Schöler.
api.rubyonrails.org

Instantiating ActiveRecord objects comes expensive. To speed up things, you can choose a more direct way to talk to your...

Nested ActiveRecord transaction pitfalls

Posted Over 7 years ago.
api.rubyonrails.org

When working with custom transactions and use ActiveRecord::Rollback you may encounter unexpected behaviour if you try to roll back...

Repeatedly execute a bash command and observe its output

Posted Over 7 years ago by Dominik Schöler.

You can have a command repeatedly executed and the output displayed. This is useful e.g. for monitoring file system changes...

Git: Show commits that have touched specific text in a file

Posted Over 7 years ago by Emanuel.

If you want to find the commits that touched a specific text in a file, use git log -S 'text...

Creating icon fonts with Icomoon

Posted Over 7 years ago by Dominik Schöler.
icomoon.io

Icomoon.io offers a free app to build custom icon webfonts. It offers downloads as webfont set (.eot, .ttf, .woff, .woff2...

Beware of rails' reverse_order!

Posted Over 7 years ago.

#reverse_order does not work with complex sorting constraints and may even silently create malformed SQL for rails < 5.

Different ways to set attributes in ActiveRecord

Posted Over 7 years ago by Emanuel.
davidverhasselt.com

Rails 5 / 6 / 7 Method Uses Default Accessor Saves to Database Runs Validations Runs Callbacks Updates updated_at/updated_on Respects Readonly...

Master the chrome history and autocomplete

Posted Over 7 years ago by Emanuel.

1. Sometimes you have search entries in the autocomplete of the address bar, which are higher weighted than your bookmarks...

makandra/gemika: Helpers for testing Ruby gems

Posted Over 7 years ago by Henning Koch.
github.com

We have released a new library Gemika to help test a gem against multiple versions of Ruby, gem dependencies and...

VCR fails if the same request is triggered multiple times

Posted Over 7 years ago by Emanuel.

Same requests are recorded only once in vcr. Replaying a test fails, if you trigger the same request multiple times...