Tags
array bash benchmark cli compose compose key configuration css diy editorial firefox fixes gotcha hack hardware html5 input javascript jquery jsperf keyboard linux mouse multi touch multitouch nginx opera performance preferences prototype ruby sameheight snippet special characters ssh style syntax touchpad touch pad trackpad track pad ubuntu w3c web standards wiiCategories
-
Recent Posts
Recent Comments
- Lashell on Defining Functions Inline Is Just Fine
- Christian Iversen on JavaScript Performance: Iterating over Arrays with Holes
- force on JavaScript Performance: Iterating over Arrays with Holes
- Christian Iversen on JavaScript Performance: Iterating over Arrays with Holes
- force on Delete a Line from a File by Its Line Number
Archives
Meta
Tag Archives: ruby
extconf.rb:4:in `require’: no such file to load — mkmf (LoadError)
I’ve hit this a dozen times and I always forget the solution. When you get this on Ubuntu, sudo apt-get install ruby-dev
Show Duplicate Filenames with Ruby
Here’s a quick one. I want to show just the names of files that have the same basename in a directory. Code require ‘find’ require ‘set’ all_files = [] duplicates = {} basenames = Set.new ARGV.each do |dir| Find.find … Continue reading
Ruby instance_eval gotcha
I don’t know how much of a “gotcha” this is since it’s just a defined behavior and feature of the language, but I still found it a little counterintuitive when I encountered it, and I had to actually read the … Continue reading
Run Sinatra App in a Subdirectory with Rack::Builder.map
Thank god I found Tanner Burson’s blog. I was about to explode. I recommend reading Tanner’s original post, but the short answer is that you want Rack to do some routing for you via Rack::Bundler.map. Here is a super simple … Continue reading
Request Tracker Watchdog
I recently upgraded from Request Tracker 3.8.0 to 4.0.2 and started running it with FastCGI. Works great except for the odd Bad Gateway message from nginx (still haven’t figured that one out). While v4 makes a lot of improvements over … Continue reading
Running Rails 2.3.14 on Ruby 1.9.2
While trying to run Rails 2.3.14 on Ruby 1.9.2, I was getting an error page with ActionView::TemplateError (invalid byte sequence in US-ASCII) Turns out Rails 2.3.14 on Ruby 1.9.2 was trying to read my UTF-8 data as US-ASCII. Solution Don’t … Continue reading
Sanitizing File Names with Ruby
At work, I ran into a problem wherein I was copying files from one filesystem (FAT32) to another (NTFS), and there were file names with characters that were legal in the first, but not the second. I wrote a Ruby … Continue reading