July 2011
1 post
June 2011
1 post
March 2011
3 posts
I’m not able to open PDF files - I don’t use a Mac. Luckily, my assistant was...
– (via clientsfromhell)
February 2011
2 posts
najafali.com - Why PHP is better than Ruby →
hooobs:
This brought a tear to my eye.
Revisiting rebinding self on lambdas
In my previous post on the topic I determined the best method would be to pass the current self into the lambda:
fun = -> context {context.thing}
fun.call(self)
But in a recent project I revisited the problem and discovered you can do this:
class Deal
def emit_a_funky(funk)
#returns a lambda which takes a name argument and calls the lambda
#passed in with the name argument and...
January 2011
1 post
Nested joins with Arel
Today I had to convert this old Active Record finder to the new Arel backed Active Record:
@promotional_offers = Offer.find(:all, :joins => {:business => :city}, :conditions => {:businesses => {:cities => {:id => @city.id}}})
I couldn’t quickly find docs for Arel on how to do this, but after a couple stabs at it I discovered that this does the trick
...
December 2010
1 post
November 2010
1 post
Ruby Procs and their execution context
I had a problem just now which involved creating a proc in one class, and executing it in the context of a different class. I pondered the problem for a little while, did a little research, and then realized the obvious solution would be to pass the current self into the proc.
Example:
stuff = lambda do |context, thing|
context.some_method(thing)
end
Thought I might save someone the...
October 2010
7 posts
Debugging is twice as hard as writing code in the first place. Therefore, if you...
– Brian Kernighan
here are some cat gifs
hooobs:
themotherfuckingfox:
thelastgoodthing:
wowsomeoneactually:
xiamfuckingtiredx:
laura0mck:
kelseybrewer:
neekaisweird:
i had to.
i had to too
i had to too, too.
my life is made.
Lets run this shit into the ground!
Using Active Merchant for recurring billing →
Note that arguments passed to the recurring method vary by payment gateway. Refer to the active merchant docs for specifics: http://activemerchant.rubyforge.org/
And if you’re using Braintree, this might be helpful:
http://mandarinsoda.com/2008/06/02/recurring-billing-with-braintree-and-activemerchant/
Rspec 2, Rails 3, Autotest, and Spork
So I spent a little bit of time getting all of these kids to play nice together and I figured I’d save someone else the hassle of figuring it out.
Initially I configured my spec_helper.rb to use spork, fired it up and tried running ‘autotest —drb’ which didn’t work. Then I realized I should try and use autospec, since —drb is an rspec specific argument, but...
My new single. She's lyke duh w1nd. →
Spread it around like peanut butter and honey.
i know no amount of emoticons can truly describe the pain you feel right now.
– Wes
Just read ‘batting cages’ as ‘battle cages’ and thought...
June 2010
1 post
May 2010
2 posts
April 2010
26 posts
1 tag
2 tags
webosdev note to self, never try and register tap events on anchors. They don’t...
– angrysow
Lazerscale →
Sweet electronic trackz for freezies
October 2009
2 posts
2 tags
Yay!
The fbml for a facebook profile tab can include a head element, in which you can include a stylesheet. This is extremely helpful information I stumbled upon entirely by accident.
3 tags
working with fb-board in facebook apps
when using the fb-board fbml tag, be sure that the page you embed it on responds to POSTs, or that if you specify a callbackurl, that url responds to POSTs (and possibly {I haven’t tested it} has an fb-board tag with same xid embedded in it). Otherwise when you create a post on the board, it won’t save it.
September 2009
1 post
2 tags
list of facebook event types
I’m currently working on ‘remaking’ the facebook events creation form for a facebook app that needs the ability to make events associated with a resource. I was investigating all the event types and sub-event types on the developer wiki, but the list wasn’t up to date. Plus, it doesn’t show what event types and sub-event types go together. So I whipped out trusty ole...