|
What we're listening to:
|
Filtering the Twitter WidgetOctober 6th, 2010While working on a product blog of ours, I wanted to display our recent tweets in the sidebar, but found that included a lot of extraneous @ replies that I didn’t want included in the stream. I’m not sure it’s documented anywhere, but the official twitter widget does allow you to pass a variable called filters to do this. Here’s how I implemented it: On line 2 is where I added my filtering function, in this case all tweets that start with @, which are replies. Line 34 is where I pass the filter function to the twitter widget. Negatives indicates to the twitter script that I want it to remove all tweets that my filter function returns true for. If you wanted to do the reverse, just change ‘negatives’ to ‘positives’ and in this case, it would only show the @ replies in the stream. autospec/autotest cucumber infinite loopJanuary 18th, 2010Had issue today with autospec never stopping, and found this article, but I did have the autotest-rails gem installed. Thanks to Mario Aquino’s article here, I learned that you can pass -v to autospec/autotest and it will print out what triggered it to run. My culprit was rerun.txt, and then I found buried in the Cucumber documentation:
So, to your project’s .autotest or at ~/.autotest, add something like this:
At least, that’s what my ~/.autotest has, and after adding rerun.txt in there, everything is good. Hopefully this will help someone else googling for the same thing I was with no luck. wordpress now playing pluginOctober 20th, 2009We love music around here, which is why we’re always showing off what were listening too over on the left. Some time ago I automated the process of looking up album artwork using the Amazon API and posting it on or blog. This approach has a couple advantages over things like last.fm, like being able to select exactly what you want shown, and automatic linking to amazon for affiliate commissions. I’ve packaged everything up into a wordpress plugin and put it on my github page here: http://github.com/jaredmoody/wp_now_playing It also comes with a nice applescript so you can submit what’s currently playing to your blog with a single click:
I’d love some feedback on it, and patches are also more than welcome. Please report any issues on the github page, thanks! renaming files on upload with paperclipOctober 15th, 2009I hadn’t done this before and everywhere I googled suggested using a custom interpolation to replace :basename in the default :path and :url params to has_attached_file The problem with this is 1. the actual image_file_name column in the database doesn’t get replaced 2 whatever you put in your interpolation function gets run every time the image url gets generated. The answer is just rename the image_file_name before the model gets saved. installing id3lib-ruby on snow leopardSeptember 21st, 2009I couldn’t find this anywhere, but pieced it out from the article on riding rails: sudo env ARCHFLAGS="-arch x86_64" gem install id3lib-ruby |