|
What we're listening to:
|
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 validate image dimensions with paperclipJanuary 31st, 2009I’m liking paperclip, in a recent project I chose it specifically because it buffers writes on uploads, which should help keep memory usage down. I needed to validate that an uploaded image was at least a certian size, and it was a little tricky, but here’s what I came up with:
has_attached_file :image,
:styles => { :original => ["1000x600>", :jpg]},
:whiny_thumbnails => true
def validate
dimensions = Paperclip::Geometry.from_file(self.image.queued_for_write[:original])
self.errors.add(:image, "Please upload a file at least 700 pixels wide") if dimensions.width < 700
self.errors.add(:image, "Please upload a file at least 200 pixels tall") if dimensions.height < 200
end
like it? hate it? have something better? redmine and gitJanuary 15th, 2009Over the last few months, I’ve become a big fan of Redmine. It’s just what I was looking for when I was tired of setting up a TRAC for each project but missed the source code integration when we were using Basecamp. Redmine doesn’t look very pretty at first, but there’s some good themes (we use the basecamp inspired theme) that make it much better. When we started using git, it brought some new issues up with our workflow and redmine, and we’re not the only ones . Some people are just changing and making the repository on their redmine server their “central” repository, but our redmine is hosted locally, and our repositories for each project are hosted on the deployment machine. This causes some problems because the redmine repo doesn’t receive updates. There’s a plugin aimed at solving this, but it’s not functional yet. We solved it with a quick hack to run a git pull before redmine brings in new information from the repository:
Index: app/models/repository/git.rb
===================================================================
--- app/models/repository/git.rb (revision 2251)
+++ app/models/repository/git.rb (working copy)
@@ -36,6 +36,7 @@
end
def fetch_changesets
+ scm.fetch
scm_info = scm.info
if scm_info
# latest revision found in database
Index: lib/redmine/scm/adapters/git_adapter.rb
===================================================================
--- lib/redmine/scm/adapters/git_adapter.rb (revision 2251)
+++ lib/redmine/scm/adapters/git_adapter.rb (working copy)
@@ -24,6 +24,11 @@
# Git executable name
GIT_BIN = "git"
+
+ def fetch
+ cmd="#{GIT_BIN} --git-dir #{target('')} --bare fetch"
+ shellout(cmd)
+ end
# Get the revision of a particuliar file
def get_rev (rev,path)
Simple, but functional. Give us a shout if this helps you or if you have a better solution. |