Skip to content

Instantly share code, notes, and snippets.

View dehowell's full-sized avatar

David Howell dehowell

View GitHub Profile
@dehowell
dehowell / ical_to_csv.py
Created December 31, 2012 15:03
Python script for converting iCal events (using the appscript module) to a CSV file.
import csv
import re
import sys
import appscript
def get_calendar(name):
calendar = appscript.app('iCal').calendars[name]
try:
calendar.get()
@dehowell
dehowell / keybase.md
Created February 25, 2014 00:45
keybase.md

Keybase proof

I hereby claim:

  • I am dehowell on github.
  • I am dehowell (https://keybase.io/dehowell) on keybase.
  • I have a public key whose fingerprint is EE13 6FE8 20BD 6768 1C1F F841 54EF 03F8 51F4 7BF4

To claim this, I am signing this object:

@dehowell
dehowell / gist:1cc3e5c57662535a520d
Last active August 29, 2015 14:07
Data clean-up script for CBCL export files, for @jabaied.
#!/usr/bin/env python
'''
usage: %s input_file output_file
'''
import collections
import csv
import sys
@dehowell
dehowell / README.md
Last active August 29, 2015 14:07
Calculating Pi with Monte Carlo Methods

This is a demonstration of how to calculate π using Monte Carlo integration.

@dehowell
dehowell / README.md
Last active August 29, 2015 14:15 — forked from mbostock/.block
General Update Pattern, II - Broken for Educational Purposes

This is a deliberately broken fork of Mike Bostock's "General Update Pattern, II". Please see the original for an explanation of what's supposed to be happening. I've increased the pause between updates and switched to the default key function to illustrate how D3 calculates the enter, update, and exit selections. Open the console to see the data for each update.

@dehowell
dehowell / Rules.1blockpkg
Created January 18, 2016 21:05
1Blocker Ruleset for Blocking Facebook
[
{
"id": "b4e83825-482a-4ede-a574-3906c5528d07",
"name": "Quit Facebook",
"rules": [
{
"id": "a95775c4-4347-4d85-967f-7881f75459d7",
"name": "Facebook",
"content": {
"trigger": {
@dehowell
dehowell / server.py
Created May 15, 2016 18:24
Example of modeling a blocking-IO web server with simpy
#!/usr/bin/env python
import contextlib
import itertools
import random
import pandas
import simpy
@dehowell
dehowell / .gitignore
Last active July 13, 2016 09:33
One-Dimensional Cellular Automaton in Elixir
*.beam
@dehowell
dehowell / fix_cbcl_data.py
Created February 4, 2017 01:25
Script to correct to manipulate CBCL data file
#!/usr/bin/env python
'''
usage: %s input_file output_file
'''
import collections
import csv
import sys
@dehowell
dehowell / config.js
Created March 26, 2018 00:18
Getting Serverless variables from terraform state
const exec = require('child_process').exec;
function terraformOutput(name, tfModule) {
let mod = tfModule != undefined ? `-module ${tfModule}` : '';
let cmd = `terraform output -json ${mod}`;
let outputs = new Promise((resolve, reject) => {
exec(cmd, {'cwd': 'infrastructure'},
(error, stdout, stderr) => {
if (error) reject(error);