Skip to content

Instantly share code, notes, and snippets.

@lonnen
lonnen / gist:3101795
Created July 12, 2012 23:24
git grep and git blame. two great tastes that taste great together
# from i8ramin - http://getintothis.com/blog/2012/04/02/git-grep-and-blame-bash-function/
# runs git grep on a pattern, and then uses git blame to who did it
ggb() {
git grep -n $1 | while IFS=: read i j k; do git blame -L $j,$j $i | cat; done
}
# small modification for git egrep bash
geb() {
git grep -E -n $1 | while IFS=: read i j k; do git blame -L $j,$j $i | cat; done
}
@smat
smat / pom.xml
Created February 22, 2012 15:49
Commit id in production
<project>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<!-- outputFile doesn't work in the regular v1.2 (see MEXEC-86) -->
<version>1.2.1-BRING</version>
<executions>
<execution>
@jasonrudolph
jasonrudolph / git-branches-by-commit-date.sh
Created February 12, 2012 20:40
List remote Git branches and the last commit date for each branch. Sort by most recent commit date.
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r
@saetia
saetia / gist:1623487
Last active May 1, 2024 19:55
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@cjohansen
cjohansen / gist:1486702
Created December 16, 2011 16:23
Asynchronous Buster.JS tests
// Oops: Defaut test runner timeout is 250ms
buster.testCase("Async stuff", {
"does things asynchonously": function (done) {
setTimeout(function () {
assert(true);
done();
}, 100);
},
@bosmievoll
bosmievoll / ADPasswordEncoder.java
Created November 22, 2011 09:09
Active Directory Password Encoder
package no.smievoll.ad;
import javax.naming.directory.BasicAttribute;
import java.util.List;
public class ADPasswordEncoder {
private static byte[] generatePasswordByteArray(String clearTextPassword) throws UnsupportedEncodingException {
/* NB: AD requires password string to be quoted. */