where'd my css go? or: a call for advice
Posted by jacqui maher on May 07, 2008 at 08:55 AM
Huh, I somehow lost my custom CSS for this site. Probably when I was updating Simplelog… I don’t (obviously) have a very good, backed-up setup for my SliceHost. Argh!
This brings me to several questions I’ve been wanting to ask the world of talented developers I know (yes you!):
What are you guys using?
I’m curious about directory structures - should I put my sites in my home directory? /usr/local? /www?
What about version control? When you’re using third party apps (like SimpleLog) that are themselves hosted in version control systems like svn or git, do you then export or clone them and stick them in your own local SCM, or perhaps github?
Web servers? Is everyone on Nginx? What are your configs like for it? Did you use ErrTheBlog’s Nginx config generator to start off? I know some people who use LightSpeed and that looks snazzy.
And how about your dot files? I’m talking about .vimrc, .irbrc, .bashrc/.tchsrc/etc. I made a repo in my github acct for these, but it seems like overkill. How should I deploy that anyway? A lot of dotfiles go into their own directories, and I’m not sure how best to structure my repo for it.
There’s a lot of ground to cover here, I guess. Help :)
I love bike riding
Posted by jacqui maher on May 01, 2008 at 03:07 PM
and now I’m going to blog about it. Riding in NYC is a bit tricky - while it’s great to be able to pass tons of traffic and feel the breeze in your hair along the Hudson River Park path, it also sucks to have tourists driving SUVs and insane cab drivers almost kill you, sometimes several times in a single block. The dangers come from both obliviousness and malevolence on the part of (mostly) drivers and (somewhat) pedestrians, and, yes, rarely, other bicyclists.
I started riding into work because I found, upon returning to NYC after 4.5 years in California, that the quality and reliability of the subway system had taken a severe turn for the worse. (seriously, wtf happened in so short a time? am I being nostalgic, or has it really gotten a lot worse?) Now that I’ve known the fun and fresh air of commuting by bike, though, the subway is pretty much intolerable.
I just hate standing around, waiting. The one thing I miss is the amount of time I’d have to read books… but I try to do that at night now; it’s a nice way to wind down from the day.
That’s it for now, expect more news as I learn good routes, which I’ll post via mapmyride.com, and find useful or just cool gear.
my bike, a fuji crosstown 3.0 hybrid:

Single table inheritance strangeness
Posted by jacqui maher on April 29, 2008 at 10:19 PM
I suppose “special” is a word for this behavior. I would have expected a constraint used in find_by_id to also be used in find. Right.
>> Asset.find_by_id(params[:id])
# => nil
log: Asset Load (0.009816) SELECT * FROM assets WHERE (assets.`id` = ‘8515’) AND ( (assets.`class_name` = ‘Asset’ ) ) LIMIT 1
>> Asset.find(params[:id])
# => #
log: BaseAsset Load (0.000528) SELECT * FROM assets WHERE (assets.`id` = 8515)
print out a controller's expected actions
Posted by jacqui maher on April 26, 2008 at 04:59 PM
Ever want to see a list of actions defined on your controller and what methods over http they expect?
try this in your console, where “users” is your controller’s name:
1 ActionController::Routing::Routes.routes.select do |route|
2 route.defaults[:controller] == "users"
3 end.uniq.each do |route|
4 puts "#{route.defaults[:action]} expects http method: #{route.conditions[:method]}"
5 end;nil
model_stubbing in Rails 1.2.x
Posted by jacqui maher on April 18, 2008 at 03:58 PM
I really like technoweenie’s plugin model_stubbing. It’s a nice alternative to fixtures, and an even nicer way to create stubs in your tests and specs.
Unfortunately the StreetEasy codebase is still on Rails 1.2.x which caused compatibility problems with the plugin. Rails 2 refactored Fixtures and database statements a bit.
I had to modify the plugin to get it to work with older versions of Rails. I forked the project on github and post about it to help anyone who’d like to use the plugin but is not upgraded to Rails 2 yet.
github homepage: forked model_stubbing
public clone url: git@github.com:jacqui/model_stubbing.git
[edit] btw, simplelog was munging the href for the public clone url; it seems to like prepending http:// to links, so i just removed the anchor tags from it.