Posted in Music, Ruby on April 19th, 2013 No Comments »
Over the years, I’ve ripped CDs in various formats. In the beginning, it was MP3, but I soon switched to OGG. A few years ago I, it made the switch to FLAC. Unfortunately, that leaves me with a large “sediment” of files in lossy formats and I’ve started to rip those again — for the [...]
Posted in Ruby, Shell, Tools on June 8th, 2012 No Comments »
What’s new? Rake tasks are cached (thanks to turadb). If there is no Rakefile in the current directory, ancestor directories are searched in the way Rake itself does. Installation Copy the file to /etc/bash_completion.d or possibly /usr/share/bash-completion/completions or to another place where it is loaded when your Bash shell is started.
Posted in Database, Rails, Ruby on May 29th, 2009 No Comments »
A presentation I held on May 28 at Düsseldorf on Rails about interesting and useful things you can do with ActiveRecord, SQL, and a smart database. german english .
Posted in Rails, Ruby on April 2nd, 2009 No Comments »
Didn’t you always want to write your Rails views as plain Ruby objects? — “What?”, I hear you say. No, I haven’t lost my mind and the idea is quite sensible (or so I hope), once you add the restriction that it is JSON-formatted data that you want to return. Say you need to set [...]
Posted in Linux, Ruby on December 22nd, 2007 No Comments »
Victor Serbin sent me a version of the completion updated for Gem 1.0.1. You can get it here. Apparently, Ubuntu and Debian have begun to bundle this file with their rubygems packages. Great!
Posted in Linux, Ruby, Shell on February 24th, 2007 10 Comments »
The gem command is the command line user interface to the RubyGems system for managing Ruby packages. This command has a few sub-commands itself and a long list of options that differ per sub-command. Remembering and typing them can be tedious, but thankfully, if you are using the bash command shell, it can help with [...]
Posted in Rails, Ruby on February 14th, 2007 No Comments »
It was late last night. And the night before, I admit it. I also admit that I don’t know much about what Web 2.0 is all about, but there are two things that I do know: rounded corners are involved and, of course tags and tag clouds. Tagging is work, therefore ipso facto to be [...]
Posted in Rails, Ruby on February 12th, 2007 9 Comments »
Variations on the Decorator Design Pattern in Ruby have already been discussed in several places. For my special purpose, none of these approaches works. The common problem with a decorator based on delegation is the lost sense of self. Method calls of the decorated object to itself are not routed through the decorator, therefore remain [...]
Posted in Rails, Ruby, Tools on January 1st, 2007 No Comments »
I’m using Eclipse with RadRails to edit my Ruby and Rails code (and, yes, I’ve used it for Java, way back when). Inside Eclipse the various text editors offer so-called templates. These are snippets of common code with placeholders for variable bits. Type in the abbreviation for a template, then type Ctrl-Space and the abbreviation [...]
Posted in JavaScript, Rails, Ruby on December 15th, 2006 21 Comments »
Ruby on Rails already does a good job of specifying almost declaratively what conditions objects must meet to be considered valid–that is, how they are validated. Thus, in order to make sure that a Person’s last_name attribute does not exceed 100 characters, you would write something like this class Person < ActiveRecord::Base validates_length_of :last_name, :maximum [...]