Skip to content

Instantly share code, notes, and snippets.

##############################################################
# Added by SparkFun electronics to support the BadgerStick
# Download bootloader from: https://cdn.sparkfun.com/assets/learn_tutorials/3/4/9/BadgerStick_Support_Files.zip
badger.name=BadgerStick (3.3V, 4 MHz)
badger.upload.tool=avrdude
badger.upload.protocol=arduino
badger.upload.maximum_size=30720
@brendan-w
brendan-w / geiger.plot
Last active July 7, 2016 22:44
gnuplot file for displaying my Sr90's emission characteristics
set polar
set grid polar
set angle degrees
unset xtics
unset ytics
set border 0
set rrange [0 : 300]
set size square
set_label(x, text) = sprintf("set label '%s' at (330*cos(%f)), (330*sin(%f)) center", text, x, x) #this places a label on the outside
@brendan-w
brendan-w / inspect.h
Created June 9, 2016 01:14
Command line inspector for Qt's object hierarchy
#pragma once
#include <QString>
#include <QObject>
#include <QDebug>
#ifndef SPACER
# define SPACER " "
#endif
@brendan-w
brendan-w / fcrypt.py
Last active March 14, 2016 19:28
Intentionally f****d up cryptography
#!/usr/bin/env python2
########################################################################
# #
# fcrypt: Intentionally f****d up cryptography #
# #
# Copyright 2016 Brendan Whitfield ([email protected]) #
# #
########################################################################
# #
@brendan-w
brendan-w / osc_robot.pde
Last active June 17, 2020 10:54
Processing app for sending keystrokes with TouchOSC
import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.KeyEvent;
import java.util.Map;
import oscP5.*;
Robot robot;
OscP5 oscP5;
final int PORT = 8000;
@brendan-w
brendan-w / bashlock.sh
Last active May 23, 2019 13:23
A blocking mutex for bash scripts using `ln`
#!/bin/bash
function lock {
if [ "$#" -ne 1 ]; then
echo 'usage: lock [LOCKFILENAME]' 1>&2
return 1
fi
LOCKFILE="$1"
@brendan-w
brendan-w / lemmagen_v2.2_linux.diff
Last active March 22, 2016 22:57
A patch to get LemmaGen v2.2 C++ to compile on linux
diff -uprN v2.2/lemmagen/project/makefile/Makefile v2.2_fixed/lemmagen/project/makefile/Makefile
--- v2.2/lemmagen/project/makefile/Makefile 2008-04-28 14:34:30.000000000 -0400
+++ v2.2_fixed/lemmagen/project/makefile/Makefile 2016-01-19 18:10:06.206054535 -0500
@@ -27,7 +27,7 @@ OBJINTER=\
$(OBJPATH)/InterLearn.o \
$(OBJPATH)/InterBuild.o \
$(OBJPATH)/InterLemtz.o \
- $(OBJPATH)/InterXval.o \
+ $(OBJPATH)/InterXVal.o \
$(OBJPATH)/InterSplit.o \
@brendan-w
brendan-w / obd_shim.py
Last active November 3, 2015 01:45
Attempts to parse obd data from the zaicus-gps-tracker
# written for obd==0.4.1
# this will need a few modifications once 0.5.0 rolls out
import obd
from obd.utils import Response, unhex
from obd.protocols.protocol import Message
@brendan-w
brendan-w / light-count.cpp
Created October 20, 2015 21:59
Quick and dirty OpenCV program for counting christmas lights
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/features2d/features2d.hpp>
using namespace std;
using namespace cv;