web.archive.org

Capistrano 2 brings the shell command which allows you to run commands on your deployment targets. There is also invoke...

makandra dev

If you need to run a program on a remote machine (e.g. to your office PC) with a graphical UI...

makandra dev

This is an awesome gadget in your toolbox, even if your test coverage is great. gem install ruby-debug (Ruby...

web.archive.org

When flagging a spec that will be implemented later as pending, include a failing spec body or RSpec 3 will...

...what "memoize" in earlier rails versions did. There is a gem that reintroduces this behavior, but this is the essential implementation. Remember In the above example, some_expensive_calculation is...

...it will be fixed, I guess it will be for Rails 4 only. The best workaround right now is to lock your version of rack at version...

makandra dev

...remember to nilify it afterwards. Otherwise other examples will see your global changes. A better way is to use the .with_power method to change the current power for the...

ImageMagick can automatically crop surrounding transparent pixels from an image: convert input.png -trim +repage output.png

...On the database level, you will see these queries (simplified; the number at the beginning of each line is the connection ID): 1 Connect 1 BEGIN 1 INSERT INTO foos...

...you might be doing stuff afterwards that could require to abort the transaction). A better approach As a general rule, never use ActiveRecord::Base.establish_connection and also don't use...

...include(3, 4, 5) evaluates to: NOT( .to include(3, 4, 5) ) However, it behaves like: .to (NOT include(3) && NOT include(4) && NOT include(5) ) Warning

You are getting when connecting via SSH or deploying with Capistrano (which uses SSH): Too many authentication failures for username...

With puma you can have concurrent requests. There are two concepts on how Puma can handle two incoming requests: Workers...

When paginating records, we usually need to know the number of total records in order to render pagination links. Popular...

In a web application you often need to move data between the client (HTML, Javascript) and the server (Ruby, Rails...

A convenient way to test SNS Subscription Filter Policies is using an email address as the subscription endpoint. However, for...

Instead of running all missing migrations on your test database with rake db:migrate RAILS_ENV=test you can also...

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

...Safari, ...) or Firefox, this is only the initial size -- users can resize textareas to become bigger. This is helpful to the user, but may be breaking your application layout in...

This note describes a Cucumber step definition that lets you say: Then "Mow lawn" should be an option for "Activity...

As attachments to this card you will find a Cucumber feature and supplementing step definition that you can use to...

tl;dr Since Rails 6.1+ you can use .compact_blank or .compact_blank! to remove blank values from collections (e.g...

github.com

The linked rbenv plugin rbenv-each is very helpful to keep QoL gems up to date that are not part...

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