Log » Archive 2006 - (33 entries)
Is there a pure-ruby ordered hash? I'm looking for something that will
preserve the order in which key/value pairs were entered.
Although one might argue that a Hash that preserves inserti...
WDDX is an XML-based technology that enables the exchange of complex data between Web programming languages, creating what some refer to as 'Web syndicate networks'. WDDX consists of a language-in...
I'm using the very convenient RSpec Rails plugin.
From the Rspec website:
RSpec is a framework for practicing Behaviour Driven Development (BDD) in Ruby.
You can find more information on...
Get http://rubyosa.rubyforge.org/ if you are programming Ruby on Mac OS X!
RubyOSA is a bridge that connects Ruby to the Apple Event Manager infrastructure. In other words, it allows you to...
Running attachr.com for quite a while i noticed that the email service (you can send an email to save@attachr.com to save a code snippet) became target for spam mails.
I decided to install spam...
./script/generate model MediaFile --svn
creates your model and test files. The generated files are automatically added to your Subversion repository (after commit).
exists app/models/...
Unfortunately there is no easy way to install Ruby 1.8.(4|5) on Debian Sarge (stable).
Here is how to install Ruby 1.8.5 on Debian Sarge stable:
Add deb-src http://ftp.debian.org/debian/ u...
Installing the native MySQL-Driver for Ruby on my MacBook Pro (Mac OS X 10.4.8) resulted in the following error after running
sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql.
...
Soon to be announced on ruby-lang.org: Ruby 1.8.5 is out.
You can get it here: ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.5.tar.gz.
Read the release note on ruby-talk mailing list.
...
The TIME protocol is an internet protocol defined in http://www.faqs.org/rfcs/rfc868.html
This script shows how to connect to an arbitrary TIME-Server using Ruby's Net::Telnet library.
r...
The latest release of Eclipse (Eclipse 3.2) comes with Callisto, a rich set of optional plugins for Eclipse 3.2. Callisto includes a powerful profiling tool called the Eclipse Test & Performance Too...
While trying to get Struts working with MySQL 5 on Mac OS X 10.4 i got the following exception:
java.io.IOException: Unexpected end of input stream
at com.mysql.jdbc.MysqlIO.readPacket(M...
Ruby has different libraries that provide higher-level access to network protocols such as FTP, HTTP or HTTPS. This article shows the usage of net::http, net::https, open-uri and the rio library...
Dispatcher.reset_application! reloads your model while running script/console.
stefan@www:~$ ./script/console
Loading development environment.
>> ...
[...]
>> Dispatcher.reset_application!
...
The following script shows how to convert Microsoft Word files to DocBook XML using OpenOffice on Windows. The batch script uses OLE (Object Linking and Embedding) to transform an unlimited number...
This is a MANDATORY upgrade for anyone not running on a very recent edge (which isn't affected by this). If you have a public Rails site, you MUST upgrade to Rails 1.1.5. The security issue is sev...
With Mac OS X Leopard and Time Machine, not only can you back up and preserve everything on your Mac - including priceless digital photos, music, movies, and documents - without lifting a finger, ...
Using the most recent version of Rails the rdoc rake task fails on my windows test box.
A quick and simple hack enables the rdoc task.
Replace:
Rake::RDocTask.new("appdoc") { ...
Add svnserver to /etc/services:
svnserve 3690/tcp # Subversion svnserve
svnserve 3690/udp # Subversion svnserve
Create the xinetd configuration file for svnserve (using svnadmin as the...
Do you use Capistrano to deploy your Rails app?
Capistrano uses subversion to deploy rails applications. Unfortunately this means that the hidden subversion directories (usually .svn) are acces...
Small shell script to restart lighttpd. The script kills all dispatch.fcgi processes and restarts the webserver.
See: http://weblog.textdrive.com/article/185/happy-thanksgiving-daedalus-is-for-dinner, http://weblog.textdrive.com/article/178/fun and http://forum.textdrive.com/viewtopic.php?id=7081 for further information.
As soon as you deploy a rails app on the production server you should consider to "freeze" your Rails. That means to put the Rails framework in a subdirectory (vendor/rails) of your application.
How to search for a specific gem.
Go get http://www.kleptones.com/pages/downloads_24h.html!
Due to the lack of working torrent files i wrote a nifty little ruby script to fetch all the mp3 files (works on OSX and RedHat, your mileage may vary).
Just type "ruby download_kleptones.rb" and all the mp3 files are being downloaded into a "Kleptones_24hours" directory.
See
the kleptones blog for more information.
The "-c" or "--charset" option specifies the character set for the HTML output.
Assuming your current locale is non US the following piece of code will throw a ParseException: Unparseable date: "06-Mar-2006 12:35"
SimpleDateFormat format = new SimpleDateFormat("dd-MMM-...
Here is how to convert your existing CVS repositories to Subversion.
Step 1: get cvs2svn
Go to cvs2svn.tigris.org and download the package corresponding to the version of Subversion you a...
Show memory usage:
stefan@www:~$ free -m
total used free shared buffers cached
Mem: 6051 5998 53 0 586 2187
-...
Let's assume that you have a bunch of images for which you want to create thumbnails.
The thumbnails should be rotated 90 degrees counter clockwise (that is 270 degrees clockwise), scaled to a specific size and renamed from abc_large.png to abc_thumb.png.
Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0; .NET CLR 2.0.50215; SL Commerce Client v1.0; Tablet PC 2.0)