georgemauer.net

If your application exports CSV, be advised that Excel and other spreadsheet applications treat certain cells (those starting with =, +, - or...

Checking if a JavaScript value is of a given type can be very confusing: There are two operators typeof and...

makandra dev

An end-to-end test (E2E test) is a script that remote-controls a web browser with tools like Selenium...

When your public-facing application has a longer downtime for server maintenance or long migrations, it's nice to setup...

Browsers support different types of redirects. Be very careful with these status codes: 301 Moved Permanently 308 Permanent Redirect

Slides for Henning's talk on Sep 21st 2017. Understanding sync vs. async control flow Talking to synchronous (or "blocking...

gist.github.com

Here is some JavaScript code that allows you to click the screen and get the clicked element's text contents...

docs.ruby-lang.org

Use return to return from a method. return accepts a value that will be the return value of the...

blog.patricktriest.com

Sometimes modern Javascript projects get out of hand. A major culprit in this can be the messy handling of asynchronous...

You can use local copies of gems in your Gemfile like this: gem 'spreewald', path: '~/gems/spreewald' As soon as you...

github.com

Use Traim to build a RESTful API for your ActiveRecord models with very little code. Traim assumes your API resources...

ActiveRecord::RecordNotFound errors provide quite meaningful error messages that can provide some insight on application details. Consider the following:

This card will show you a cool way to define a class using Struct.new. A common usecase for Structs are...

Since Rails 5, domain models inherit from ApplicationRecord by default. This is the place to put code that should be...

Rails supports time zones, but there are several pitfalls. Most importantly because Time.now and Time.current are completely different things and...

stackoverflow.com

This card will show you how to use git rebase --onto without confusion. Use case: You've got two feature...

Middleman is a static page generator that brings many of the goodies that Rails developers are used to.

chris.beams.io

Separate subject from body with a blank line Limit the subject line to 50 characters (max. 72), include reference (unique...

Database connections are not thread-safe. That's why ActiveRecord uses a separate database connection for each thread.

github.com

The parallel-gem is quite easy to use and can speed up rendering time if you want to render the...

blog.jetbrains.com

RubyMine allows bookmarking lines of code. This is super-helpful when working on a complex problem. I've been using...

Note: The behaviour of Spreewald's within step is as described below for version < 1.9.0; For Spreewald >= 1.9.0 it is...

github.com

Barby is a great Ruby gem to generate barcodes of all different sorts. It includes support for QR codes via...

There are various ways to run external commands from within Ruby, but the most powerful ones are Open3.capture3 and Open3.popen3...