February 2012
1 post
Feb 16th
January 2012
1 post
Stopwatch
require 'singleton' module Stopwatch if defined?(ActiveRecord) && defined?(ActiveRecord::ConnectionAdapters) ActiveRecord::ConnectionAdapters::AbstractAdapter.class_eval do def log_with_watcher(sql, name = "SQL", binds = [], &block) Stopwatch.instance.event("sql '#{name}'.") do log_without_watcher(sql, name, binds, &block) end end ...
Jan 6th
November 2011
2 posts
Nov 7th
Simple Trie for Autocomplete
require 'test/unit' class Trie def initialize() @root = TrieNode.new @entry_count = 0 end def empty? @entry_count == 0; end def size @entry_count end def add(key, value) return if key.nil? || key.empty? current_node = @root key.each_char { |character| next_node = current_node.get(character) next_node = current_node.add(character) unless...
Nov 7th
October 2011
2 posts
Handy Git Commands
source /usr/local/etc/bash_completion.d/git-completion.bash alias gits="git status" git add -p [alias] staged = diff --cached [color] status = auto branch = auto diff = auto
Oct 10th
Chris's Reading List
C C Programming Language (2nd Edition) by Brian W. Kernighan and Dennis M. Ritchie Java Java Programming Language, The (4th Edition) by Ken Arnold, James Gosling and David Holmes Thinking in Java (4th Edition) by Bruce Eckel Advanced Effective Java (2nd Edition) by Joshua Bloch Advanced Java Concurrency in Practice by Brian Goetz, Tim Peierls, Joshua Bloch and Joseph Bowbeer Ruby Learn to...
Oct 2nd
September 2011
1 post
Sep 4th
August 2011
2 posts
Aug 20th
“USGA Handicap Index Effective: 8/1/11 - 12.3”
– http://www.ghin.com/
Aug 5th
June 2011
1 post
Jun 8th
May 2011
1 post
May 22nd
April 2011
4 posts
Mizuno HttpServer
…couldn’t resist making a few changes to mizuno including an abstract handler, jmx suport, and slf4j logging. It’s just a placeholder for now…still fleshing out some new ideas. module Mizuno class HttpServer include_class 'org.eclipse.jetty.server.Server' include_class 'org.eclipse.jetty.servlet.ServletContextHandler' include_class...
Apr 25th
my tungle profile →
http://tungle.me/michaelbarinek
Apr 25th
Apr 23rd
Apr 16th
March 2011
2 posts
Mar 29th
Mar 10th
February 2011
2 posts
Feb 5th
Feb 2nd
January 2011
3 posts
Jan 27th
3 tags
calculating median values via mysql
Here is a quick mysql sql snippet that I used to calculate median values grouped by year… select a.year, avg(a.rownum), avg(a.value) from ( select if(@current_year=year, @rownum:=@rownum+1, @rownum:=1) as rownum, @current_year:=year as year, amount as value from (your_data_or_select) as amounts, (select @rownum:=0) as r, (select @current_year:=0) as y order by year, amount) as a, (select...
Jan 9th
13 notes
Jan 2nd
December 2010
4 posts
Dec 29th
Dec 29th
Dec 23rd
WatchWatch
pivotal labs boulder - burgers in december…
Dec 17th
November 2010
1 post
Nov 3rd
October 2010
6 posts
1 tag
Rails 3 with RVM and Cruise Control
Here are a few notes on how to get individual CruiseControl.rb project Builders running with RVM. [Note: I’m making an assumption here that you know and understand Bundler and RVM.] [Also: Cruise may or may not be running on RVM] Create and check in a .rvmrc file in your rails root directory. Here’s an example. rvm ruby-1.8.7-p174@rails-example Then, add a project build command...
Oct 26th
1 note
Oct 15th
“@pivotalboulder thank you for helping out last week with #mountainrb, we have a...”
– twitter
Oct 10th
Oct 10th
Oct 10th
Oct 10th
September 2010
5 posts
1 tag
Scoping with confidence
We’ve recently scoped several projects in Boulder. While scoping, several clients asked how we’re able to estimate a project’s cost with such confidence. I’ve thought about this a bit and I actually think this is pretty interesting and remarkably similar to something we’ve all been doing for a while: estimating user stories in Tracker. Scoping a project is very...
Sep 20th
1 tag
Nesting and authenticating resque-web on ey-cloud
Wouldn’t it be nice to include the resque-web interface underneath your current application’s url? Wouldn’t it then be nice to use the same authentication mechanism that your web application uses? Here’s a solution that we used on a recent Rails 2.3 ey-cloud project that accomplished both goals. First, we created a simple resque_web.ru file within our Rails 2.3 project....
Sep 13th
1 note
1 tag
Dependency musings
Recently there has been a lot of discussion around project dependencies. As a result, it has been pretty hard to decide when and if to include a new gem into a project. Overall, I think I tend to weigh in heavier on the side of exclude everything possible except what is absolutely necessary. That being said, here’s the mental check list I tend to work through when deciding whether or not...
Sep 10th
Sep 5th
1 tag
Cucumber performance improvements with Devise...
We’re using Devise’s token_authenticatable to improve our Cucumber test suite performance. Here’s an example feature Scenario: I would like to edit a user account Given I am logged in as an admin user ... And here’s the token_authenticatable step Given /^(?:I am logged in|the user is logged in|the user logs in|I log in)(?: as an? (\w+) user)?$/ do...
Sep 1st
August 2010
6 posts
Reindexing Solr from Cucumber
Here’s a quick snippet that we’re using to reindex Solr from our Cucumber features. “And I reindex assets” helps to ensure that we didn’t leave any cruft around from previous tests and that we’ve properly indexed our Pickle model. Background: And I am logged in as an admin user And an asset with snowboarding tags: "snowboarding" exists with title:...
Aug 31st
1 tag
Fast user switching with Devise
Ever wondered how to login as another user within Devise? Recently we had a feature request that would provide Admins with the ability to sign is as another user. You could imagine live demonstrations or even production support calls where you would like to be signed in as another user, yet not have to ask for or decrypt their current password. After stewing for a bit, we found a pretty nice...
Aug 29th
1 tag
Managing your ey-cloud-recipes
If you’ve recently forked the ey-cloud-recipes on GitHub and then had issues managing and deploying multiple projects with disparate dependencies using the single forked gem, then we have a solution that has worked well on a recent project. We’ve tucked the cookbooks directory underneath our Rails project. To apply Chef changes, we installed the ‘engineyard’ gem and us...
Aug 26th
Aug 19th
“…Pickle is flawed as a concept”
– http://elabs.se/blog/15-you-re-cuking-it-wrong
Aug 17th
Agile the Pivotal Way →
Ian McFarland, Principal and VP of Technology for Pivotal Labs, reprises his popular RailsConf 2010 talk. Ian describes the technical and social aspects of how Pivotal practices agile software development.
Aug 5th
July 2010
1 post
1 tag
Jul 17th
June 2010
2 posts
Jun 11th
Jun 4th
May 2010
2 posts
May 8th
WatchWatch
Kentucky Derby 136 Race Replay
May 2nd
April 2010
5 posts
Apr 19th