This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import psycopg2, psycopg2.extras | |
DSN = { | |
'dbname': "xxx", | |
'user': "xxx", | |
'password': "xxx"} | |
def main(): | |
con = psycopg2.connect(connection_factory=psycopg2.extras.NamedTupleConnection, **DSN) | |
cur = con.cursor() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# postgres.conf | |
# | |
# A simple upstart script for the postgresql server as installed from source | |
# http://www.postgresql.org/docs/9.3/interactive/installation.html | |
# | |
# Place this file in /etc/init/ | |
# | |
# Usage: | |
# $ sudo service postgres start|stop|status | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.zeromq.ZMQ; | |
import org.zeromq.ZMQException; | |
public class TermOnSend { | |
public static void main(String[] args) { | |
final ZMQ.Context ctx = ZMQ.context(1); | |
Thread threadB = new Thread(new Runnable() { | |
@Override | |
public void run() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
import BaseHTTPServer | |
import urllib2 | |
from dateutil import parser, tz as dutz | |
from datetime import datetime, tzinfo | |
import ipdb | |
BREAK=ipdb.set_trace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Computes a summary of (unique) bank transactions from CSV files | |
USAGE: | |
python account-summary.py account_statment1.csv account_statement2.csv ... | |
OUTPUT: | |
CSV printed to stdout with the following colums |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-----BEGIN PGP PUBLIC KEY BLOCK----- | |
Version: SKS 1.1.4 | |
Comment: Hostname: pgp.mit.edu | |
mQENBFLOhGwBCADLreJzn4F8bKodTjg/QY4AyvQQWxnM0h56xsUmqTZqvRCp9kgtrcR5Bnvp | |
kMMRoIx9rOM7Hnp/LrxogZ8ZHbp+r3eQt3tp8p7ZwymQCT8cZoreTQplDp4eqZmnPh4BMk3a | |
+gqvgPv5SShwQjNGtf8r31MWe+xTCx6Db1XYpHav0pSs06Gmf/Kh/WVMtTvh841R0OU9mWhk | |
OxnOYWDErPSzUolA9u4A20B3LVpowjoA5Oaq3kIzC+mgL7muXhiEA4hzL9WXqcDHPXyRS3ut | |
Djmz1oqXFIZFgwhUUDW6g1hyuVuulNZRMkFtqASi13x+qMF8PwbU6KvoVCXG9++yQF13ABEB | |
AAG0K0hlaW5yaWNoIEhhcnRtYW5uIDxoYXJ0bWFubkB1bmkta29ibGVuei5kZT6JAT4EEwEC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import RPi.GPIO as G | |
from time import sleep | |
import sys | |
if (len(sys.argv) < 1): exit | |
pin = int(sys.argv[-1]) | |
MODE = "BCM" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pylab as plt | |
from scipy import stats | |
from collections import * | |
from itertools import * | |
# | |
# Convenience Class for Time Series | |
# | |
# Series Objects can be added and subtracted using infix operators. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Import the ADC driver: | |
# https://gist.github.com/HeinrichHartmann/27f33798d12317575c6c | |
import ADC0832 as ADC | |
import sys | |
import BaseHTTPServer | |
import json | |
from BaseHTTPServer import BaseHTTPRequestHandler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
_G = nil --[[ref]], | |
_VERSION = "Lua 5.1", | |
arg = { | |
[-1] = "/usr/bin/lua", | |
[0] = "main.lua" | |
} --[[table: 0xbcbef0]], | |
assert = assert --[[function: 0xbc5310]], | |
collectgarbage = collectgarbage --[[function: 0xbc5370]], | |
coroutine = { |
OlderNewer