Skip to content

Instantly share code, notes, and snippets.

View stilldavid's full-sized avatar
💽
minidisc'in

David Stillman stilldavid

💽
minidisc'in
View GitHub Profile
@stilldavid
stilldavid / HttpProxy.go
Created December 19, 2022 19:43 — forked from yowu/HttpProxy.go
A simple HTTP proxy by Golang
package main
import (
"flag"
"io"
"log"
"net"
"net/http"
"strings"
)
_ _
__ _| |_ __ _ __ _ (_)___
/ _` | __/ _` |/ _` | | / __|
| (_| | || (_| | (_| |_ | \__ \
\__, |\__\__,_|\__, (_)/ |___/
|___/ |___/ |__/
js?id=UA-38312895-1:80 Processing commands (0)
js?id=UA-38312895-1:80 Processing commands (1)
@stilldavid
stilldavid / oct-27-class.md
Last active November 15, 2017 14:45
Class notes from the October 28th Arduino class

Arduino Class 10/28

Thanks for attending the Arduino class!

You might be wondering what the little circuit board your child brought home is and what it's good for. The board is called an Arduino and it's a programmable microcontroller, which is just a fancy way of saying it's a little computer.

During class we all programmed them together to take a reading from a light sensor and activate a servo motor if a threshold was reached. In practice, this made for a super simple motion detector to make a head turn or a pumpkin move if it 'sensed' a shadow. The code is written in an Arduino variant of C++ that we uploaded using the Arduino IDE. The entirety of it is as follows:

#include <Servo.h>
-----BEGIN PGP MESSAGE-----
Version: Keybase OpenPGP v2.0.1
Comment: https://keybase.io/crypto
wcFMA7AC4f3uc32DAQ/+KWcGlgJij9Z/+0HoRQoexaIUNI3q37JuyOR3RNwvfhEC
aiEOsUiSuDu8OFOPDL7yuNi0XEall/p74zOs6szu5vIljAH/79S1SEm4OKYXHZD9
JTRXIplQwjQpftquS4oU16MSPlr5UZT6ftFcNkoELq7g6LKCi/xdQILX6lfOgmuy
Eg4RLE8xHqrbgvaxSGUlUCJPX5DQc4A+u+RO4xcuaWGuhK/oUUBGcJw5avmoOIJZ
Uq3NiUsVfU2Bvqg5c9wEvmOUxDJ8sDjclq0B9zsmAzt7K9ztHWRhyWB18dqqcKxF
mGIowsf35glg4LG/s9Ju+Kxrqg5Tp1v5r9L8PSsGIHBPav3Lg75SJLKnjUZ1DQTT
### Keybase proof
I hereby claim:
* I am stilldavid on github.
* I am stilldavid (https://keybase.io/stilldavid) on keybase.
* I have a public key whose fingerprint is 15CD 63B9 1F56 FA32 CA86 1B7B 4511 E02D 3D45 4E5A
To claim this, I am signing this object:
@stilldavid
stilldavid / gist:1602315
Created January 12, 2012 18:46
Free Day Winners

1442 United States
108 Canada
41 United Kingdom
34 Spain
29 Netherlands
25 Sweden
25 Germany
20 Turkey
18 France
17 Italy

@stilldavid
stilldavid / freeday.ino
Created January 12, 2012 17:08
Free Day Geiger Counter
#include <Ethernet.h>
#include <SFEbarGraph.h>
#include <SPI.h>
// Default 'ino MAC address
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192, 168, 0, 2 };
int up = 8;
int down = 7;
// GPS
bool feedgps() {
gps_serial.println("$PUBX,00*33"); //Poll GPS
while (gps_serial.available()) {
if (gps.encode(gps_serial.read()))
return true;
}
return false;
}
{"type":"flight","name":"KI6YMZ-3","start":1318982400,"end":1318982400,"launch":{"time":1319036400,"timezone":"UTC-6"},"metadata":{"location":"Deer Trail, CO","project":"KI6YMZ-3"},"payloads":{"KI6YMZ":{"radio":{"frequency":"434.650","mode":"USB"},"telemetry":{"modulation":"rtty","shift":"425","encoding":"ascii-8","baud":"50","parity":"none","stop":"1"},"sentence":{"protocol":"UKHAS","checksum":"crc16-ccitt","payload":"KI6YMZ","fields":[{"name":"count","sensor":"base.ascii_int"},{"name":"time","sensor":"stdtelem.time"},{"name":"latitude","sensor":"stdtelem.coordinate","format":"dd.dddd"},{"name":"longitude","sensor":"stdtelem.coordinate","format":"dd.dddd"},{"name":"altitude","sensor":"base.ascii_int"},{"name":"speed_kph","sensor":"base.ascii_int"},{"name":"course","sensor":"base.ascii_int"},{"name":"temperature","sensor":"base.ascii_float"}]}}}}
#include <Ethernet.h>
#include <SPI.h>
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192, 168, 20, 239 };
byte server[] = { 10, 10, 10, 2 }; // Google
Client client(server, 8001);
void setup()