April 2008
41 posts
A PHP FYI
empty($object->name) doesn’t actually work. The expected behavior would be to return TRUE if $obj->name is empty. Instead, it just returns TRUE. All the time. If you want to test the existence of an instance variable, you’ll have to use !($object->name)
Apr 29th
If I had a nickel…
…for every time in the past week that I tried to create an array in PHP using ['bracket', 'syntax'], I’d be…able to buy a slice of pizza or something.
Apr 25th
“The problem with feeling you’re doomed is not just that it makes you...”
– Be Good A wonderful article by Paul Graham. I think in particular this quote applies not just to startups writing code but anyone developing any product. It is amazing how much of a correlation there is between how happy you are working on a project and how much you get done. Being happy == being...
Apr 25th
Apr 25th
Apr 24th
111 notes
NYC Apartment Hunting
So it looks like I’m going to be moving to NYC after graduation. Anyone have any suggestions for the best way to go about finding an apartment?
Apr 23rd
Apr 23rd
“ def sanitize_sql_array(ary) statement, *values = ary ... end This is...”
– Ruby Pearls vol. 1 - The Splat I saw this head & tail thing in Erlang a while ago & have been wondering if there was a nice way to replicate it in Ruby. Brilliant!
Apr 23rd
Apr 23rd
11 notes
Python vs. Ruby
Given a collection of objects, we want to filter the list based on some property then grab a collection of the value of a different property for each object. Python: def average(lisp): return sum(lisp) / float(len(lisp)) average([obj.other\_property for obj in [obj for obj in collection if obj.property == some_value]]) Ruby: class Array def average inject(&:+) / size.to_f ...
Apr 21st
Apr 21st
Apr 20th
Apr 20th
Apr 20th
Ten typographic mistakes everyone makes →
Grammar nazis are so last century. Welcome, friends, to the brave new world of the typography nazi. (via jhongosh)
Apr 19th
Milliways: The Restaurant at the End of the... →
Unreleased sequel to the original HHGTTG text adventure.
Apr 18th
stereotypical tumblr user checklist
I, dstrelau… use a mac: Core 2 Duo Macbook (white!) are twenty something: Yes, indeed! take polaroids: Digital polaroids? live in nyc: Maybe soon! wish you lived in nyc: Yeah… draw sometimes: Rarely. upload videos to vimeo to fit in: Not really. I’m more the photo/text kinda guy. have a muxtape: Not yet. Soon! work for collegehumor/vimeo/bustedtees: Nope are a...
Apr 18th
174 notes
Apr 18th
“Here’s a tip for keeping up to date: In lieu of using git pull to download...”
– Best Practices for Contributing to Rails with Git Really, good info for contributing to any project with Git.
Apr 18th
Time Management →
Apr 17th
“So the rule is… Use flash when you’re going to redirect, so that the next...”
– All the kings horses
Apr 16th
open break-up letter to rails  →
really need to get on this merb thing
Apr 16th
Git much?
[~] history|awk '{print $2}'|sort|uniq -c|sort -rn|head 102 git 72 gt (alias for git status) 59 go (alias for git checkout) 36 cd 29 gb (alias for git branch) 23 ls 19 mate 19 gd (alias for git diff) 17 ga (alias for git add) 13 mysql
Apr 15th
Apr 15th
Apr 15th
9 notes
The value of immutable values →
Apr 15th
Polymorphism is always the wrong term →
Apr 15th
“Particularly good writing is probably going to boost your grade even if your...”
– An email from a teaching assistant for my 300-level class at Cornell University. I’d say that good writing should be the standard and that poor writing should bring your grade down. I suppose I just expect people to know how to write by the time they get to university…
Apr 15th
The Rather Difficult Font Game →
I scored an embarrassing 23/34… (via DF)
Apr 15th
1 note
Magic Eye Through Text →
(via featureorbug)
Apr 15th
To: Anyone Who Imports Their Top 5 Artists From...
Please stop.
Apr 14th
Cheap Rails VPS options →
I’ve had a Slice for a year now and have been really happy with it!
Apr 14th
1 note
Rails on GitHub →
Hooray!
Apr 11th
“ create_table :taggings do |t| t.references :tag t.references :tagger,...”
– Changeset 7973 - Rails Trac I had no idea you could do that!
Apr 11th
Apr 11th
The Thing About Git →
Great description of why the Git staging area is awesome (not evil) and how to take advantage of the power of git add --patch
Apr 10th
Apr 8th
“So the only thing that really teaches you to fucking ship is, well, fucking...”
– Amy Hoy’s Just ship. Seriously.
Apr 8th
Renderance →
On web typography
Apr 8th
“alias bashrc='vi ~/.bashrc && source ~/.bashrc' Now you can type...”
– ozmm Brilliant! Now just make that mate instead and we’ve got a real winner!
Apr 8th
Apr 6th