Skip to content

Instantly share code, notes, and snippets.

@dcarney
dcarney / bash-present.sh
Created March 28, 2022 23:31
A script for reading a text file containing shell commands, and executing # them one-by-one.
#!/bin/bash
#
# A script for reading a text file containing shell commands, and executing
# them one-by-one.
#
# Usage: present.sh <commands-file>
#
# where <commands-file> is a plain-text file containing shell commmands to
# execute, one per line.
@dcarney
dcarney / pre-commit
Created December 1, 2016 21:28
Git pre-commit hook for Go projects
#!/bin/sh
# Save this file as ".git/hooks/pre-commit" in your git repository and set it
# to executable.
#
# To install the "go vet" command:
# $ go get -v -u golang.org/x/tools/cmd/vet
# To install the "golint" command:
# $ go get -v github.com/golang/lint/golint
#
@dcarney
dcarney / gb2gb.go
Created June 19, 2015 21:53
Vendors a set of go dependencies using 'gb-vendor', by reading the gb vendor manifest from another project.
// aids in moving deps from one gb project to another gb project:
//
// reads a gb vendor/manifest and uses the 'gb-vendor' plugin to vendor the
// same revision of each dependency into another gb-based project.
//
// Example:
// To vendor all the dependencies of the project at /go/src/github.com/username/foo
// into the new project at /path/to/gb/proj, run the following:
//
// $ go run gb2gb.go -src-manifest=/go/src/github.com/username/foo/vendor/manifest -dest=/path/to/gb/proj
@dcarney
dcarney / godep2gb.go
Created June 8, 2015 15:59
Vendors a set of go dependencies using 'gb-vendor', by reading a godep manifest (e.g. Godeps.json)
// aids in converting a godep project to a gb project:
//
// reads a Godeps.json manifest and uses the 'gb-vendor' plugin to vendor the
// same revision of each dependency into a gb-based project.
//
// Example:
// To vendor all the dependencies of the godep-based project at /go/src/github.com/username/foo
// into the new gb-based project at /path/to/gb/proj, run the following:
//
// $ go run godep2gb.go -gbroot=/path/to/gb/proj/ -godeps=/go/src/github.com/username/foo/Godeps/Godeps.json
@dcarney
dcarney / Inconsolata.css
Created August 8, 2012 21:26 — forked from jonschoning/Inconsolata.css
Inconsolata.css
@font-face {
font-family: "Inconsolata";
font-style: normal;
font-weight: normal;
src: local("Inconsolata"), url("http://themes.googleusercontent.com/static/fonts/inconsolata/v3/BjAYBlHtW3CJxDcjzrnZCIbN6UDyHWBl620a-IRfuBk.woff") format("woff");
}
@dcarney
dcarney / git-svn notes.txt
Created August 3, 2011 23:58
Some hastily-scribbled notes about using git-svn with our existing git repos
Set the SVN_EDITOR var:
# export SVN_EDITOR=vim
==================================
SETTING UP A NEW SVN PROJECT
==================================
Create a new SVN "repo" (aka folder):
(NOTE: https is required for our new SVN, as well as --username)
# svn mkdir https://some/url/path/to/newRepo --username first.last
@dcarney
dcarney / SplitTemplateTap
Created May 23, 2011 21:44
An implementation of a Cascading TemplateTap, that splits the output files by # or tuples. It was developed after looking at the src for Cascading's TemplateTap, and modifying it a bit. It's a bit of a hack, but hopefully not too bad. We keep track of t
import java.beans.ConstructorProperties;
import java.io.IOException;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
import cascading.scheme.Scheme;
import cascading.tap.Hfs;
import cascading.tap.SinkMode;