Skip to content

Instantly share code, notes, and snippets.

View abachman's full-sized avatar
🙌
good times

Adam Bachman abachman

🙌
good times
View GitHub Profile
#define WIFI_SSID "your wifi SSID"
#define WIFI_PASS "your wifi password"
// this chunk of code can be copied straight from your IO account
#define IO_USERNAME "your IO username"
#define IO_KEY "your IO key"
@abachman
abachman / Gemfile
Last active November 2, 2017 17:11
MQTT Ruby + Adafruit IO: Feeds and Groups
source 'https://rubygems.org'
gem 'mqtt'
@abachman
abachman / glitch.rb
Created July 6, 2017 16:27
Glitch images in Base64, recombine into video
# take in piped data
f1 = ''
while line = gets
f1 << line.strip
end
# valid Base64 characters, not including A (binary 0)
set = "RizBSj0CTk1DUl2EVm3FWn4GXo5HYp6IZq7Jar8Kbs9Lct+Mdu/NevOfwPgxQhy".chars
# pick a spot and change character, 840 roughly offsets JPG header data
@abachman
abachman / 01 streamer.js
Last active October 15, 2017 06:46
Coming to an understanding with node.js Streams
const Stream = require('stream')
class First extends Stream.Duplex {
constructor(config) {
super({
objectMode: true
});
this.cache = []
}
@abachman
abachman / 000-README.md
Last active February 1, 2018 18:18
Simple Userscripts for the My New Tab Chrome Extension
@abachman
abachman / index.html
Last active June 6, 2017 21:37
Raspberry Pi rolling timelapse setup using basic debian distro + https://www.adafruit.com/product/3099
<!doctype html>
<html>
<head>
<style>
html, body { height: 100%; }
body {
padding: 0;
background: #000;
}
@abachman
abachman / io_setup.h
Created May 24, 2017 15:27
Feather Huzzah + Adafruit IO Music Player
/************************* WiFi Access Point *********************************/
#define WIFI_SSID "wifissid" // can't be longer than 32 characters!
#define WIFI_PASS "wifipass"
#define AIO_SERVER "io.adafruit.com"
#define AIO_SERVERPORT 1883
// find at https://io.adafruit.com/settings
#define IO_USERNAME "your username"
# worker
require 'thread'
queue = Queue.new
threads = []
puts 'create workers'
10.times do |n|
threads << Thread.new(n) do |c|
@abachman
abachman / untztrument-lights.ino
Last active May 13, 2017 01:07
Untztrument Pretty Lights
// Untztrument: https://www.adafruit.com/product/1929
// Arduino 101: https://www.adafruit.com/product/3033
// requires the Adafruit Trellis and Intel Curie (Arduino 101) board support, both available through the Arduino app.
#include <Wire.h>
#include <Adafruit_Trellis.h>
#include <CurieBLE.h>
BLEPeripheral blePeripheral; // BLE Peripheral Device (the board you're programming)
BLEService ledService("19B10000-E8F2-537E-4F6C-D104768A1214"); // BLE LED Service
@abachman
abachman / Gemfile
Last active April 4, 2017 17:04
Publish images to io.adafruit.com
source 'https://rubygems.org'
gem 'mqtt'
# mac only!
gem 'av_capture'
# If you have trouble installing, this is what worked for me:
#
# $ brew install imagemagick@6