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
@abachman
abachman / color.coffee
Created September 13, 2012 18:11
color modifications in coffeescript
# rgb <-> hsl algorithms from
# http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript
Colors =
#
# Converts an RGB color value to HSL. Conversion formula
# adapted from http://en.wikipedia.org/wiki/HSL_color_space.
# Assumes r, g, and b are contained in the set [0, 255] and
# returns h, s, and l in the set [0, 1].
#
@abachman
abachman / README.md
Last active January 26, 2024 17:26
git rebase --onto

I HAVE:

main     -- A -- B
                  \
staging            C -- D
                         \
feature                   E  
@abachman
abachman / dragon_curve.pde
Created April 6, 2012 12:04
The Dragon Curve
// pure processing version
/*
The dragon curve drawn using an L-system.
variables : X Y
constants : F + −
start : FX
rules : (X → X+YF+), (Y → -FX-Y)
angle : 90°
Here, F means "draw forward", - means "turn left 90°", and + means "turn
@abachman
abachman / 01_force_transaction_error.rb
Last active December 15, 2023 22:12
Google Cloud Spanner Emulator transaction hangup
# frozen_string_literal: true
##
# Force a stale-open transaction on the Spanner Emulator by running this script
# and then killing it with Ctrl-C.
#
# Rerunning the script will result in a hung process followed by the "one
# transaction at a time" error.
##
require_relative "emulator_util"
@abachman
abachman / .gitignore
Last active November 25, 2023 03:22
Rails vs Dates
Gemfile.lock
test.db*
# proxying through apache to a local rails instance, http & https
# apache *.conf file
<VirtualHost *:80>
ServerName psl.localhost
ServerAlias cms.psl.localhost
ServerAlias *.psl.localhost
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/
@abachman
abachman / tiltpixel.py
Created November 7, 2018 01:51
CircuitPython Trellis M4 pixel tilt drawing demo
# Tiny slow gravitational etch-a-sketch. Press a button to reset.
# using https://github.com/adafruit/Adafruit_CircuitPython_TrellisM4
# and https://www.adafruit.com/product/4020
import time
import board
import busio
import adafruit_adxl34x
import adafruit_trellism4
@abachman
abachman / python-io-image-client.py
Created July 3, 2019 15:56
Publishing Raspberry Pi image data to Adafruit IO from Python
#!/usr/bin/env python
# based on https://github.com/adafruit/io-client-python/blob/master/examples/mqtt_client.py
import io
import time
import os
# Camera setup guide: https://learn.adafruit.com/cloud-cam-connected-raspberry-pi-security-camera/pi-camera-setup
import picamera
import base64
@abachman
abachman / adafruit-io-data-OBS-browser-source.html
Created April 26, 2020 18:18
Locally hosted OBS Browser Source html file pulling temp + humidity from my little office weather station
<!DOCTYPE html>
<html>
<head>
<!-- Fontawesome 5! Get it here: https://fontawesome.com/how-to-use/on-the-web/setup/hosting-font-awesome-yourself -->
<link rel="stylesheet" href="css/all.min.css" />
<style>
body {
background: rgba(0, 0, 0);
color: #ffffff;
font-size: 16px;
@abachman
abachman / 000-README.md
Last active November 5, 2022 10:49
FONA 808 + Hologram + Adafruit.io MQTT