Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
import codecs
from collections import defaultdict
from math import log
import os
items_by_target = defaultdict(list)
count_by_item = defaultdict(int)
total_item_count = 0
@nathans
nathans / TriLED
Created February 15, 2011 07:53
Controls the color of a tri-color LED based on analog input
int redPin = 9;
int greenPin = 10;
int bluePin = 11;
int analogPin = 3;
int val = 0;
void setup()
{
pinMode(redPin, OUTPUT); // sets the pin as output
pinMode(greenPin, OUTPUT);
@nathans
nathans / sblgnt start
Created November 12, 2010 23:14
SBLGNT parser, basic framework for openscriptures import
#! /usr/bin/evn python
import xml.sax
class SBLGNTParser(xml.sax.handler.ContentHandler):
"""Class to parse the SBL GNT XML file"""
def __init__(self, parent):
self.init_meta_data()
self.parent = parent
<VirtualHost *:80>
ServerName api.ossandbox.info
ServerAdmin nathan@ndansmith.net
<Location "/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE openscriptures.settings
PythonDebug On
PythonPath "['/home/ndansmith/django', '/home/ndansmith/django/openscriptures'] + sys.path"
Allow from all