This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'autotest/redgreen' | |
Autotest.send(:alias_method, :real_make_test_cmd, :make_test_cmd) | |
Autotest.send(:define_method, :make_test_cmd) do |*args| | |
real_make_test_cmd(*args).sub('test/unit', %[rubygems -e "require 'redgreen'"]) | |
end | |
Autotest.add_hook :initialize do |autotest| | |
autotest.add_exception(/^\.\/vendor/) | |
autotest.add_exception(/\.svn/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rebase { | |
if [[ $1 == "" ]]; then master='master'; else master=$1; fi | |
branch=`git branch | grep \* | awk '{print $2}'` && | |
git checkout $master && git pull && git rebase $master $branch | |
} | |
function push { | |
if [[ $1 == "" ]]; then master='master'; else master=$1; fi | |
branch=`git branch | grep \* | awk '{print $2}'` && | |
rebase $master && git checkout $master && git merge $branch && git push && |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 0. Do all your work in a local branch, preferably named loosely for the feature you're working on. | |
git checkout -b work | |
# 1. Make sure all your changes are committed. | |
git commit -m "changes to a local branch" | |
# 2. Update the master branch, pulling down the latest code from the rest of the team | |
git checkout master | |
git pull | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The search query for this was my address here in Bremerton. This is the result. | |
{"places": | |
{"place": | |
[{ "woeid":2368481, | |
"placeTypeName":"Town", | |
"placeTypeName attrs":{"code":7}, | |
"name":"Bremerton", | |
"country":"United States", | |
"country attrs":{"type":"Country","code":"US"}, | |
"admin1":"Washington", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GatheringPlan < ActiveRecord::Base | |
belongs_to :roov | |
belongs_to :gathering_idea | |
has_many :participations, :class_name => "GatheringPlanParticipation" | |
has_many :participants, :through => :participations, :source => :user | |
has_many :votes, :class_name => "GatheringPlanVote" | |
has_many :suggestions, :through => :votes, :source => :suggestion | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[4294967295,4294967295].to_yaml | |
#=> "--- \n- 4294967295\n- 4294967295\n" | |
[4294967295,4294967295].to_yaml.size | |
#=> 31 | |
[4294967295,4294967295].to_json | |
#=> "[4294967295,4294967295]" | |
[4294967295,4294967295].to_json.size | |
#=> 23 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User < AR::Base | |
has_many :gathering_participations | |
has_many :gatherings, :through => :gathering_participations | |
has_many :gathering_suggestions | |
has_many :gathering_votes | |
end | |
class GatheringParticipation | |
belongs_to :user | |
belongs_to :gathering |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# zsh shell functions for working in local git branches and rebasing appropriately | |
function rebase { | |
if [[ $1 == "" ]]; then master='master'; else master=$1; fi | |
branch=`git branch | grep \* | awk '{print $2}'` && | |
git co $master && git pull && git rebase $master $branch | |
} | |
function push { | |
if [[ $1 == "" ]]; then master='master'; else master=$1; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) 2008 Nicholas A. Evans | |
# http://ekenosen.net/nick/devblog/2008/12/better-progress-bar-for-rspec/ | |
# | |
# With some tweaks (slow spec profiler, growl support) | |
# By Nick Zadrozny | |
# | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining | |
# a copy of this software and associated documentation files (the | |
# "Software"), to deal in the Software without restriction, including |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# The script that give you focus! | |
# Create a text file that contains sites want to give yourself | |
# access to only during certain times of day. | |
# | |
# The file will look like this: | |
# 12 news.ycombinator.com | |
# 11-13,19-21 twitter.com | |
# |
OlderNewer