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 / rigged.html
Created October 20, 2016 18:56
Trump is right! The vote is rigged! Here's the cyber source code!
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="http://www.washingtontimes.com/" />
<title>New Test</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
@hugs
hugs / dancebot_touchdown.ino
Created October 13, 2015 13:43
If Dancebot were a football referee... https://github.com/hugs/dancebot
#include <Servo.h>
Servo head;
Servo leftArm;
Servo rightArm;
int headPosition = 90;
int leftArmPosition = 90;
int rightArmPosition = 90;
@hugs
hugs / dancebot.ino
Created October 13, 2015 13:40
Arduino sketch for Dancebot. https://github.com/hugs/dancebot
#include <Servo.h>
Servo head;
Servo leftArm;
Servo rightArm;
int headPosition = 90;
int leftArmPosition = 90;
int rightArmPosition = 90;
@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",
@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 / README.md
Last active December 28, 2016 19:16 — forked from elidupuis/README.md
Simple Drawing Example

Simple Drawing Example

Click and drag your mouse (or finger on touch device) to draw a line. A new path is created for each touch or click.

Paths are stored in a nested array; you can inspect the variable in console: session (assuming the example is in it's own window).

@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 / motion.js
Last active January 26, 2018 00:09
An improved algorithm for controlling Tapster motion
/*
// Usage:
// motion.move(pointA, pointB, numberOfSteps, easingType, timeDeltaInMilliseconds)
// Example
$ node bot.js
>> motion = require('./motion')
>> motion.move([0,0,-140],[-20,20,-140], 20, 'easeInOutCubic', 500)
>> motion.move([-20,60,-165],[-20,-60,-165], 30, 'easeInOutCubic', 20)
>> motion.move([-20,-60,-165],[-20,60,-165], 30, 'easeInOutCubic', 20)
@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 / 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?"