|
What we're listening to:
|
refinerycms-blog: comments with DISQUSApril 8th, 2010For adding a blog to your refinery site, there’s pretty much only one option: the refinerycms-blog plugin. Fortunately like most refinery things, it’s pretty easy to customize. I wanted to use DISQUS to moderate the comments on this particular blog, and here’s how I did it (You obviously need a DISQUS account to do this). If a file referred to doesn’t exist, copy it from vendor/plugins/app/views/blogs to your theme directory.
Pretty easy. refinerycms _blank target navApril 7th, 2010Recently I’ve been evaluating refinerycms for a few client projects that it seemed suited for, and I really like that while it’s not always 100% what I want, it’s very easy to modify to get it to where I need it. Here’s an example: My site needs a main nav to link offsite in a new window by adding target=”_blank” to the link, which is not handled out of the box by refinery. So I copied vendor/refinery/app/views/shared/_menu_branch.html.erb into my theme directory to override the functionality and modified line 11 to the following: <%= link_to menu_branch.title, menu_branch.url, \
:target => menu_branch.url.include?("http://") ? "_blank" : "" %>
Now any link containing http:// is automatically given a blank target. Presto. 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. all day events in event calendarDecember 10th, 2009Some events don’t start and stop at specific times, but instead last all day. We’ve had this option when creating events in our application(s), but until now it wasn’t visually apparent when shown in EventCalendar, a rails plugin. Now we have a new use_all_day option! When set to true, the plugin checks if the event is all day and/or multiple days. If it is, then it will display with the usual background color bar. Otherwise it just shows the event text using its color. (Similar to many popular calendar programs.) For more info check out: the screenshot, homepage, and github (commit). Event Calendar HTML Generation RewriteNovember 23rd, 2009The Event Calendar rails plugin (see: post & github) we created a few months back has been working great and, thanks to all the feedback, the bugs have pretty much been worked out. There was one annoying limitation, however: The width couldn’t be set arbitrarily. Well, no longer. I completely re-wrote the HTML and CSS styling that the helper generates. Events are now table columns which span the calendar days. The calendar grid is also a table, not a background image which needed to be created whenever setting a non-default width. This means you can give the calendar any width, or don’t set it at all and let it resize to it’s containing element. Awesome! I also took the opportunity to remove some old code, comments, and options that were hanging around from the plugin’s previous lives. In some ways there is now more flexibility to customize, in a few ways less. One consequence is that some of the options from before the rewrite no longer exist, so update with care. Overall I’m very happy with how it turned out. Enjoy! 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 Event Calendar Rails PluginJuly 23rd, 2009For a recent project we needed to show events on a calendar. The existing Rails plugins we tried didn’t allow us to satisfactorily show multiple, overlapping events across calendar days and rows. I found the same complaint here and began to adapt it to our needs. I’ve extracted the result and put it on github in the hopes that others might find it useful and/or add improvements. http://github.com/elevation/event_calendar The above link has more details, as well as how to install and use the plugin. Here’s the 1000 word screenshot: Using the use_all_day option: PLEASE:
Thanks and enjoy! amend git commitFebruary 4th, 2009Thanks to the beauty of local git repositories, I no longer worry about committing. So what if things aren’t pretty, its just a snapshot of my work in progress. When I push to remote, however, its a good idea to clean up these commits. Up till now I’ve been using git rebase -i which, while very handy, can be a bit of overkill for my normal workflow. Instead I can use git commit --amend to squash my new changes into the latest commit. This is what I’ve usually been doing with rebase -i anyways. And making a new git alias removes the extra typing. Git ‘R done |