Skip to content

Instantly share code, notes, and snippets.

View hugs's full-sized avatar
🤖
Making robots

Jason Huggins hugs

🤖
Making robots
View GitHub Profile
@hugs
hugs / Selenium 2 - python.txt
Created May 13, 2010 18:09
Selenium 2 - python
# Using the Selenium 2 egg from here: http://drop.io/84gwpxs
>>> from selenium.firefox.webdriver import WebDriver
>>> browser = WebDriver()
>>> browser.get('http://google.com')
>>> browser.quit()
@hugs
hugs / PinMachine.pde
Created October 15, 2010 03:59
Arduino code for the PinMachine demo.
const int goUpPin = 2; // up input
const int goDownPin = 5; // down input
const int motor1Pin = 3; // H-bridge leg 1 (pin 2, 1A)
const int motor2Pin = 4; // H-bridge leg 2 (pin 7, 2A)
const int enablePin = 9; // H-bridge enable pin (PWM)
const int ledPin = 13; // LED
const int UP = 1;
const int DOWN = 0;
Intro: We're planning on hosting the first ever, two-day Selenium Conference in San Francisco
sometime in April. We're still working out all the details, but wanted to hear from the
community before we lock everything in. Please take a minute to answer the following
questions:
1) Where are you located? [US West Coast, US Central, US East Coast, Europe, Africa, Asia,
Middle East, South America, Other]
2) How much would you expect the ticket price to be for a 2-day conference? [Less than $100, $100-$150, $150-$250, $250 - $350, $350 - $500, more than $500]
@hugs
hugs / tweet_archiver.py
Created December 13, 2010 23:59
Python code for retrieving all your tweets, based on code from @terrycojones.
# Based on http://blogs.fluidinfo.com/terry/2009/06/24/python-code-for-retrieving-all-your-tweets/
# Patched to retry upon failure until *all* tweets are downloaded.
import sys, twitter, operator
from dateutil.parser import parse
import time
twitterURL = 'http://twitter.com'
def fetch(user):
data = {}
api = twitter.Api()
@hugs
hugs / jpg-to-movie.py
Created December 28, 2010 01:26
Code I used to record time-lapse webcam images, and then convert them all into a movie.
#
# 1) Take pictures
#
# Hardware: Logitech Webcam
# Software:
# a) OS X 10.6.8
# b) Python 2.6+
# c) isightcapture
# I use a freeware program for OS X called "isightcapture". It's not open source,
# but you can find open source equivalents with a wee bit of googling.
@hugs
hugs / selenium-examples.py
Created February 16, 2011 19:40
Example code for using the Selenium 2 Python bindings.
# To install the Python client library:
# pip install -U selenium
# Import the Selenium 2 namespace (aka "webdriver")
from selenium import webdriver
# iPhone
driver = webdriver.Remote(browser_name="iphone", command_executor='http://172.24.101.36:3001/hub')
# Android
@hugs
hugs / seconf_is_awesome.py
Created March 14, 2011 23:30
For the back of the shirt
from seleniumconf import *
tweet("#SeConf is awesome!")
@hugs
hugs / noise
Created April 1, 2011 21:41 — forked from xguse/brownNoise.sh
Soothing noise generator
#!/bin/sh
# Jason Huggins (@hugs)
#
# Install:
# * Download http://sourceforge.net/projects/sox/files/sox/14.3.2/
# * Unzip and the place "play" binary somewhere in your $PATH
# Explanation of settings:
# - Stereo (2 channels): -c 2
@hugs
hugs / pot.pde
Created April 3, 2011 03:08
"Smoke testing my pot": Reading serial data from a 10K linear sliding potentiometer via Arduino.
More information on using pots with Arduino:
http://www.arduino.cc/en/Tutorial/Potentiometer
@hugs
hugs / texture.html
Created May 27, 2011 02:41 — forked from bellbind/texture.html
[WebGL] Texture example by 2d canvas
<!DOCTYPE html>
<html>
<head>
<script>//<!--
// WebGL texture example
top.CanvasFloatArray = top.CanvasFloatArray || WebGLFloatArray;
var gl;
var program;