Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
while read oldrev newrev refname
do
if [[ $refname =~ (hotfixes)|(qa)|(dev) ]] ; then
echo "ensuring no trivial merges in $refname" >&2
for hash in $(git log --format=%H --merges $oldrev..$newrev)
do
echo "checking $hash" >&2
if [[ ($refname =~ /qa$ && "$(git log --format=%H ^$hash^2 qa | wc)" == "$(git log --format=%H qa | wc)")
|| ($refname =~ /dev$ && "$(git log --format=%H ^$hash^2 dev | wc)" == "$(git log --format=%H dev | wc)")
@meonkeys
meonkeys / Makefile
Created December 12, 2010 04:22
Tests for stackoverflow question #4138285
test:
@bash $@
.PHONY: test
@meonkeys
meonkeys / README
Created February 27, 2011 07:52
main program
Plugin architecture based on "sub-class discovery method" described in a talk
by Dr. André Roberge. The talk is called "Plugins and monkeypatching:
increasing flexibility, dealing with inflexibility".
Here's the talk recorded at PyCon 2009 in Chicago:
http://us.pycon.org/2009/conference/schedule/event/47/
Plugin writer HOWTO:
1. subclass "Base"
2. implement sayHi()
@meonkeys
meonkeys / mixed.txt
Created March 4, 2011 19:33
Separates low-ASCII characters from everything else.
欢迎来到Mifos管理区域
import multiprocessing
import time
def mytask(num):
print('Started task, sleeping %s' % num)
time.sleep(num)
pool = multiprocessing.Pool(4)
jobs = pool.map_async(mytask, [1,2,3,4,5,3,2,3,4,5,2,3,2,3,4,5,6,4], chunksize=1)
pool.close()
@meonkeys
meonkeys / stashtest.sh
Created August 10, 2011 16:45
demonstrate git stash conflict
#!/bin/bash
tmpdir=`mktemp -d`
echo creating new repo in $tmpdir
set -x
cd $tmpdir
git init
echo -e 'blah\nfoo\nbar' > a
echo -e 'hello world' > b
git add a b
git commit -am 'first'
@meonkeys
meonkeys / a.txt
Created August 30, 2011 04:01
Illustrate unsuppressible vim ctags case warning
bLah
@meonkeys
meonkeys / xorg.conf
Created November 7, 2011 05:31
xorg.conf
Section "ServerLayout"
Identifier "amdcccle Layout"
Screen 0 "amdcccle-Screen[1]-0" 0 0
EndSection
Section "Monitor"
Identifier "0-DFP2"
Option "VendorName" "ATI Proprietary Driver"
Option "ModelName" "Generic Autodetecting Monitor"
Option "DPMS" "true"
@meonkeys
meonkeys / trace.txt
Created November 18, 2011 08:38
Full stack trace
Exception in thread "main" javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: CA key usage check failed: keyCertSign bit is not set
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1665)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:257)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:251)
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1165)
at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:154)
at sun.security.ssl.Handshaker.processLoop(Handshaker.java:609)
at sun.security.ssl.Handshaker.process_record(Handshaker.java:545)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:913)
@meonkeys
meonkeys / Makefile
Created December 8, 2011 04:26
Rough draft slides for potential LFNW 2012 talk on git
git-lfnw-2012.html: git-lfnw-2012.txt
pandoc -w slidy -s $< > $@
.DELETE_ON_ERROR: