Skip to content

Instantly share code, notes, and snippets.

tihtihw iwehr iwer wer weir wer wer wer wer wer we rwer wer wer
For 2 (large) servings:
1lb red snapper
1/4 cup lime juice
1/4 cup lemon juice
1/4 of a large onion
1/2 cup tomatoes
1/2 Serrano pepper
1 tsp salt
1/4 tsp Tabasco sauce
@phildarnowsky
phildarnowsky / max.c
Created June 29, 2015 16:57
Function that returns the greater of two integers
int max(int a, int b) {
return (a < b) ? b : a;
}
@phildarnowsky
phildarnowsky / about.md
Created August 30, 2011 16:42 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
@phildarnowsky
phildarnowsky / about.md
Created August 30, 2011 16:40 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
>> phil@amanuensis:~/src/hengage$ heroku console
Ruby console for hengage.heroku.com
>> BadMessage
=> BadMessage(id: integer, phone_number: string, body: string, received_at: datetime, created_at: datetime, updated_at: datetime, is_new: boolean, on_watch_list: boolean, reply_count: integer)
# There's my new counter_cache column, reply_count. Let's initialize it to 0 on every record...
>> BadMessage.all.each {|bm| bm.reply_count = 0; bm.save!}; nil
=> nil
def summer_monthly_usage
return @summer_monthly_usage if @summer_monthly_usage
monthly_usages = rates.summer_months_nbr.map{|month| monthly_usage[month - 1]}
@summer_monthly_usage = monthly_usages.inject(0){|sum, v| sum += v}
end