Skip to content

Instantly share code, notes, and snippets.

View smarthall's full-sized avatar

Daniel Hall smarthall

View GitHub Profile
@smarthall
smarthall / gist:2716231
Created May 17, 2012 04:06
PhotoMapDisplay
//We always have to include the library
#include "LedControl.h"
LedControl lc=LedControl(10,11,12,1);
unsigned long delaytime=100;
void setup() {
Serial.begin(9600);
@smarthall
smarthall / update-dns.sh
Created May 8, 2012 00:24 — forked from jfro/update-dns.sh
Linode dynamic DNS updating script
#!/bin/sh
# modified by jfro from http://www.cnysupport.com/index.php/linode-dynamic-dns-ddns-update-script
# Uses curl to be compatible with machines that don't have wget by default
LINODE_API_KEY=licensekey
DOMAIN_ID=domainid
RESOURCE_ID=resourceid
WAN_IP=`curl -s http://example.com/whatsmyip.php`
if [ -f $HOME/.wan_ip.txt ]; then
@smarthall
smarthall / strnchr.c
Created February 28, 2012 22:04 — forked from jehiah/strnchr.c
strnchr because it doesn't exist for some reason
#include <stdlib.h>
/*
Returns a pointer to the first occurrence of character in the C string str.
The terminating null-character is considered part of the C string. Therefore,
it can also be located to retrieve a pointer to the end of a string.
@param str the string to be searched
@param len the number of characters to search
@param character the character to search for
@smarthall
smarthall / gist:1726243
Created February 2, 2012 22:38
ArcadeMachineControls
// Settings
#define PLAYER_NUM 1
#define PIN_SQUELCH 5
// Constants
#define USB_PKT_SIZE 8
#define USB_KEY_START 2
#if PLAYER_NUM == 1
#define PIN_COUNT 15
@smarthall
smarthall / lifx.c
Created August 12, 2015 12:11
LIFX Packet Sending Example
#include "lifx.h"
#include <arpa/inet.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
@smarthall
smarthall / gist:39d9db9392de8dbff1f8
Created October 21, 2014 05:15
Keybase Verification
### Keybase proof
I hereby claim:
* I am smarthall on github.
* I am smarthall (https://keybase.io/smarthall) on keybase.
* I have a public key whose fingerprint is A7FC 317E A9D0 5A34 45E7 2BCD 8AD9 D99E 2E0A 44E2
To claim this, I am signing this object:
@smarthall
smarthall / 0_reuse_code.js
Created June 21, 2014 12:58
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console