Skip to content

Instantly share code, notes, and snippets.

View apexskier's full-sized avatar

Cameron Little apexskier

View GitHub Profile
Some notes about working with reStructuredText. Specifically, this is in the
context of the `WWU University Residences website <http://housing.wwu.edu>`_,
which has .rst files driving most of it's static content and is using
responsive `Bootstrap <twitter.github.io/bootstrap/>`_ for css styles and
framework.
==========
Fluid Rows
==========
.twitter-typeahead {
width: 100%;
}
.twitter-typeahead .tt-query,
.twitter-typeahead .tt-hint {
margin-bottom: 0;
}
.input-group .form-control.tt-query:not(:first-child):not(:last-child) {
border-top-left-radius: 6px;
border-bottom-left-radius: 6px;
@apexskier
apexskier / fishbowltimer.py
Last active August 29, 2015 13:56
Fishbowl timer
"""
Uses my ledDriver for the Raspberry Pi to make a minute long game timer.
Just made in a few minutes one night.
https://github.com/apexskier/ledDriver
"""
import time, math
from homedo.libs.rgbLED.ledDriver import RGBDriver
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@apexskier
apexskier / 99-input.rules
Last active May 7, 2017 20:17
Car Bluetooth RasPi stuff
# /etc/udev/rules.d/99-input.rules
SUBSYSTEM=="input", GROUP="input", MODE="0660"
KERNEL=="input[0-9]*", RUN+="/usr/lib/udev/bluetooth"
@apexskier
apexskier / audio-test.py
Last active August 29, 2015 13:56
Python script to interact with Wit
import pyaudio
from array import array
import wave
import requests
import json
CHUNK = 1024
FORMAT = pyaudio.paInt16
CHANNELS = 2
RATE = 44100
@apexskier
apexskier / keybase.md
Created April 6, 2014 15:23
keybase.md

Keybase proof

I hereby claim:

  • I am apexskier on github.
  • I am apexskier (https://keybase.io/apexskier) on keybase.
  • I have a public key whose fingerprint is 0139 D25F 1AE2 7F02 C41B 260C 5C02 ABCF A51C D100

To claim this, I am signing this object:

@apexskier
apexskier / deploy-hooks.sh
Last active March 18, 2016 20:22
Script to deploy git hooks from version control.
#!/bin/sh
# Deploy hooks stored in your git repo to everyone!
# https://gist.github.com/apexskier/efb7c1aaa6e77e8127a8
#
# I keep this in $ROOT/$HOOK_DIR/deploy
# From the top level of your git repo, run ./hook/deploy (or equivalent) after
# cloning or adding a new hook.
# No output is good output.
BASE=`git rev-parse --git-dir`
@apexskier
apexskier / pre-commit
Last active August 18, 2016 15:44
pylint code review git pre-commit hook
#!/usr/bin/python
"""
based on http://fitzgeraldnick.com/weblog/9/
A pre-commit hook for git that provides some automated code review.
This script must be located at ``$REPO/.git/hooks/pre-commit`` and be
executable.
"""
@apexskier
apexskier / cleanup.bash
Last active May 8, 2017 18:45
Dokuwiki Clean up
#!/usr/local/bin/bash
# find all files that should be start pages
for dir in `find . -type d`
do
file="${dir}.txt"
if [ `ls "${dir}.txt" 2> /dev/null ` ]
then
# generate the link to the file
dokulink=$(sed "s|^\./\(.*\)\.txt|\1|" <<< "${file}" | sed "s|/|:|g")