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
def temp_path | |
t = Tempfile.new('graph') | |
fpath = t.path | |
t.unlink | |
FileUtils.mkdir_p(fpath) | |
fpath | |
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 | |
$LOAD_PATH.unshift '/Users/schacon/projects/git/rugged/lib' | |
require 'rugged' | |
require 'rubygems' | |
require 'pp' | |
dir, id = "/opt/linux.git" |
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 Stopwatch | |
attr_writer :splits, :max, :start, :end, :total | |
def initialize(message) | |
@message = message | |
@splits = [] | |
@max = 5 | |
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
sdfsdf |
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
back_branch = 'refs/heads/backup' | |
`rm /tmp/backup_index` | |
ENV['GIT_INDEX_FILE'] = '/tmp/backup_index' | |
last_commit = `git rev-parse #{back_branch}`.strip | |
last_tree = `git rev-parse #{back_branch}^{tree}`.strip | |
`git add --all` | |
next_tree = `git write-tree`.strip |
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
$ git branch -r --merged | | |
grep origin | | |
grep -v '>' | | |
grep -v master | | |
xargs -L1 | | |
awk '{split($0,a,"/"); print a[2]}' | | |
xargs git push origin --delete |
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 sign-off is a simple line at the end of the explanation for | |
the patch, which certifies that you wrote it or otherwise have | |
the right to pass it on as a open-source patch. The rules are | |
pretty simple: if you can certify the below: | |
Developer's Certificate of Origin 1.1 | |
By making a contribution to this project, I certify that: | |
(a) The contribution was created in whole or in part by me and I |
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
[alias] | |
serve = !git daemon --reuseaddr --verbose --base-path=. --export-all ./.git | |
unstage = reset HEAD | |
lol = log --oneline --graph --decorate | |
lols = log --oneline --graph --decorate --simplify-by-decoration --branches --remotes | |
branches = !git-branches | |
st = status -sb | |
ss = status --short | |
logg = log --oneline --graph --decorate | |
sh = !git-sh |
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
[url "https://github.com/"] | |
insteadOf = "gh:" |
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 | |
# | |
Dir.glob("*.png") do |file| | |
puts "crushing #{file}" | |
file2 = file + '.cr' | |
`pngcrush #{file} #{file2}` | |
save = File.stat(file).size - File.stat(file2).size | |
puts " save #{save}" | |
`mv #{file2} #{file}` |