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
[user] | |
name = Jeremy Friesen | |
email = jeremy.n.friesen@gmail.com | |
[color] | |
branch = auto | |
diff = auto | |
status = auto | |
[color "branch"] | |
current = red reverse | |
local = red bold |
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
# Two spiffy github commands. One is to go to the appropriate branch | |
# The other is to open up the issues, allowing for passing a param and opening | |
# the specific issue | |
[alias] | |
# Open the current branch on github | |
hub = "! br=$(git branch --contains HEAD | sed -En \"s/^\\* //p\"); if ! git ls-remote . | grep -q -e \"refs/remotes/.*/${br}\"; then br=\"master\"; fi; open $(git config -l | sed -En \"s%remote.origin.url=git(@|://)(github.com)(:|/)(.+/.+).git%https://\\2/\\4/tree/${br}%p\")" | |
# Go to the github project's issues | |
# $ git hub-issue | |
# => open browser and go to project's issues |
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 Foo | |
class << self | |
def bar; 'class bar'; end | |
protected :bar | |
end | |
def bar; 'instance bar'; end | |
end | |
if $0 == __FILE__ | |
begin |
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 'pathname' | |
# Compares two files for "similar" look, ignoring | |
# where elements are in the document. | |
def collect_unique_lines(*args) | |
dir = Pathname.new(Rails.root.join('tmp')) | |
contents = File.read(dir.join(args.join('.'))).split("\n") | |
lines = [] | |
# proposed_lines = [] | |
contents.inject(lines) {|mem,string| |
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
#!bash | |
# | |
# bash completion support for core Git. | |
# | |
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org> | |
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/). | |
# Distributed under the GNU General Public License, version 2.0. | |
# | |
# The contained completion routines provide support for completing: | |
# |
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
# ~/.gitconfig | |
[alias] | |
# Open the current branch on github | |
hub = "! br=$(git branch --contains HEAD | sed -En \"s/^\\* //p\"); if ! git ls-remote . | grep -q -e \"refs/remotes/.*/${br}\"; then br=\"master\"; fi; open $(git config -l | sed -En \"s%remote.origin.url=git(@|://)(github.com)(:|/)(.+/.+).git%https://\\2/\\4/tree/${br}%p\")" | |
# Go to the lighthouse project, your config will need to have set the subdomain and project | |
# If branch begins with a number (0-9), then open that ticket # in Lighthouse | |
# Otherwise, go to milestones/current | |
lighthouse = "! ref=\"milestones/current\"; ticket=$(git branch --contains HEAD | sed -En \"s/^\\* //p\" | grep -e \"^[0-9]\" | awk '{print \"tickets/\"$1}'); if [[ -n \"${ticket}\" ]]; then ref=\"${ticket}\"; fi; open https://$(git config lighthouse.subdomain).lighthouseapp.com/projects/$(git config lighthouse.project)/${ref}" |
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/perl | |
# Thank you Gavin Brock (http://brock-family.org/gavin/perl) - June 2007 | |
#==============================================================================# | |
use strict; | |
use warnings; | |
use Foundation; | |
#==============================================================================# |
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
# I need class C to call the foo method for each module included | |
# that has the method foo. Order does not matter as much as each | |
# method getting called. alias method chain? | |
module ChainMethod | |
def chain_method(method_name) | |
base_method = instance_method(method_name.to_sym) | |
chained_method = included_modules.inject([base_method]) do |mem, mod| | |
if method = (mod.instance_methods.include?(method_name.to_s) ? mod.instance_method(method_name.to_sym) : nil) | |
mem << method | |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'nokogiri' | |
require 'highline/import' | |
require 'open-uri' | |
conversions = [ | |
["<blockquote>", '[q]' ], | |
["</blockquote>", '[/q]' ], |
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 bash | |
# This is an RVM Project .rvmrc file, used to automatically load the ruby | |
# development environment upon cd'ing into the directory | |
# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional. | |
environment_id="ruby-1.9.2-p290@ootw" | |
# | |
# Uncomment following line if you want options to be set only for given project. |
OlderNewer