Skip to content

Instantly share code, notes, and snippets.

@davemenninger
davemenninger / gist:779821
Created January 14, 2011 16:23
spells out "H-I-V-E"
#include <avr/pgmspace.h>
#define clockpin 13 // CI
#define enablepin 10 // EI
#define latchpin 9 // LI
#define datapin 11 // DI
#define NumLEDs 56
#define rows 8
@davemenninger
davemenninger / gist:785487
Created January 19, 2011 01:05
turns each row on in order
#define clockpin 13 // CI
#define enablepin 10 // EI
#define latchpin 9 // LI
#define datapin 11 // DI
#define NumLEDs 56
#define rows 8
#define columns 7
@davemenninger
davemenninger / gist:6022947
Created July 17, 2013 18:07
Renames files from two directories interleaving them in a merged directory. Intended use with a two-camera diybookscanner.
#!/bin/bash
IFS="$(echo -e "\n\r")"
BASE="page"
EXTN="JPG"
DEST_DIR="MergedPages"
I=0
@davemenninger
davemenninger / gist:6022994
Created July 17, 2013 18:12
Uses tesseract, hocr2pdf, and pdfconcat to build a OCR'ed ( searchable ) PDF from a dir full of tif files. Inteded use is with the output of a diybookscanner and ScanTailor.
#!/bin/bash
for img in *.tif; do tesseract $img $img hocr; done
for img in *.tif; do hocr2pdf -i $img -o $img.pdf < $img.html; done
pdfconcat -o merged.pdf ./*.pdf
@davemenninger
davemenninger / gist:7827177
Created December 6, 2013 16:01
gets temperatures from odot road sensors around cincinnati
#!/bin/bash
curl 'http://www.ohgo.com/Dashboard.aspx/getRoadSensorMarkers' \
-X POST \
-H 'Accept: */*' \
-H 'Accept-Encoding: gzip, deflate' \
-H 'Accept-Language: en-US,en;q=0.5' \
-H 'Cache-Control: no-cache' \
-H 'Connection: keep-alive' \
-H 'Content-Type: application/json; charset=utf-8' \
@davemenninger
davemenninger / gist:7827320
Created December 6, 2013 16:10
for a given address, find what cincinnati public school you would be assigned
#!/usr/bin/python
import urllib
import urllib2
from bs4 import BeautifulSoup
url = "http://slg.cps-k12.org/slg/school-lookup.asp"
#url = "http://slg.cps-k12.org/slg/school-lookup-nextyear.asp"
values = {
@davemenninger
davemenninger / plugin.py
Last active August 29, 2015 14:02
Hive13 supybot plugin. uses hackerspace api, so usable by any hackerspace.
import supybot.utils as utils
from supybot.commands import *
import supybot.plugins as plugins
import supybot.ircutils as ircutils
import supybot.callbacks as callbacks
from urllib2 import urlopen
from json import load
class Hive13(callbacks.Plugin):
@davemenninger
davemenninger / Makefile
Created July 11, 2014 13:28
make a directory of asciidoc files into html and pdf and deploy to somewhere with a script
HTML = $(patsubst %.asciidoc,%.html,$(shell find . -name '*.asciidoc' ))
PDF = $(patsubst %.html,%.pdf,$(shell find . -name '*.html' ))
all: $(HTML) $(PDF)
%.html: %.asciidoc
asciidoc -a toc $(<F)
%.pdf: %.html
xhtml2pdf $(<F)

Keybase proof

I hereby claim:

  • I am davemenninger on github.
  • I am davemenninger (https://keybase.io/davemenninger) on keybase.
  • I have a public key whose fingerprint is 2054 5168 14F3 E5E3 6A1C C390 7310 F86F A989 BBBA

To claim this, I am signing this object:

@davemenninger
davemenninger / TODO
Created October 25, 2016 19:45
findintext and TODO
#!/bin/bash │- # TODO line_item_number, event, description
│- # $order->$method(
here=`pwd` │- # line_item_numbers => [ $message->{line_item_number} ],
cd `git rev-parse --show-toplevel` │- # description => $message->{event}->{description},
findintext TODO | egrep -v '*~$'