Skip to content

Instantly share code, notes, and snippets.

View cschamp's full-sized avatar

Craig Schamp cschamp

  • Boise, Idaho
  • 19:52 (UTC -06:00)
View GitHub Profile
LOCAL skipto(endch)
REG CHAR endch;
{
/* skip chars up to } */
REG CHAR c;
WHILE (c=readc()) ANDF c!=endch
DO SWITCH c IN
case SQUOTE: skipto(SQUOTE); break;
bld() {
case `hostname` in
cschamp-zr1*)
make -C /usr/local/build/git/hosted09/bora-vmsoft VERBOSE=0 OBJDIR=release $1 2>&1 |tee $1.log
;;
*)
map g 1G
map e $
map - :n#^M
map , !}fmt -c^M
map ; !}fmt -c -w 57^M
set ai
set aw
// Demonstrates how to pipe a program from memory to Python interpreter.
// Adapted from http://borkware.com/quickies/one?topic=NSTask
#import <Foundation/Foundation.h>
static const char *prog = "print \"Hello, world!\";";
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
dtrace -n 'syscall::open:entry{printf("%s",execname);}'
#include <openssl/evp.h>
unsigned char *
sha1digest(unsigned char *buf, unsigned int len, unsigned int *olen)
{
EVP_MD_CTX ctx;
const EVP_MD *md;
unsigned char *retval;
if (buf == NULL) {
<type 'dict'>
<type 'instance'>
{'source': 'foo'}
Source is 'foo'
Traceback (most recent call last):
File "pyscope.py", line 21, in <module>
main()
File "pyscope.py", line 18, in main
print r"Source is '%(source)s'" % options
AttributeError: Values instance has no attribute '__getitem__'