Archive for September, 2010

‘look behind’ Regular Expressions in TextMate

I just had the problem that I wanted to remove line breaks which were located after normal characters. The solution was to use a ‘look behind’ Regular Expression, which is also supported by the awesome TextMate editor. This was my find expression:

(?<=[a-z])\n

and I replaced it with an empty string.

Autoload modules in Rails 3

In Rails 3 the modules in lib/ are not loaded automatically. You need to a a one liner to the application.rb:

config.autoload_paths += %W(#{config.root}/lib)

no such file to load — dispatcher

I updated to Rails 3 and tried to deploy the application using passenger in combination with Apache2. I’ve got the following error:

no such file to load — dispatcher

The thing was, that Passenger treats the Rails 3 application as an Rack application because of the config.ru file. To get it run again, you need to change the passenger variables RailsBaseURI and RailsEnv to RackbaseURI and RackEnv respectively in your virtual host configuration of Apache2. Example:

RackBaseURI /
RackEnv production

see also Phusion Passenger User Guide.

The Google-Skull scares me

I am using Google Mail with Google’s Chrome Browser and I am a little bit scared of this scull.

Goo.gl URL shortening

Image representing Google as depicted in Crunc...
Image via CrunchBase

Didn’t know, that Google has it’s own URL shortener

Google URL Shortener at goo.gl is a service that takes long URLs and squeezes them into fewer characters to make a link that is easier to share, tweet, or email to friends. The core goals of this service are:

  • Stability – ensuring that the service has very good uptime
  • Security – protecting users from malware and phishing pages
  • Speed – fast resolution of short URLs

Google URL Shortener is currently available for Google products and not for broader consumer use.

Amazon Micro Instances

Micro instances provide 613 MB of memory and support 32-bit and 64-bit platforms on both Linux and Windows. Micro instance pricing for On-Demand instances starts at $0.02 per hour for Linux and $0.03 per hour for Windows.
Customers have asked us for a lower priced instance type that could satisfy the needs of their less demanding applications. Micro instances are optimized for applications that require lower throughput, but which still may consume significant compute cycles periodically. Micro instances provide a small amount of consistent CPU resources, and also allow you to burst CPU capacity when additional cycles are available.
(via Amazon)