Skip to content

Instantly share code, notes, and snippets.

View dtudury's full-sized avatar

David Tudury dtudury

  • Oakland, California, USA
View GitHub Profile
/*
* lights2.c
*
* Created: 6/24/2013 10:06:23 PM
* Author: dtudury
*/
#ifndef F_CPU
#define F_CPU 8000000UL // or whatever may be your frequency
#endif
@dtudury
dtudury / gist:6583161
Created September 16, 2013 16:41
charlieplexing
var index = 0;
function makeDummyData() {
return JSON.stringify({t: +new Date(), rand: Math.random(), i: index++, v: 'nodesy'});
}
var config = {
subdomain: cred.account,
auth: {
username: cred.username,
password: cred.password
@dtudury
dtudury / pre-commit
Last active December 23, 2015 11:39
little nagging git hook to remind me to jshint my changes
#!/usr/bin/env node
//install this script from the root of the local repo with something like...
//mkdir -p .git/hooks ; curl -L https://gist.github.com/dtudury/6629720/raw > .git/hooks/pre-commit ; chmod +x .git/hooks/pre-commit
var EXEC = require('child_process').exec;
var JSHINT = require('jshint').JSHINT;
var FS = require('fs');
@dtudury
dtudury / 7-segment.c
Last active December 23, 2015 21:19
osx setup for atmega32u4 (with silly program to control 7-segment led)
// 0) I have xcode installed everywhere, I'm not sure that's a dependency but...
// I'm not going to uninstall it to test the theory
// 1) download and install crosspack: http://www.obdev.at/products/crosspack/download.html
// (you may need to go into "security & privacy" and take osx out of nanny-mode)
// 2) with the controller unplugged open a console and type `ls /dev/tty.*`
// 3) plug it in and type `ls /dev/tty.*` again... make a note of the new device
// 4) `cd ~/Documents`
// 5) `avr-project 7-segment`
// 6) `cd 7-segment/firmware`
// 7) edit the Makefile
@dtudury
dtudury / gist:7104972
Created October 22, 2013 17:51
arithmatic notes
  • augend + addend = sum
  • minuend - subtrahend = difference
  • multiplicand * multiplier = product
  • dividend / divisor = quotient
  • dividend % divisor = remainder
  • base ^ exponent = power
  • degree √ radicand = root
  • log ? base ? power = exponent
@dtudury
dtudury / page1.js
Last active August 29, 2015 13:57
/*
javascript:(function () {
var jsCode = document.createElement('script');
jsCode.setAttribute('src', 'https://rawgit.com/dtudury/9501081/raw/881aa3218effc7c8d108b5537fe18e427b246e98/page1.js');
document.body.appendChild(jsCode);
}());
*/
var numbers = "0123456789";
function randomNumber() {
return numbers.charAt(Math.floor(Math.random() * numbers.length));
@dtudury
dtudury / page2.js
Last active August 29, 2015 13:57
/*
javascript:(function () {
var jsCode = document.createElement('script');
jsCode.setAttribute('src', 'https://rawgit.com/dtudury/9501738/raw/f383c0de610467b8b81d38b263772bb663b04ceb/page2.js');
document.body.appendChild(jsCode);
}());
*/
var numbers = "0123456789";
function randomNumber() {
return numbers.charAt(Math.floor(Math.random() * numbers.length));

##Liquid Sugar: combine

  • 4 cups white sugar
  • 1 1/2 cups water
  • 1/4 teaspoon cream of tartar

in a covered pot over low heat for at least 30 minutes; makes 4 cups

because 4 cups contains 4 cups of sugar it's a very good substitute for granulated sugar. Boiling it with the cream or tartar inverts some of the sucrose creating a sweeter combination of sugars less prone to crystallization. The higher sugar content also increases the shelf-life.

#!/usr/bin/osascript
-- run as something like `./run_in_panes.scpt "echo a" "echo b"`
on run argv
set numCmds to count of argv
set numCols to round numCmds ^ 0.5 rounding up
set numRows to round numCmds / numCols rounding up
launch "iTerm"
@dtudury
dtudury / keybase.md
Created August 4, 2014 17:26
keybase.md

Keybase proof

I hereby claim:

  • I am dtudury on github.
  • I am dtudury (https://keybase.io/dtudury) on keybase.
  • I have a public key whose fingerprint is BF35 8F92 0C77 AD10 5A80 62D7 577E AC54 B305 E554

To claim this, I am signing this object: