Skip to content

Instantly share code, notes, and snippets.

View jemerick's full-sized avatar

Jason Emerick jemerick

View GitHub Profile
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BOARD)
GPIO.setup(16, GPIO.IN, pull_up_down=GPIO.PUD_UP)
while True:
input_state = GPIO.input(16)
if input_state == False:
# -*- coding: utf-8 -*-
import RPi.GPIO as GPIO
import time
import click
class Stepper():
"""
"""
@jemerick
jemerick / README.md
Last active January 15, 2016 23:02 — forked from StefanWallin/README.md
nginx ssl config with multiple SNI vhosts and A+ SSL Labs score as of 2014-11-05

Configuring nginx for SSL SNI vhosts

Gotchas

Remarks

  • My version of konklones SSL config does not have SPDY support(my nginx+openssl does not support it)
  • You need a default ssl server (example.org-default.conf).
  • Some SSL-options have to be unique across your instance, so it's easier to have them in a common file(ssl.conf).
@jemerick
jemerick / 4state.xml
Created August 19, 2015 14:52
4-State Challenge Waypoints
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<gpx xmlns="http://www.topografix.com/GPX/1/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" creator="GPS TrackMaker" version="1.1" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">
<!-- SHELTERS -->
<wpt lat="39.359891939" lon="-77.661743153">
<name>SH EDGAR</name>
<cmt>Ed Garvey Shelter</cmt>
<sym>Waypoint</sym>
</wpt>
<wpt lat="39.412662687" lon="-77.637042514">
<name>SH CRMPG</name>
@jemerick
jemerick / keybase.md
Created October 30, 2014 19:56
keybase.md

Keybase proof

I hereby claim:

  • I am jemerick on github.
  • I am jemerick (https://keybase.io/jemerick) on keybase.
  • I have a public key whose fingerprint is 8BD6 32E8 D73E 6158 C11E DD43 A212 8EFE F6B8 0398

To claim this, I am signing this object:

@jemerick
jemerick / gist:9536094
Created March 13, 2014 20:17 — forked from kevingessner/gist:9509148
Responsive email template
<html>
<head>
<style type="text/css">
table table {
width: 600px !important;
}
table div + div { /* main content */
width: 65%;
float: left;
}
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
/** An implementation of {@link BaseAdapter} which uses the new/bind pattern for its views. */
public abstract class BindableAdapter<T> extends BaseAdapter {
private final Context context;
private final LayoutInflater inflater;
#!/bin/bash
# note: this won't work too well with filenames/directories with spaces in them
compressresource() {
gzip -c9 "$1" > "$1.gz"
touch -c --reference="$1" "$1.gz"
echo "Compressed: $1 > $1.gz"
}
@jemerick
jemerick / json-response.py
Created October 6, 2011 18:11 — forked from leah/json-response.py
JSONResponse classes
import re
import simplejson
from django.http import HttpResponse
from django.conf import settings
class JSONResponse(HttpResponse):
def __init__(self, request, data):
indent = 2 if settings.DEBUG else None
@jemerick
jemerick / Folder Preferences
Created October 2, 2011 20:07 — forked from chrisyour/Folder Preferences
Show hidden files and hidden folders (except .git) in your TextMate project drawer
# Want to show hidden files and folders in your TextMate project drawer? Simple, just modify the file and folder patterns in TextMate's preferences.
# Instructions:
# Go to TextMate > Preferences...
# Click Advanced
# Select Folder References
# Replace the following:
# File Pattern