Skip to content

Instantly share code, notes, and snippets.

View zwass's full-sized avatar
🌐
Hiring engineers #remote worldwide: fleetdm.com/jobs

Zach Wasserman zwass

🌐
Hiring engineers #remote worldwide: fleetdm.com/jobs
View GitHub Profile
@zwass
zwass / DefaultKeyBinding.dict
Created October 2, 2012 22:37
Mac Keybindings
{
/* Keybindings for emacs emulation. Compiled by Jacob Rus.
*
* This is a pretty good set, especially considering that many emacs bindings
* such as C-o, C-a, C-e, C-k, C-y, C-v, C-f, C-b, C-p, C-n, C-t, and
* perhaps a few more, are already built into the system.
*
* BEWARE:
* This file uses the Option key as a meta key. This has the side-effect
* of overriding Mac OS keybindings for the option key, which generally
@zwass
zwass / personal.el
Created September 25, 2012 23:12
emacs config file as of 2012-09-25
;; Here are some examples of how to override the defaults for the
;; various prelude-emacs settings. To *append* to any of the
;; configurations attached to prelude-*-hooks, you can attach a
;; function to the appropriate hook:
;; disable whitespace-mode and whitespace-cleanup
(add-hook 'prelude-prog-mode-hook
(lambda ()
(prelude-turn-off-whitespace)
(remove-hook 'before-save-hook 'whitespace-cleanup)) t)
@zwass
zwass / gist:3732941
Created September 16, 2012 15:55
Haskell Fibonacci Prime Finder
squareRoot :: Integer -> Integer
squareRoot = floor . sqrt . (fromIntegral :: Integer -> Double)
isPrime :: Integer -> Bool
isPrime 1 = False
isPrime x = testDown x (squareRoot x) where
testDown a 1 = True
testDown a n
| a `mod` n == 0 = False
| otherwise = testDown a (n-1)
@zwass
zwass / pytalk.py
Created September 15, 2011 03:06
Code from PennApps CherryPy Talk
import cherrypy
import sqlite3
import json
def wrap_html(function):
def new_function(*args, **kwargs):
return """\
<html><body>
""" + function(*args, **kwargs) + """
</body></html>
@zwass
zwass / treetest.c
Created April 28, 2011 08:13
Exploring Caches and Spatial Locality with C
#define DEFAULTTREEHEIGHT 20
#define DEFAULTITERATIONS 1000
#include <sys/time.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
typedef struct{
void* right;