Skip to content

Instantly share code, notes, and snippets.

View smarthall's full-sized avatar

Daniel Hall smarthall

View GitHub Profile
@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
@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