Skip to content

Instantly share code, notes, and snippets.

View gregjurman's full-sized avatar

G gregjurman

View GitHub Profile
from __future__ import print_function
import json
import urllib
import boto3
import csv
import zipfile
print('Loading function')
/**
* @file: servo control example
*
* @description
* drive forward, drive backward
* 1 servo, LiPo battery
*
* The minimum (backward) and maximum (forward) values
* will be different depending on your specific servo motor.
* Ideally, it should be between 1 and 2 milliseconds, but in practice,

Keybase proof

I hereby claim:

  • I am gregjurman on github.
  • I am jurmangreg (https://keybase.io/jurmangreg) on keybase.
  • I have a public key ASDUHHED26SHBu3b51Dii72dxFEYFzL_5RDbJ4vW6c7WrQo

To claim this, I am signing this object:

@gregjurman
gregjurman / fec.py
Last active October 30, 2015 22:48
List the names of all OpenFEC beta candidates
import requests
import json
# docs: https://api.open.fec.gov/developers
API_KEY = "........"
API_VERSION = "v1"
API_URL = "https://api.open.fec.gov/v1/candidates"
def main():
query = dict(api_key=API_KEY,
from wand.image import Image as WandImage
import sys
if __name__ == '__main__':
print "Welcome to wand-text.py!"
if len(sys.argv) != 3:
print "Usage:\n\n\tpython wand-text.py <input_pdf_filename> <output_image_basename>"
print "Ex: \n\n\tpython wand-text.py pdfdocument.pdf page"
@gregjurman
gregjurman / gist:7852827
Created December 8, 2013 02:53
Open Paradox 3.5 DB, extract field headers and write a proper CSV
import pxpy
import csv
t = pxpy.Table("HISTORY.DB")
t.open()
headers = map(pxpy.RecordField.getName, t[0])
with open('history.csv', 'wb') as out_file:
c = csv.writer(out_file)
c.writerow(headers)
for r in t:
c.writerow(map(pxpy.RecordField.getValue, r))
@gregjurman
gregjurman / gist:6478887
Created September 7, 2013 20:14
untested, cron script for reading in csv and making screenshots.
#!/usr/bin/python
import csv
from hashlib import md5
from selenium import webdriver
with open("/path/to/csvfile") as csv_in:
browser = webdriver.Firefox()
data = csv.reader(csv_in)
for url in data:
@gregjurman
gregjurman / 520to512.c
Last active December 19, 2015 10:29
520bps to 512bps
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
int main(int argc, const char *argv[]) {
const char *filename = argv[1];
uint8_t *buffer;
fprintf(stderr, "Converting %s from 520bps to 512bps\n", filename);
FILE * inFile = fopen(filename, "rb");
"""
Misc tools/functions written by Ross Delinger
"""
def assemblePipeLine(*args, **kwargs):
"""
Given an arbitrary number of functions we create a pipeline where the output
is piped between functions. you can also specify a tuple of arguments that
should be passed to functions in the pipeline. The first arg is always the
@gregjurman
gregjurman / fips.sh
Created December 23, 2012 15:53 — forked from forkandwait/fips.sh
declare -A FIPS
declare -A STNAME
FIPS[AK]=02; STNAME[AK]=Alaska
FIPS[AL]=01; STNAME[AL]=Alabama
FIPS[AR]=05; STNAME[AR]=Arkansas
FIPS[AS]=60; STNAME[AS]=American Samoa
FIPS[AZ]=04; STNAME[AZ]=Arizona
FIPS[CA]=06; STNAME[CA]=California
FIPS[CO]=08; STNAME[CO]=Colorado
FIPS[CT]=09; STNAME[CT]=Connecticut