Skip to content

Instantly share code, notes, and snippets.

View clee's full-sized avatar

Chris Lee clee

  • Denver
View GitHub Profile
@clee
clee / free.d
Created August 21, 2012 05:15
script to trace invocations of 'free'
#!/usr/sbin/dtrace
pid$target::free:entry
{
printf("%s: %s\n", probefunc, copyinstr(arg0));
}
@clee
clee / app-client.js
Last active September 30, 2015 23:58
EventSource demo code
$.ready(function() {
var source = new EventSource("/events");
source.addEventListener('data', function(e) {
$("#content").append(e.data + "\n");
}, false);
});
@clee
clee / cpacl.c
Created June 11, 2011 22:24
copy ACL from source to target
/*
cpacl.c: copy solaris ACLs from one file to another
author: Chris Lee <clee@mg8.org>
license: WTFPL <http://sam.zoy.org/wtfpl/COPYING>
make: cc -o cpacl cpacl.c -lsec -lc
*/
#include <sys/acl.h>
#include <stdio.h>
@clee
clee / binary-plist.js
Created June 3, 2011 21:36
initial binary plist implementation in nodejs
#!/usr/bin/env node
var fs = require('fs');
var sys = require('sys');
var bin = require('binary');
function bytesize(n) {
// JavaScript can't handle 64-bit ints natively.
// TODO: hack it up anyway.
// (n & 0xFFFFFFFF00000000) ? 8 : ...
@clee
clee / ichat-unarchiver.rb
Created April 15, 2011 09:31
read from iChat conversation logs using MacRuby
#!/usr/bin/env macruby
framework 'Foundation'
framework 'AppKit'
class Person
def initWithCoder(decoder)
# empty implementation needed for ancient iChat conversations
end
end