Tag Archives: Ruby

Most Popular In-Demand Programming Languages of 2014

Do you wonder which programming languages are the most popular and in-demand and how they compare with Ruby? Here is a comparison of the following languages: Ruby, Python, Php, Javascript, Scala, Java, Objective-C and C Unfortunately, I had to leave out Go in this comparison since “go” is such a generic term and “golang” didn’t […]

Log to your JavaScript Console from Ruby

You can log to your JavaScript console from Ruby with https://github.com/ConradIrwin/console.log What problems has it solved for you?

Setting up Cron jobs that call Ruby (RVM) or Shell Scripts via Bash

If you are on a unix system and want to set up a crontab (cron job) and you are using RVM, you must make sure to make bash act as if it had been invoked as a login shell by using the bash -l option. So if you were going to have a script run […]

Ruby Garbage Collection and Memory Profiling

These slides by Joe Damato and Aman Gupta explain Garbage Collection and the Ruby Heap really well. It talks about the following: How memory is managed in Ruby vs C All variables and all ruby code lives on the heap like any other object In ruby there’s no way to explicitly free memory How the […]

Lightning Talks at GoGaRuco

At GoGaRuco (Golden Gate RubyConf) today in San Francisco, CA The following is just some brief notes and may or may not make any sense. Talks went pretty quickly. Concurrency with Rubinius Ron Evans – TicketMaster (universal api) – allows migration of one system to another. (supports JIRA amongst other things) —– Fixture Builder by […]

Data-Driven Government and the Ruby Developer

At GoGaRuCo (Golden Gate RubyConf) today in San Francisco, CA… Talk by Eric Mill who works at Sunlight Labs and who is working with government to make their data public. Here are some examples of where you can get data. Data SF.org Californa Data Chicago Every Block New York Data Mine United States Data GovTrack.us […]

Instance and Class Variable Accessor Methods

When you define classes in Ruby, you must specify what kind of access you want to give Instance and Class attributes/variables which are defined in that class. The way you do it is that you write reader and writer methods. You can write these methods out explicitly or use the shorthand attribute (attr_) methods like […]

Ruby Iterators

Here are some Ruby Iterators and description of how they can be used: times Iterate through the block 3 times, n starts at 0 and ends at 2 and is incremented by 1 each time. n is the block variable. upto Iterate through the block 3 times, starting at 1 and ending at 3, each […]

Avoid Duplication of Hash Options

There are lots methods in Rails where the last argument is a Hash. Sometimes the same Hash is passed into more than one method, causing you to repeat yourself. For example, when using validation helpers in your models, you may be doing something like this: Using with_options within a Model: Notice, :on => create is […]

Ruby Require VS Load VS Include VS Extend

Here are the differences between Require, Load, Include and Extend methods: Include When you Include a module into your class as shown below, it’s as if you took the code defined within the module and inserted it within the class, where you ‘include’ it. It allows the ‘mixin’ behavior. It’s used to DRY up your […]