Working with Ruby
Occasional blog posts about Ruby updates, tools, editor tweaks, and random snippets. You might also be interested in my newer project that docuements lesser-known features in Ruby: Idiosyncratic Ruby.

Idiosyncratic Ruby

May 2015, one-liners · regex · golf · fun · docs · irb · thoughts · tutorial · hints · stdlib · ruby

For the whole of May, I will blog about weird things in Ruby over at Idiosyncratic Ruby – Don’t miss it!

Be More Productive with Better Sublime Snippets for Ruby!

Long time readers of this blog will remember that I used to tweak GNOME’s gedit editor a lot. However, I ditched it for Sublime Text and I am not looking back. Here are some of the things I like about Sublime:

  • Offers a good out-of-the-box experience, including an amazing “fuzzy search” tool (ctrl+p)
  • It works on ubuntu without any problems
  • Fast (enough)
  • Multiple cursors!
  • Once you have installed Package Control: An integrated extension repository
  • Encourages you to write your own extensions
  • Looks good

Get your Microscope for MicroLogger: A small Logger on Top of MicroEvent.rb

Being impressed by MicroEvent.js I played with the thought to use such a library not only in JavaScript, but also in Ruby. The design pattern of this kind of message passing is called observer pattern and there is also a library in Ruby’s standard library and some more on rubygems.org. However, MicroEvent.js just nails it,

…read

The CARB stack: Coffee + Angular + Rails + Bower

AngularJS is a great way to build modern web apps and this affects Rails programmers. The combination of both is an excellent choice: Build your single-page app in Angular and let it communicate via JSON with your Rails-API backend (btw, this is exactly what we did for palava). However, you might ask yourself, what the best way to combine Angular and Rails is. Should you use the JavaScript tools world (grunt, yoeman, etc.) or should you prefer the Ruby tools (thor, sprockets)?

…read

5 Ruby Syntax Edge Cases

My lightning talk from this year’s eurucamp:

…read

Ruby and Random

Wrongly used randomness can be the source of hard-to-detect bugs and security holes. This is relevant every time you use randomness, for example, when implementing an existing protocol/interface that requires random values or generating tokens for your next raffle. This article describes when to use which of Ruby’s randomness methods.

…read

ActiveSupport 4 by Example: Numeric#to_s

The NumberHelper functionality is now available as Numeric#to_s

…read