Skip to content

Instantly share code, notes, and snippets.

package net.hockeyapp.android.demo;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.acra.ACRA;
import org.acra.collector.CrashReportData;
import org.acra.ReportField;
@jaysoffian
jaysoffian / remerge
Created May 6, 2012 13:06
A script for rebasing a merge
#!/bin/sh -x
# remerge <onto> [<merge_commit>]
# e.g.: remerge origin/trunk
# merge_commit defaults to HEAD
onto=$1
mc=${2:-HEAD}
mc_sha=$(git rev-parse $mc) # original merge commit
p1_sha=$(git rev-parse $onto) # what we want its new first parent to be
#!/usr/bin/python
import sys
import re
def extract_names(path):
year = None
ranks = {}
def add_rank(name, rank):
# add name to ranks if its not already present or if its smaller
if name not in ranks or rank < ranks[name]:
@jaysoffian
jaysoffian / tmproj
Created December 13, 2011 17:52
tmproj
#!/bin/bash
name=$(git rev-parse --abbrev-ref=strict HEAD | sed 's|/|-|g')
test "$name" = "HEAD" && name=$(git rev-parse --short $name)
OUT=${name}.tmproj
OUT2="${name}(2).tmproj"
exec > "$OUT"
cat <<'__EOF__'
commit 573d8d2631 (HEAD, master)
Author: Jay Soffian <jaysoffian@gmail.com>
Date: Fri Sep 23 01:26:04 2011 -0400
diff_tree: honor in-tree .gitattributes when used in a bare repo
diff --git a/tree-diff.c b/tree-diff.c
index b3cc2e4753..6fd84eb2bb 100644
--- a/tree-diff.c
+++ b/tree-diff.c
@jaysoffian
jaysoffian / gist:7bb70e1065f085b46a00
Created April 26, 2011 18:15
network calculator in awk
netfn () {
echo "$1" |
awk 'function nto32b(n){ # converts an integer to a 32-bit ascii bitstring
b=""
while (n>1) {
if (n%2) {b="1"b} else {b="0"b}
n=int(n/2)
}
b="1"b
return sprintf("%032s",b)