blog.skylight.io

Helix allows you to implement performance-critical code of your Ruby app in Rust, without requiring glue code to bridge...

When dealing with time zones in Rails, there is one key fact to keep in mind: Rails has configurable time...

Expecting a primitive value as an argument to a method invocation is easy: expect(object).to receive(:foo).with('arg1...

developer.mozilla.org

When building a form with a file select field, you may want to offer your users a live preview before...

makandra dev
github.com

This gem gives you a rake task db:seed:dump do create a db/seeds.rb from your current database state.

Cucumber's docstrings let you add long strings to a step like this: # foo.feature Given this text: """ First line

Instead of using this hack you might want to use MariaDB 10.x which can work with both old and...

OAuth requires a set of params to be carried along requests, among which a nonce. Some libraries pass these along...

If you want to access top-level constants inside a BasicObject class, you need to prefix them with ::.

You can use JavaScript to get or set cookie values on the client. Using the vanilla JavaScript API

gist.github.com

The NestedHash class allows you to read and write hashes of any depth. Examples: hash = {} NestedHash.write hash, 'a', 'b', 'c...

Some modern Javascript APIs return iterators instead of arrays. In plain Javascript you can loop through an iterator using

RSpec provides a nice diff when certain matchers fail. Here is an example where this diff is helpful while comparing...

github.com

Stackprof is a sampling call-stack profile for Ruby 2.1+. Instead of tracking all method calls, it will simply collect...

Let's say you want to find the element with the text hello in the following DOM tree: hello

TL;DR There are three dimensions you can control when scoping routes: path helpers, URL segments, and controller/view module.

github.com

Uses FFI and works all relevant operating systems. If you'd try to do it yourself, you'd have to...

Our preferred way of testing ActiveRecord is to simply create/update/destroy the record and then check if the expected behavior has...

RSpec supports a one-liner syntax for setting an expectation on the subject: describe Array do describe "when first created...

Validations should be covered by a model's spec. This card shows how to test an individual validation. This is...

If you expect method calls in RSpec 3, be aware that the argument matchers use very liberal equality rules (more...

Angular's directives have a transclude option, that allows for rendering an element's original content within the directive's...

A HTTP 302 Found redirect to PATCH and DELETE requests will be followed with PATCH or DELETE. Redirect responses to...

To install gems Bundler needs to be able to talk to https://api.rubygems.org. If you are behind a proxy you...