Skip to content

Instantly share code, notes, and snippets.

View bkeating's full-sized avatar
🤙
Gettin’ SUM & CALCin’ out

Benjamin Keating bkeating

🤙
Gettin’ SUM & CALCin’ out
View GitHub Profile
@bkeating
bkeating / coinbase_auth_example.py
Created August 5, 2014 19:07
GET and POST to Your Coinbase.com account (via API + Secret Key). This is based on the example in their documentation. Adds expires support. Make sure API used has necessary permissions.
# -*- coding: utf-8 -*-
#!/usr/bin/env python
import os
import hashlib
import hmac
import urllib2
import time
import json
@bkeating
bkeating / servo.ino
Created May 28, 2014 18:05
A simple servo sweep using PWM. Taken from an example in the Arduino IDE application.
// Sweep
// by BARRAGAN <http://barraganstudio.com>
// This example code is in the public domain.
#include <Servo.h>
Servo myservo; // create servo object to control a servo
// a maximum of eight servo objects can be created
# -*- coding: utf-8 -*-
from flask import Flask, jsonify, render_template, request
app = Flask(__name__)
from subprocess import check_output
@app.route('/_add_numbers')
def add_numbers():
"""Add two numbers server side, ridiculous but well..."""
@bkeating
bkeating / gist:10937264
Created April 16, 2014 21:58
Instant HTTP server via Python
python -m SimpleHTTPServer 8080
@bkeating
bkeating / gist:10936636
Created April 16, 2014 21:49
Turn your web browser into a notepad
data:text/html, <html contenteditable>
salt-020031212-schwartz
salt-020060113-cavanagh-schwartz
salt-020060213-lansing
salt-020060310-kelly
salt-020060414-wales
salt-020060512-anderson-hearst
salt-020060626-eno-wright
salt-020060714-rendon
salt-020060922-schell
salt-020061013-baez

Status Boards

East Troy Computer Club Meetup
Wednesday, Feb 18th, 02013
7pm @ 2894 On Main, East Troy, WI
http://etcc.io/

Many thanks to 2894 On Main for staying open extra late just for us!

Potential agenda

@bkeating
bkeating / wp-5digit-year.md
Last active January 1, 2016 18:59
Simple HOWTO to get 5 digit year support in WordPress.

5 Digit Year support in WordPress

This is a cosmetic tweak only, meaning WordPress, your database and system in general will not recognize the 5 digit year as a valid year. This is fine however. With this tweak we get it where it counts; Your URLS will cite 5 digit years and your template can be adjusted to also display them. It displays where your users will see it and that will get them thinking.

  1. Go to your WordPress admin panel. Under Settings -> Permalinks select Custom Structure and add your padded zero:

     /0%year%/%monthnum%/%day%/%postname%/
    
  2. Since your URL structure just changed, add rewrites for URLs citing 4 digit years (legacy support). Under Nginx add:

Lighting structure is separate from it's 'costume'. The lightning is then compatible with any/all festivities and we can encourage the community to decorate/make costumes for them.

The lighting system itself could be made 'intelligent'. They could sparkle as people pass by. Or if it were for halloween, they could play a 'spooky noise' as people pass by. They could be networked together, to put on simple, but coordinated light shows. The color and intensity of the light could play a role too. Think the blue gas light in Milwaukee... Blue on colder nights, Orange when it's warmer.

Ok, here is a thought that's getting out of control... Allow people to interact with the lights via the web (their phones). Each light could have a little 'dance' pattern... Or again, if it's halloween you could allow people to control what it says... as their friends walk by, they could scare them, or play something funny. Oh(!) Valentines day could get really cute with this idea.

Not thinking about the "costume" yet, the lighting

@bkeating
bkeating / coinbase_price.py
Last active December 28, 2015 16:49
Grab current price of bitcoin in USD from coinbase.com.
#!/usr/bin/env python
from bs4 import BeautifulSoup
import urllib2
site = "https://coinbase.com/"
# Coinbase judges you.
hdr = {
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',