Skip to content

Instantly share code, notes, and snippets.

@monkz
monkz / pgp-merge-drv
Created December 16, 2017 22:35 — forked from ewa/pgp-merge-drv
Git merge driver to decrypt (and re-encrypt) files before merging.
#!/bin/bash
# WARNING: This creates and manipulates clear text copies of the
# encrypted files. It tries to clean up afterwards, but lots can go
# wrong. If you are seriously worried about the secrecy of the files,
# don't trust this!
ANCESTOR=$1
MINE=$2
OTHER=$3
@monkz
monkz / inconsitency in ruby string split
Created June 16, 2012 21:30
inconsitency in ruby string split
hiho little/big inconsistency in ruby core:
$ irb1.9.1
irb(main):001:0> test1 = " " # double space
=> " "
irb(main):002:0> test1.split(" ",2) # single space
=> [""]
irb(main):003:0> test2 = "tt" # double t
=> "tt"
irb(main):004:0> test2.split("t",2) # single t
=> ["", "t"]