Skip to content

Instantly share code, notes, and snippets.

@airdrummingfool
airdrummingfool / bendybot.ino
Created April 11, 2017 22:58
Bendy Bot Arduino code
// BendyBot
// By Tommy Goode
#include <Stepper.h>
#include <LiquidCrystal.h>
#define STEPS 200
#define AIN1_PIN 11
#define AIN2_PIN 12
#define BIN1_PIN 9
@airdrummingfool
airdrummingfool / 00-eb_container_envvars.config
Last active February 24, 2017 20:58
A new version of the Elastic Beanstalk container removed the very useful $EB_CONFIG_* environment variables. This puts them back, as $EB_CONTAINER_*.
# The Ruby script at /opt/elasticbeanstalk/support/get_envvars.rb is responsible for compiling a list of
# environment variables for use throughout the system. This patches that file to add the EB container variables.
# Most of the added $EB_CONTAINER_* directly match the old $EB_CONFIG_* variables that Elastic Beanstalk did away with
# in a recent container version update; however, $EB_CONFIG_APP_CURRENT is now $EB_CONTAINER_APP_DEPLOY.
# Note: Since we're using `git apply` as a "better GNU patch" we need to pass `--unsafe-paths` in Git >=2.3.0
# See https://gist.github.com/airdrummingfool/29e73d6dfa68ec5da92e for updates and changelog
files:
"/tmp/add_container_envvars.patch" :
mode: "000755"
// ==UserScript==
// @name 8x8 Fix Manage Extensions List
// @namespace com.tgoode.userscript.8x8.
// @description Allow extensions list to be scrolled in the Manage Extensions list.
// @include https://accountmanager.8x8.com/faces/phoneSystem/extensions/manageExtensions*.xhtml
// @version 1
// @grant GM_addStyle
// ==/UserScript==
GM_addStyle(' \
@airdrummingfool
airdrummingfool / Hide_Bitbucket_.pbxproj_diff_in_pr.user.js
Created November 2, 2014 01:05
Hide Bitbucket's .pbxproj diff in pull requests
// ==UserScript==
// @name Hide Bitbucket .pbxproj diff in pull requests
// @namespace com.tgoode.userscript.hidepbxprojdiff
// @description Hides the .pbxproj diff on Bitbucket Pull Requests
// @include https://bitbucket.org/*/*/pull-request/*
// @version 1
// @grant GM_addStyle
// ==/UserScript==
GM_addStyle(' \
@airdrummingfool
airdrummingfool / pinger.py
Last active August 29, 2015 14:04
Pinger.py: for tracking network downtime. `python pinger.py <ip> <backup ip> [-v] [-t <tolerance>] [-l <logfile>]`
"""
pinger.py
Tommy Goode
tgoode.com
"""
import os, sys, time
import datetime
import getopt
@airdrummingfool
airdrummingfool / nth-commit.sh
Last active December 7, 2018 15:31 — forked from joeyates/nth-commit
Checkout the nth commit on a specified branch.
#!/bin/bash
# nth-commit.sh
# Usage: `nth-commit.sh n [branch]`
branch=${2:-'master'}
SHA1=$(git rev-list $branch | tail -n $1 | head -n 1)
git checkout $SHA1
@airdrummingfool
airdrummingfool / update_build_number.sh
Last active October 27, 2020 16:43
Update current Xcode target's build number with the number of commits on a specified branch. http://tgoode.com/2014/06/05/sensible-way-increment-bundle-version-cfbundleversion-xcode/
#!/bin/bash
# update_build_number.sh
# Usage: `update_build_number.sh [branch]`
# Run this script after the 'Copy Bundle Resources' build phase
# Ref: http://tgoode.com/2014/06/05/sensible-way-increment-bundle-version-cfbundleversion-xcode/
branch=${1:-'master'}
buildNumber=$(expr $(git rev-list $branch --count) - $(git rev-list HEAD..$branch --count))
echo "Updating build number to $buildNumber using branch '$branch'."
#!/bin/bash
# copy_reveal.sh
# Ref: https://gist.github.com/airdrummingfool/9557257
APPBUNDLEPATH="${TARGET_BUILD_DIR}/${EXECUTABLE_NAME}.app/"
REVEALFRAMEWORKPATH="/Applications/Reveal.app/Contents/SharedSupport/iOS-Libraries/libReveal.dylib"
if [ -f "${REVEALFRAMEWORKPATH}" ] && [ "${CONFIGURATION}" == "Debug" ]; then
""" File: reveal.py
1. Add to ~/.lldbinit:
command script import ~/.lldb-scripts/reveal.py
2. Add Run Script Build Phase to copy libReveal.dylib into the bundle
(see https://gist.github.com/airdrummingfool/9557257)
Q: Want to automatically load the Reveal lib on launch while debugging from Xcode?
A: In Xcode:
Add a Symbolic Breakpoint