Skip to content

Instantly share code, notes, and snippets.

@vanntastic
vanntastic / commit-msg
Created August 22, 2016 20:17 — forked from monkseal/commit-msg
'commit-msg' hook that pulls your Jira issue number from your branch name
#!/bin/sh
# Add git branch if relevant
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
# Extact tracker abbreviation and ticket number (e.g. DS-123)
parse_git_tracker_and_ticket() {
parse_git_branch | grep -e '[A-Z]\+-[0-9]\+' -o
@vanntastic
vanntastic / minify
Created February 11, 2011 16:23 — forked from benpickles/minify
minify script using closure compiler
#!/usr/bin/env ruby
dry_run = ARGV.delete('--dry-run')
force = ARGV.delete('--force')
if ARGV.empty?
puts <<-USAGE
minify, swiftly concat and minify JavaScript files from the command line
Pass a single argument to create a .min.js version:
=== Epic Snow Leopard Upgrayyyyd Guide ===
Son, you’re now living in the land of 64-bit systems.
That means that some of your 32-bit shit is now broken.
Not all is lost.
== Fixing MySQL weirdness
class Array
# add more as you see fit
ORDERS = %w(second third fourth fifth sixth seventh eighth ninth tenth)
ORDERS.each_with_index do |ord,i|
define_method "#{ord}" do
self[i+1]
end
end