Skip to content

Instantly share code, notes, and snippets.

View ods94065's full-sized avatar

Owen Smith ods94065

  • Datadog
  • Alameda, CA
View GitHub Profile
@ods94065
ods94065 / Engrave with LilyPond
Created January 6, 2012 18:12
Engrave document with LilyPond using BBEdit/TextWrangler on Mac OS X
#!/bin/bash
# This script runs LilyPond on the currently open document in BBEdit/TextWrangler.
# It assumes you have already saved your work.
# Change this path, and these options, to suit your installation and preferences.
LILYAPP=/Applications/LilyPond.app/Contents/Resources/bin/lilypond
LILYOPTIONS=
# BBEdit/TextWrangler pass the pathname to the currently open document
# through BB_DOC_PATH.
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
struct Person {
char name[16];
char text[24];
};
struct Node {
@ods94065
ods94065 / gist:e8bb54570d170e97b19b
Created January 22, 2015 04:55
Using StringIO to read a zip file directly from the network
import urllib2
import zipfile
import StringIO
response = urllib2.urlopen('http://some_url.zip')
body = response.read()
io = StringIO.StringIO(body)
# io is a file-like object... you can use it where you'd use a file!
myfile = zipfile.ZipFile(io)
@ods94065
ods94065 / dungeon.py
Created March 2, 2016 00:33
The Dark Tower of Delphi (Intro to CS Sample Project)
rooms = ['parking lot', 'trees', 'yacht', 'office building']
descriptions = [
"You are in a deserted parking lot. There's nothing parked\n"
"here besides your old, beat-up car. A crumpled piece of\n"
"foil lies in the gutter, suggesting that someone was eating\n"
"food here not too long ago. To your left, you can hear the\n"
"sound of a busy highway that you dare not cross on foot.\n"
"The property extends to your right across an empty street.",
"You stand on a lawn at the beginning a long row of tall\n"
"trees. The deposits of waterfowl dot the lawn, forcing you\n"

Keybase proof

I hereby claim:

  • I am ods94065 on github.
  • I am owenudacity (https://keybase.io/owenudacity) on keybase.
  • I have a public key ASA1-1XpQtK2WYwssdvqNiMAgJLQu5wEBo7aGUrumuBF9Qo

To claim this, I am signing this object:

@ods94065
ods94065 / keybase.md
Created April 11, 2019 19:23
Keybase proof

Keybase proof

I hereby claim:

  • I am ods94065 on github.
  • I am ods94065 (https://keybase.io/ods94065) on keybase.
  • I have a public key whose fingerprint is 9BF2 0113 AA33 563C BBF2 3114 C8C1 5577 222E 503E

To claim this, I am signing this object:

@ods94065
ods94065 / 𐑖𐑷.py
Last active July 26, 2019 02:42
𐑕𐑨𐑥𐑐𐑩𐑤 𐑐𐑲𐑔𐑪𐑯 𐑕𐑒𐑮𐑦𐑐𐑑 𐑦𐑯 ·𐑖𐑱𐑝𐑾𐑯
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 𐑩𐑛𐑨𐑐𐑑𐑩𐑛 𐑓𐑮𐑳𐑥: https://metacpan.org/release/Lingua-EN-Alphabet-Shaw/source/lib/Lingua/EN/Alphabet/Shaw.pm
import collections
import itertools
import os.path
import re
import sqlite3
import sys
@ods94065
ods94065 / Lilypond.applescript
Last active November 18, 2019 05:58
Lilypond integration with TextWrangler via AppleScript
-- Author: Henk van Voorthuijsen
-- From lilypond-devel, 21 Jul 2008, "Re: MacOS 10.5 Applescript for TextWrangler"
-- https://lists.defectivebydesign.org/archive/html/lilypond-devel/2008-07/msg00288.html
set lilypondPath to convertPath(path to application "LilyPond" as text, 2, -2, "/")
tell application "TextWrangler.app"
save first document
set documentName to name of first document
set filePath to file of first document as text
end tell