Skip to content

Instantly share code, notes, and snippets.

@spencersugarman
spencersugarman / shoeduino.ino
Created June 17, 2012 18:16
Rover, the pet shoe
/*
* -----------------
* Rover, the pet shoe!
* -----------------
*
* Sleep code based on
* Sleep Demo Serial from http://www.arduino.cc/playground/Learning/ArduinoSleepCode
* Sleeping Arduino http://donalmorrissey.blogspot.com/2010/04/putting-arduino-diecimila-to-sleep.html
*
* Accelerometer code based on
@spencersugarman
spencersugarman / gist:2945231
Created June 17, 2012 18:00
Thumbtack: Espresso Machine
<!--
Solution for the Thumbtack programming challenge #1
http://www.thumbtack.com/challenges
-->
<html>
<head>
<style type="text/css">
body {
position: relative;
margin: 0;
@spencersugarman
spencersugarman / cookiepie.py
Created May 31, 2012 02:00
serial2twitter script for Cookieduino project
##Import libraries
import time
import serial
import tweepy
auth = tweepy.OAuthHandler('secret', 'secret')
auth.set_access_token('sauce', 'sauce')
api = tweepy.API(auth)
##Configure serial port
@spencersugarman
spencersugarman / rigidsafari.js
Created May 22, 2012 23:07
Removing the elasticity from scrolling in Mobile Safari
(function () {
/*
* A small script to disable elastic scrolling in Mobile Safari
*
* Bugs
* - If user is at top/bottom of page and tries to scroll up/down, it
* correctly disables further scrolling, but at the expense of not
* being able to scroll in the allowed direction either. Taking
* their finger off and then starting the scroll in the allowed
* direction works.
/*
* Earning Thumbtack swag in JS
* http://www.thumbtack.com/engineering/how-we-got-people-to-earn-our-schwag/
*/
// The board
// hard-coded here, but could be easily loaded in via AJAX
var thumbtackBoard = [
[".", ".", ".", ".", ".", ".", "."],
[".", ".", ".", ".", ".", ".", "."],
/*
* Simple javascript mobile OS / iphone/ android detector
*
* License: GPLv3+
* Author: justin.kelly.org.au
*
*/
$(document).ready(function() {
var deviceIphone = "iphone";