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 / grbl-settings.txt
Created September 9, 2021 14:10
Grbl settings for Tapster 3
Grbl 1.1f ['$' for help]
$0=3
$1=255
$2=0
$3=0
$4=0
$5=1
$6=0
$10=1
$11=0.010
@hugs
hugs / tapster-3.coffee
Created October 1, 2020 00:23
Tapster 3 Assembly - It's okay to use CoffeeScript ☕😎
# Tapster 3 Assembly
# (c) 2020 Jason R. Huggins
# It's okay to use CoffeeScript ☕
# No, really, pi is wrong
Math.TAU = Math.PI*2
arm_offset = Math.acos(69.912/70) / Math.TAU * 360
servo_height_offset = (-28.5 / 2) - 5
servo_width_offset = 44.6 / 2
@hugs
hugs / 1 - setup.md
Last active March 21, 2020 19:59
Elementary OS Setup (Loki)

Post-installation Elementary OS Setup and Tweaks

  • System Settings -> Mouse & Touchpad -> Touchpad -> Tap to click -> (Toggle on)
  • Connect to additional WiFi access points

Apply Updates:

sudo apt-get update
sudo apt-get upgrade

Install Dev Tools:

@hugs
hugs / harry-potter-hedwigs-theme.js
Created June 21, 2019 01:30
Tapster Sidekick Demo - Hedwig's Theme - Garage Band app
notes = {
'C': [54,130],
'D': [44,130],
'E': [34,130],
'F': [24,130],
'G': [16,130],
'A': [6,130],
'B': [-3,130],
'c': [-13,130],
'd': [-23,130],
@hugs
hugs / terminator-vision.py
Created August 13, 2013 22:39
OpenCV to find the bird in Angry Birds
#!/opt/local/bin/python2.7
import cv
import subprocess
import time
# Template to find
template_file = cv.CaptureFromFile('redbird.png')
template = cv.QueryFrame(template_file)
@hugs
hugs / Upload-file-to-s3-with-boto.py
Created May 17, 2009 19:41
Use the boto library to upload a file to S3
import boto
BUCKET = 'my-awesome-unique-bucket'
filepath = '/path/to/file/filename.zip'
conn = boto.connect_s3()
bucket = conn.lookup(BUCKET)
key = boto.s3.Key(bucket)
key.name = 'filename.zip'
key.set_contents_from_filename(filepath)
@hugs
hugs / sync-is-great-for-testing.js
Last active October 4, 2018 05:56
A simple Node.js script that uses synchronous APIs for automated testing with Selenium WebDriver. Yes, I said "synchronous". Deal with it -- 'cause it's awesome.
var WebDriver = require('webdriver-http-sync');
var sleep = require('teddybear');
driver = new WebDriver('http://localhost:4444/wd/hub', {browserName:"firefox"});
// Look, no callbacks!
driver.navigateTo('http://pinthing.com');
// Oh my, I need a break. I can't handle the awesome.
sleep(5000);
@hugs
hugs / tapster-appium-calibration.txt
Last active July 17, 2018 23:00
Use Tapster with Appium
----
UPDATE: 5 September 2016: These instructions no longer work with the latest version of Appium. :(
If you would like assistance, please email hello@tapster.io.
----
Pre-req:
a) Git clone the "robots" project from appium
https://github.com/appium/robots
@hugs
hugs / center-ios-simulator.script
Created April 4, 2012 01:20
Center the iOS Simulator's window on your screen
-- Center the iOS Simulator's window on your screen
--
-- Copyright (C) 2012 Sauce Labs Inc
--
-- This work is licensed under the Creative Commons Attribution 3.0 Unported License.
-- To view a copy of this license, visit http://creativecommons.org/licenses/by/3.0/
-- or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.
--
-- Usage:
-- $ osascript center-ios-simulator.script <scale>
@hugs
hugs / Killing popup dialogs in Firefox
Created January 12, 2010 06:19
Killing popup dialogs in Firefox
// 1) Install Firebug
// 2) In a new browser window, open this URL:
// chrome://global/content/commonDialog.xul
// (It doesn't matter the particular .xul file you open, as long as it is a valid XUL file.)
// 3) Launch JavaScript Shell in Firebug
// 4) In the new shell window, type the following commands:
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator);