Converting string characters to or from their integer value (7-bit ASCII value or UTF-8 codepoint) can be done...

As your Rails project grows, you will accumulate a number of small patches. These will usually fix a bug in...

to create a Gallery that has a name and has_many :images, which in turn have a...

makandra dev

Connect to your IMAP server. If you have SSL enabled: openssl s_client -connect your-server:993 if your server...

relishapp.com

When you find yourself in the situation that you would like to define a custom matcher in your specs, but...

Many of our developers love to use the "awesome" window manager on Linux. However, RubyMine dialogs occasionally defocus while typing...

When you have a localized website, you may want to redirect users to their preferred language when they visit the...

github.com

Adds missing native PostgreSQL data types to ActiveRecord and convenient querying extensions for ActiveRecord and Arel for Rails 4.x...

When you paste copied code with CTRL+V, RubyMine will change the indentation of the pasted code. You can prevent...

guides.rubyonrails.org

ActiveRecord offers an explain method similar to using EXPLAIN SQL statements on the database. However, this approach will explain all...

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...