January 2008
39 posts
A few weeks ago, I received an e-mail from the folks at Amazon EC2, where the...
– Adrian Holovaty says goodbye to chicagocrime.org
The root of idiot compassion is selfishness, where the suffering of another is...
– Kick-ass Compassion
For a Ruby application increasing in size at rate of X, with an amount of...
– Kurt’s Law of Ruby Complexity
Lachie: “Hey Tim, is the network slow?” Tim: “Nah aah, girlfriend. You slow. Or...
– de-bulk your gem threshold
UTF8-less permalink in Ruby
require 'iconv'
String.class_eval do
def permalise
split(" ").map do |s|
Iconv.iconv("ascii//translit", "utf-8", s).to_s.gsub(/\W+/, '')
end.join(" ").downcase.strip.gsub(/\ +/, '-')
end
end
if $0 == __FILE__
require 'test/unit'
class StringPermaliseTest < Test::Unit::TestCase
def test_permalise
assert_equal "delfin-francois", " delfín François ".permalise
...
Varnish is a state-of-the-art, high-performance HTTP accelerator. Varnish is...
– Varnish
Before Product/Market Fit, a startup should ideally raise at least enough money...
– How much funding is too little? Too much?
The only thing that matters is getting to product/market fit.
– Rachleff’s Corollary of Startup Success from The only thing that matters
A successful marketing oriented company is not product driven. Its success comes...
– Marketing #1 by Mike Volker
Preferences are for the masses. Any real coder knows the easiest and best way to...
– Enki - A ruby on rails blogging app for the fashionable developer.
the peanutbutterjelly element
Installing ri documentation for haml-1.8.0...
ERROR: While generating documentation for haml-1.8.0
... MESSAGE: Unhandled special: Special: type=17, text="<!-- This is the peanutbutterjelly element -->"
... RDOC args: --ri --op /Library/Ruby/Gems/1.8/doc/haml-1.8.0/ri --title Haml --main README --exclude lib/haml/buffer.rb --line-numbers --inline-source --quiet lib VERSION MIT-LICENSE...
Simple Ruby model for nested navigation
# Simple model for nested navigation. Use like so:
# @menu = Menu.new do
# item :home, "Home" do
# item :stocks, "Stocks"
# end
# end
class Menu
attr_reader :items
class Item
attr_reader :name, :label, :children
def initialize(name, label, *args, &block)
@children, @name, @label = [], name, label
self.instance_eval(&block) if block_given?
...
Using Rails routes anywhere
via ara’s snippet
#
# this is how to use action_controller routes in a class/module other that the
# rails' view and controller classes
class C
ActionController::Routing::Routes.install_helpers C
def initialize
@home_path = home_path
end
end
class SizeMatters
– a bit of light humour in the Comparable Module ruby docs
Edit Google Maps: You know your neighborhood... →
Google’s marketing of their new user-driven geocoding correction Edit Google Maps has targeted people wanting to correct the location of their own house address. Definitely more relevant to the average punter than simply correcting any old Google Maps geocoding result.
Bow Wow must be old now! He’d be a real gangster.
– Myles Byrne @ the Jelly in Sydney
The more significance you give the moment, the more the moment has the...
Wisely, the duo also know when to let the bass be, allowing large portions of...
– Word of the day: unfuckwithable, from Pitchfork Record’s Daft Punk Alive 2007 Review
If you want remarkable results, feed a good programmer a diet of good design.
– Reflections of an Interface Designer