Posted: October 21st, 2012 | Author: jgeiger | Filed under: web | Tags: spring cleaning | No Comments »
I just decided to take a look at my bookmarks. I deleted all of them. I don’t remember the last time I actually used one. Google has become so good at search that I can find what I need by just typing into the search bar. If I don’t find that 2 year old article I was thinking about, I’m likely going to find something better anyway.
Posted: August 17th, 2012 | Author: jgeiger | Filed under: pairtrix, ruby, web | Tags: pair programming, pairtrix, ruby, web | No Comments »
I’ve been working on a large project with some developers from Pivotal Labs. Each team is made up of groups of paired developers. Depending on the size of the team, creating a even distribution of pairs can become increasingly difficult.
One of the options was to use a google spreadsheet matrix that had to be manually updated each day. Visually it worked well since you could update the numbers and see a history, but there wasn’t really a way to see who was paired on the given day. Also whenever someone left the team you needed to completely re-work the matrix to account for the change. We discussed the options to improve the experience and I decided to write an application to automate the process.
Pairtrix simplifies the process of managing and viewing team pairings by allowing signed in users to manage companies, employees, teams and pairs. Companies are displayed in a list and signed-in users can request membership to view that company’s information. Users who create a company will also have more administrative functions available to them including approving the membership requests for their companies.
Here are the links to the application, code repository and the tracker project. Please feel free to pass along bugs and feature requests.
Site: http://www.pairtrix.com
Github: https://github.com/jgeiger/pairtrix
Pivotal Tracker: https://www.pivotaltracker.com/projects/608423
Posted: July 3rd, 2012 | Author: jgeiger | Filed under: ruby, web | Tags: postgresql, ruby | No Comments »
I’m not sure how I didn’t run into this before but if you have a date field in ruby 1.9.x it will not parse it in the American format (mm/dd/yyyy). Combined with postgresql turning an invalid date to nil, it makes for some fun debugging.
I usually set dates in my factories to “1/1/2000″ but from now on it will be “12/31/1999″ so I can catch this issue way sooner.
Also check out https://github.com/jeremyevans/ruby-american_date which will solve the issue quickly. (Note, this seems to break using non-American dates (dd/mm/yyyy)
Posted: June 28th, 2012 | Author: jgeiger | Filed under: Uncategorized | Tags: ruby git | No Comments »
You can use git stash -p to selectively stash parts of your current changes. This is really nice to be able to test one specific change in isolation without having to make a series of commits.
Posted: June 26th, 2012 | Author: jgeiger | Filed under: ruby | Tags: iterm2, mac, tmux, vim | No Comments »
I’ve had it working on some machines I’ve worked on but finally found this which let me get it working locally.
gist: Swap iTerm2 cursors in vim insert mode when using tmux
Thanks and hope it helps someone else.
Posted: April 20th, 2012 | Author: jgeiger | Filed under: ruby, web | Tags: bundler, capistrano, github, ruby | No Comments »
I’ve been using the “git” deploy that github talked about so long ago for a while now. I finally got around to deploying something new and decided to use the built in bundler code for capistrano. A long time ago I had to fight with it and eventually gave up. I think they finally fixed it so you can override “current_release” which lets you work in a strategy that doesn’t force releases on you.
|
|
set :application, "myappname" set :bundle_roles, "/www/#{application}/current" |
Adding the above lines somewhere in your deploy (change as needed) will allow you to override the default and get the deploy working.
It’s interesting that they don’t list “current_release” as an option you can change but if you look at the code it’s being pulled in just like all the others.
Posted: March 30th, 2012 | Author: jgeiger | Filed under: ruby | Tags: rails, rspec, ruby | No Comments »
I was trying to learn about view specs since doing everything in Cucumber has been considered to be a bit of overkill recently. I was looking for a solution to deal with current_user and this is what I’m using.
items/show.html.haml
|
|
.content - if @item.user == current_user Hello! This is the rest of the content. |
show.html_spec.rb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
require 'spec_helper' describe "items/show" do before do @user = mock_model(User) view.stub(:current_user).and_return(@user) end context "when logged in as the item owner" do it "should display 'Hello!'" do assign(:item, stub_model(Item, user: @user)) render rendered.should have_content("Hello!") end end context "when logged in as anyone else" do it "should not display the 'Hello!' link" do assign(:item, stub_model(Item, user: nil)) render rendered.should_not have_content("Hello!") end end end |
Posted: March 24th, 2012 | Author: jgeiger | Filed under: ruby | Tags: ruby, vim | No Comments »
I’ve been working on a project which has a really nice set of vim plugins with a decent configuration. I’ve been trying to send in a few patches but it was a bit of a pain to use mine but keep it updated with the main repo. A bit of searching gave me a nice setup.
This clones my fork and also adds the parent as the upstream remote.
|
|
cd ~ git clone git@github.com:jgeiger/vim-config.git ~/.vim cd ~/.vim git submodule update --init ln -s ~/.vim/vimrc ~/.vimrc git remote add upstream https://github.com/Casecommons/vim-config.git |
Now if you add this to your .gitconfig you can do an easy git pu to pull in changes from both branches.
|
|
[alias] pu = !"git fetch origin -v; git fetch upstream -v; git merge upstream/master" |
Thanks
http://gitready.com/intermediate/2009/02/12/easily-fetching-upstream-changes.html
Posted: March 22nd, 2012 | Author: jgeiger | Filed under: ruby, web | Tags: ruby, vim | No Comments »
So I’ve been trying to get vim working on my macbook with the command-t plugin for file searching. I spent quite a while trying to get it working a while ago and finally did a really simple thing and it just worked.
|
|
cd ~ git clone git@github.com:jgeiger/vim-config.git ~/.vim cd ~/.vim git submodule update --init ln -s ~/.vim/vimrc ~/.vimrc sudo mv /usr/bin/vim /usr/bin/vim72 brew install https://raw.github.com/Homebrew/homebrew-dupes/master/vim.rb cd .vim/bundle/command-t/ruby/command-t/ /usr/bin/ruby extconf.rb |
I’m using rbenv with ruby 1.9.3-p125 as my main ruby, but you need to make sure that you compile command-t against whatever ruby vim as compiled with. The homebrew-dupes forumla uses the system ruby (which lives at /usr/bin/ruby) and even if you have rbenv global set to another ruby, you can always directly use the system ruby.
Thanks to:
https://github.com/Casecommons/vim-config
https://github.com/Casecommons/casecommons_workstation/blob/master/recipes/vim.rb
Posted: February 17th, 2012 | Author: jgeiger | Filed under: ruby, web | No Comments »
So I started a new job and the main text editor is vim. I am now a big fan.