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 / ik.py
Created December 7, 2012 06:46
Delta robot - Inverse and forward kinematics library - (For @bitbeam bot)
# Original code from
# http://forums.trossenrobotics.com/tutorials/introduction-129/delta-robot-kinematics-3276/
# License: MIT
import math
# Specific geometry for bitbeambot:
# http://flic.kr/p/cYaQah
e = 26.0
f = 69.0
@hugs
hugs / 1_tapster_camera_setting_test.py
Last active June 15, 2023 20:14
Tapster 3 - Camera Setting Test.py
import os
import cv2
import time
# Set image resolution
# Option 1
#frame_width = 4656
#frame_height = 3496
@hugs
hugs / focus-test.py
Last active June 15, 2023 02:59
Test for disabling autofocus on an Arducam 16MP camera.
import cv2
cap = cv2.VideoCapture(0)
# You *must* grab at least frame before focus settings take effect.
# Try commenting and uncommenting the following line to test it
grabbed, frame = cap.read()
cap.set(cv2.CAP_PROP_AUTOFOCUS, 0)
cap.set(cv2.CAP_PROP_FOCUS, 460)
@hugs
hugs / Tapster-3-Demo.md
Last active June 8, 2023 14:36
Tapster 3 - Demo Script - Tap "Hello, World!!"
@hugs
hugs / webserver.nim
Last active June 8, 2023 13:25
Minimal Viable Web Server in Nim
# Minimal Viable Web Server for Nim
# 1) Install Nim:
# https://nim-lang.org/install.html
# 2) To run, enter this in a terminal window:
# nim c -r webserver.nim
# 3) Press Control-C to quit / stop the server.
@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 / the_day_i_will_die.py
Created July 3, 2009 18:53
Inspired by Kevin Kelly's "My Life Countdown" - in Python
# Inspired by: http://kk.org/ct2/2007/09/my-life-countdown-1.php
# Life expectancy data:
# http://www.health.state.ny.us/health_care/medicaid/publications/docs/adm/06adm-5att8.pdf
$ python
>>> from datetime import date, timedelta
>>> birth_year = 1976
>>> birth_date = date(1976,3,2)
>>> life_expectancy = 76.09
@hugs
hugs / hugs-tweets.html
Created September 7, 2012 21:50
Tweets for @hugs
This file has been truncated, but you can view the full file.
<html><title>Tweets for hugs</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<body><small>
2012-09-07 18:34 <a href="http://twitter.com/hugs/status/244141545522077696">@TourDeDave I'll dig up some docs that you might find helpful...</a><br/>
2012-09-07 17:29 <a href="http://twitter.com/hugs/status/244125335250145280">@TourDeDave Build your own? Yes! Get an Arduino, some bright LEDs, and start having fun.</a><br/>
2012-09-07 15:49 <a href="http://twitter.com/hugs/status/244100106301890560">Them: "Did this document help you?" Me: "Not at all. But thanks for asking." http://t.co/uTb1dxX9</a><br/>
2012-09-06 04:35 <a href="http://twitter.com/hugs/status/243568066422767616">@shapeoko Love you, too, man. But it gets better... have you ever been to @bluebottleroast in SF? http://t.co/hQIP6ELl</a><br/>
2012-09-06 04:16 <a href="http://twitter.com/hugs/status/243563252989177856">@shapeoko http://t.co/BE0oVoYw</a><br/>
@hugs
hugs / arducam16.mjs
Created December 7, 2022 21:26
arducam16.mjs
// https://github.com/qweasd1/node-uvc-control (npm uvc-control2)
// Example
// import { Control } from './arducam16.mjs'
// var control = new Control({width: this.config.width, height: this.config.height})
// control.init()
import UVCControl from 'uvc-control2'
const defaults = {
@hugs
hugs / LICENSE.txt
Last active May 10, 2022 09:48
The most ridiculously awesome way to sleep synchronously in Node.js
http://creativecommons.org/publicdomain/zero/1.0/
CC0 1.0 Universal (CC0 1.0)
Public Domain Dedication
To the extent possible under law, Jason Huggins has waived all copyright and related or neighboring rights to sleep-example.js and sleep-server.js.
This work is published from: United States.