Place this file in my_project/.git/hooks/prepare-commit-msg
to have git automatically use ptb to prepare your commit messages for you.
You also need to give execute permisions to prepare-commit-msg
chmod +x myproject/.git/hooks/prepare-commit-msg
package main | |
import ( | |
"fmt" | |
"github.com/tmiller/pt" | |
"os/exec" | |
) | |
func main() { | |
pivotalTracker := pt.PivotalTracker{"API Key"} |
# lib/cryptography_adapter.rb | |
# Parent adapter class | |
class CryptographyAdapter | |
def encrypted?(data) | |
raise "Method not implmented" | |
end | |
def decrypt(data) |
{ | |
"trailing_spaces_highlight_color": "invalid", | |
"trailing_spaces_modified_lines_only": true, | |
"trailing_spaces_include_current_line": false, | |
"trailing_spaces_trim_on_save": true | |
} |
#!/bin/bash | |
# Merges the master branch into all other branches | |
# | |
# Process: | |
# | |
# - Save the name of the current branch | |
# - If the current branch is not master then checkout master. | |
# - Pull the latest changes for master from its upstream branch. | |
# - Loop over each local branch. |
def fibonacci(nth, series = method(:fibonacci)) | |
if nth < 2 | |
nth | |
else | |
series[nth - 2] + series[nth - 1] | |
end | |
end | |
# The easiest memoization in the world: | |
fibs = Hash.new { |series, nth| series[nth] = fibonacci(nth, series) } |
/* | |
Package pivotaltracker implements a wrapper around Pivotal Tracker's API. | |
*/ | |
package main | |
import ( | |
"encoding/xml" | |
"fmt" | |
"io/ioutil" | |
"net/http" |
[user] | |
name = Tom Miller | |
email = [email protected] | |
[color] | |
# turn on colors for all projects | |
ui = true | |
# I need to look this up again | |
[color "status"] | |
added = green |
<% | |
def database_adapter | |
if Bundler.load.specs.map(&:name).include? "mysql2" | |
"mysql2" | |
else | |
"mysql" | |
end | |
end | |
def database_name(environment) |
git status --porcelain | sort -u | sed -e 's/^.\(.\).*/\1/' -e 's/M/*/' -e 's/D/-/' -e 's/?/+/' | tr -d '\n' |