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 / knock.py
Last active August 29, 2015 13:57
Knock-on-Wood-Bot
# Step 1: Get a dancebot (https://github.com/hugs/dancebot)
# Step 2: Find wooden box
# Step 3: Run this code
from BreakfastSerial import Arduino, Servo
from time import sleep
board = Arduino()
s1 = Servo(board, "9")
s2 = Servo(board, "10")
@hugs
hugs / archive-twitpic-data.py
Last active August 29, 2015 14:06
Twitpic Image and Data Archiver
# Archive your Twitpic photos and metadata
#
# A cleaned-up fork of Terence Eden's original archiver:
# http://shkspr.mobi/blog/2013/08/exporting-twitpic-images-python/
#
# License: MIT
import urllib
import urllib2
import json
@hugs
hugs / tranquility_base_hotel.txt
Last active August 29, 2015 14:06
Tranquility Base Hotel - Chapter 1
Tranquility Base Hotel
by Jason Huggins
Chapter 1
"That's the stupidest idea I ever heard," said Jack, senior partner at Sand
Hill Road's storied Exemplar Capital, who jumped into the meeting 20 minutes
late. "Seriously, is this a joke?"
@hugs
hugs / 1_print_problems_and_answers.py
Last active August 29, 2015 14:06
Addition and Subtraction Practice Problems (Hundred Thousands)
from random import randint
problems = []
def print_problem(operation):
a = randint(100000, 999999)
b = randint(100000, 999999)
if b > a:
a,b = b,a
@hugs
hugs / draw-a-circle.js
Last active August 29, 2015 14:22
Draws a circle using a Tapster robot
var centerX=0;
var centerY=0;
var radius=20;
// an array to save your points
var points=[];
// populate array with points along a circle
for (var degree=0; degree<360; degree++){
var radians = degree * Math.PI/180;
@hugs
hugs / example.js
Last active August 29, 2015 14:23 — forked from jackskalitzky/lines
> var linesRaw = fs.readFileSync('lines.json', 'utf8');
> lines = JSON.parse(linesRaw)
[ [ { x: 122.01388549804688, y: 183.01388549804688 },
{ x: 119.01388549804688, y: 195.01388549804688 },
{ x: 115.01388549804688, y: 307.0138854980469 },
{ x: 115.01388549804688, y: 354.0138854980469 },
{ x: 117.01388549804688, y: 360.0138854980469 } ],
[ { x: 206.01388549804688, y: 177.01388549804688 },
{ x: 204.01388549804688, y: 194.01388549804688 },
{ x: 202.01388549804688, y: 287.0138854980469 },
@hugs
hugs / bot.js
Last active August 29, 2015 14:23
Bot.js for Tapster for use with digital servos
var sleep = require('sleep');
five = require("johnny-five");
ik = require("./ik");
board = new five.Board({ debug: false });
board.on("ready", function() {
// Setup
servo1 = five.Servo({
address: 0x40,
controller: "PCA9685",
hello world!
print "hello world"
print "hello world"