Skip to content

Instantly share code, notes, and snippets.


Dan Conley Sigafoos

View GitHub Profile
View gist:60d5cc2712b417c3c790
### Keybase proof
I hereby claim:
* I am Sigafoos on github.
* I am dconley ( on keybase.
* I have a public key whose fingerprint is C8E9 642A F731 3631 1294 6A0B 1EF8 32E1 2866 4DA0
To claim this, I am signing this object:
Sigafoos / AutoHotkey.ahk
Created May 12, 2015
AutoHotkey for conditional Capslock::Esc remapping
View AutoHotkey.ahk
classname = ""
keystate = ""
WinGetClass, classname, A
if (classname = "PuTTY" or classname = "Vim")
send,{Esc down}
View .tmux.conf
# Set colors
set-option -g default-terminal "screen-256color"
# Set reload key to r
bind r source-file ~/.tmux.conf
# Use vim bindings
setw -g mode-keys vi
# copy/paste
View .vimrc
execute pathogen#infect()
set autoindent
set cindent
set smartindent
set number
set hlsearch
set so=2
set clipboard=unnamed
set cursorline
highlight CursorLine cterm=NONE ctermbg=darkgrey ctermfg=None
Sigafoos / gist:bb453eec3a7c9401600a
Last active Aug 29, 2015
Tampermonkey to pull selected Overcast podcasts to the top of the page
View gist:bb453eec3a7c9401600a
// ==UserScript==
// @name Overcast Politics
// @namespace
// @version 0.1
// @description Sort podcasts by group
// @author Dan Conley
// @match
// @grant none
// @require
// ==/UserScript==
Sigafoos /
Created Feb 19, 2017
Determine the success rates of algorithms for high/low
import random
from copy import deepcopy
# create the set of cards (2-10, JQKA) x4. suits don't matter.
deck = [x for x in xrange(2, 15)] * 4
# translate the numerical value to the string
def to_card(i):
if i == 11:
return 'J'
Sigafoos / nighttimeclock.ino
Created Feb 20, 2017
Use an Arduino Nano with two LEDs, red for "stay in bed" and green for "it's okay to get up". Set the time via serial before unplugging: make sure you have an alternate power source. I soldered a 9v connector to the VIN for that.
View nighttimeclock.ino
#include <Time.h>
#include <TimeLib.h>
#include <TimeAlarms.h>
int greenLED = 5;
int redLED = 7;
#define TIME_MSG_LEN 11 // time sync to PC is HEADER followed by Unix time_t as ten ASCII digits
#define TIME_HEADER 'T' // Header tag for serial time sync message
#define HMS_MSG_LEN 6 // time sync to PC is HEADER followed by HHMMSS as digits
Sigafoos / circuitplayground-Circuit-Jouster.js
Last active Aug 10, 2017
A game where you have to keep a Circuit Playground level for as long as possible. It keeps track of your "score" (2 points per second) and displays it at the end of the game.
View circuitplayground-Circuit-Jouster.js
// variables
let soundsOn = true // false if you don't want any sounds
let modifier = 100 // lower == harder
// the game flow
let rounds = playGame(modifier)
serial.writeLine("rounds: " + rounds.toString())
View mwr.ino
// Specifically for use with the Adafruit Feather, the pins are pre-set here!
// include SPI, MP3 and SD libraries
#include <SPI.h>
#include <SD.h>
#include <Adafruit_VS1053.h>
#include "config.h" // not included here, but the standard config.h file used with
AdafruitIO_Feed *knock = io.feed("knock");
AdafruitIO_Feed *hello = io.feed("hello");
import json
import urequests
import base64
with open("config.json") as fp:
config = json.load(fp)
if config['key'] is None:
raise KeyError("No twitter API key")
if config['secret'] is None: