Skip to content

Instantly share code, notes, and snippets.

View brendanjerwin's full-sized avatar

Brendan Erwin brendanjerwin

View GitHub Profile
@brendanjerwin
brendanjerwin / cloud-config.yml
Last active August 29, 2015 14:11
cloud-config : core-brix
#cloud-config
hostname: core-brix
write_files:
- path: /etc/systemd/coredump.conf
content: |
[Coredump]
Compress=yes
MaxUse=3G
@brendanjerwin
brendanjerwin / coffee_clean.vim
Created February 21, 2012 00:03
Source this in your .vimrc
function! CoffeeClean()
let save_cursor = getpos(".")
"general puncuation spacing cleanup
"
"Missing spaces
silent! %s/\v','/', '/g
silent! %s/\v","/", "/g
silent! %s/\v:(\w)(['"].*)@<!/: \1/g
silent! %s/\v:\@(['"].*)@<!/: @/g
@JamesMaroney
JamesMaroney / gist:1401690
Created November 28, 2011 19:39
Guid Combine
public static Guid Combine(params Guid[] guids) {
const int BYTECOUNT = 16;
byte[] destByte = new byte[BYTECOUNT];
var listOfByteArrays = guids.Select(guid => guid.ToByteArray()).ToArray();
for (int i = 0; i < BYTECOUNT; i++) {
destByte[i] = listOfByteArrays.Aggregate<byte[], byte>(0, (current, array) => (byte) (current ^ array[i]));
}
return new Guid(destByte);
}