Ruby (Page 3)

Bulk Resize Images Using Rake and ImageMagick

Got a set of images you need all to conform to the same size? Hate doing it manually? Me too. Let's write a rake task to solve our challenge.

Feb 15, 2016

Render an Inline SVG in Rails (or Middleman)

You can avoid multiple requests to your server by rendering SVG images inline to the rest of your HTML.

Feb 11, 2016

Use Ruby To Post Content To Slack

Once you learn how to use Slack's incoming webhooks, the possibilities are endless. See how to post to Slack using Ruby.

Feb 07, 2016

Use Slack For Rails Error Notification

Post a message to one of your Slack channels when your Rails app encounters a 500 error.

Dec 22, 2015

Download a Collection of Images from URLs using Ruby

A quick method and loop to download a collection of images with Ruby.

Dec 07, 2015

A Quicker Way to Compare Multiple Equals Operators in Ruby

When you attempt to write several predictable comparisons in one statement, it gets ugly fast. Here are some methods for cleaning it up.

Apr 20, 2015

Check if a File is Binary or Text in Ruby

Here's a cool little trick to determining if a file is text or binary in Ruby just by using the path to that file.

Dec 15, 2014

4 Ways to Pass Arguments to a Rake Task

Always googling and forgetting how to pass arguments to rake tasks? Here's a up list of the various methods.

Dec 13, 2014

Command Line Scripts Using Ruby

Command line scripts aren't so bad to write when you've got Ruby on your side.

Nov 17, 2014

Round to the nearest 0.5 in Ruby

A cool and quick trick to round floats to the nearest 0.5 in Ruby.

Nov 01, 2014