Skip to content

Instantly share code, notes, and snippets.

Brandon Stafford pingswept

Block or report user

Report or block pingswept

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@pingswept
pingswept / ventilate.py
Last active Jul 1, 2018
Python script to turn a fan on and off based on SHT31 temperature and temperature from the internet
View ventilate.py
from Adafruit_IO import *
import json
import requests
import RPi.GPIO as GPIO
import smbus
import time
aio = Client('XXXXXXXXXXXXXXXXX_ADAFRUIT_API_KEY_GOES_HERE_XXXXXXXXXXXXXXXXX')
GPIO.setmode(GPIO.BCM) # choose BCM or BOARD
@pingswept
pingswept / replify.py
Created Aug 8, 2017
Script for Chris to manipulate his G-code
View replify.py
infile = "infile.txt" # the file to open
copies = 3 # how many copies to make
marker = "STARTHERE\n"
with open(infile, 'r') as infile:
lines = infile.readlines()
#print(lines)
startline = lines.index(marker)
result = ''.join(lines + (lines[startline + 1:] * copies))
View sneakers.csv
Brand Model Size Width Good/bad
New Balance Fresh Foam Gobi 14 EE Ill-fitting and stiff, but low arch is good. VL-6 last. Might be okay. Should try v2, will drop in July 2017.
New Balance Fresh Foam Hierro v2 14 4E Almost good but arch too high. Same PL-4 last as favorite MO69v1's. Disappointing.
New Balance Minimus 10v1 14 EE Almost good but arch too high. NL-1 last. Very comfy other than arch.
Montrail Fluid Flex FKT 14 -- WINNER! 8 pairs, 6 left. Update: not on Zappos any more. One color on columbia.com, May 2017.
Brooks Puregrit 4 14 -- Trevor recommended but haven't tried yet because of previous Brooks being too short in 14.
Topo MT-2 14 -- Kept. Might be serviceable.
Montrail Fluid Flex ST 14 -- WINNER! 3 pairs. Update: no longer available.
Nike Air Zoom Wildhorse 3 14 -- kept. Insole is a little stiff but could be a winner.
Montrail Fluid Flex II 14 ? Good. 1 pair. Blisters on long runs. Update: no longer available.
@pingswept
pingswept / winterize.md
Last active Sep 3, 2015
Winterizing the house
View winterize.md

Closing

  • Cut power to well pump
  • Cut power to hot water heater with circuit breaker
  • Close main water valve
  • Open all faucets, and leave them open
    • kitchen sink, including blowing out spray hose
    • bathroom #1, including shower
    • bathroom #2, including shower
  • Drain water heater through garden hose
@pingswept
pingswept / precision-voltage-shield-on-arduino-due.ino
Last active Sep 1, 2015
Code for the Rascal Micro Precision Voltage Shield on an Arduino Due
View precision-voltage-shield-on-arduino-due.ino
/* Works, but very slow. */
/* Licensed under the GNU General Public License, version 3 */
/* Copyright Brandon Stafford, September 1, 2015 */
#define SCALE_FACTOR 0.000152587890625
// 10/(2^16) = 0.000152587890625
#define BUSY 3
#define RESET 4
View replace.md
  • cutting boards (have 3, all stained and worn out)
  • knives (have 1 good, small, serrated knife (orange handle))
  • sand floor near front door
  • refrigerator: loud, handle loose, shelves cracked
  • creepy lights in downstairs bathroom
  • lights under counter edge in kitchen
  • powerwash deck, or at least somehow make less slippery (especially stairs outside dining room)
View travel-checklist.markdown

Clothes

  • t-shirts
  • cotton shorts
  • synthetic shorts
  • pants
  • belt
  • sleeping shirts
  • boxers
  • synthetic socks not for running
View minimal.py
#!/usr/bin/python
from pruio import *
from time import sleep
# Create a ctypes *pointer* to the pruio structure
io = pruio_new(PRUIO_DEF_ACTIVE, 0, 0, 0)
# Note the *pointer* dereferencing using the contents member
if not io.contents.Errr:
pruio_config(io, 1, 0, 0, 0)
for i in range(4):
@pingswept
pingswept / dmesg-jessie-2015-02-15
Last active Aug 29, 2015
dmesg-jessie-2015-02-15
View dmesg-jessie-2015-02-15
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 3.14.33-ti-r51 (root@a6-imx6q-wandboard-2gb) (gcc version 4.9.1 (Debian 4.9.1-19) ) #1 SMP PREEMPT Fri Feb 20 17:38:44 UTC 2015
[ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] Machine model: TI AM335x BeagleBone Black
[ 0.000000] cma: CMA: reserved 24 MiB at 9e000000
[ 0.000000] Memory policy: Data cache writeback
View kernel_crash.txt
From kernel: Linux templeman 3.8.13-bone50 #1 SMP Tue May 13 13:24:52 UTC 2014 armv7l GNU/Linux
Message from syslogd@templeman at Feb 12 22:21:11 ...
kernel:[ 428.278110] Internal error: Oops: 17 [#1] SMP THUMB2
Message from syslogd@templeman at Feb 12 22:21:11 ...
kernel:[ 428.360264] Process swapper/0 (pid: 0, stack limit = 0xc0824240)
Message from syslogd@templeman at Feb 12 22:21:11 ...
You can’t perform that action at this time.