Skip to content

Instantly share code, notes, and snippets.

/* Sensor Triggers Servo*/
// Define connection pins:
#define pirPin 2
#define ledPin 13
#include <Servo.h>
Servo myservo; //Create servo object to control a servo
bool motionState = false; // We start with no motion detected.
@whatsim
whatsim / photo_timer.ino
Created June 2, 2022 01:59
arduino sketch for my darkroom enlarger timer
// turn off display
// delay on start time on run
#include <Wire.h>
#include <MD_REncoder.h>
#define ROTARY_PIN1 2
#define ROTARY_PIN2 3
#define RUN_BUTTON_PIN 6
title My Game
author Anonymous
homepage www.puzzlescript.net
========
OBJECTS
========
Background
GREEN
@whatsim
whatsim / README.md
Last active May 17, 2021 19:20
Remove Color Cast on Negatives

Takes an input Tiff of a color negative, and subtracts the film backing color contamination per http://www.dpreview.com/forums/post/499854

Requires Image Magick with libtiff. Easy way to get that on OSX is with homebrew. Just run

brew install --with-libtiff imagemagick

with brew installed. Then you use the script like

./remove_color_cast filename.tif
@whatsim
whatsim / principles.txt
Last active August 29, 2015 14:13
Principles in car UX according to my capricious whims
###Principles in car UX according to my capricious whims.
Don't distract the driver
This should be a obvious. A driver shouldn't spend active brain time to do things like change the channel. It should be reflex, quick and easy.
Don't impede the driver from driving
Bright screen at night time? Long, intricate voice prompts that need active attention? Come on guys.
Be easy to scan for needed info
'Rhetorical' meaningless form should be avoided, weird gradient backgrounds, etc are a hindrance if they make important information harder to find. Typographic hierarchy! Is Channel number the most useful piece of info while you are tuned to a single channel, etc
Be easy for repetitive or frequent tasks
scanning through stations, incrementing volume
@whatsim
whatsim / Databases and App Servers.md
Last active August 29, 2015 14:10
Server Setup 2: more setup.

Welcome to Serverside.

Alright. So we setup a server on the previous installment of Will writes a markdown doc. Today we're gonna setup a database, setup nginx to reverse proxy to a nodejs script, and make a nodejs script for serving pages from that database.

Setup a Database.

So the only new piece of software we'll need is our database. What's a database, I'm gonna let wikipedia handle this one.

A database is an organized collection of data. The data is typically organized to model aspects of reality in a way that supports processes requiring information. For example, modelling the availability of rooms in hotels in a way that supports finding a hotel with vacancies.

@whatsim
whatsim / gist:4e527c3f49525300f386
Last active August 29, 2015 14:09
Server setup

1. Spin up a server.

There's a lot of ways to do this, you can run your own box (I do this with a Beaglebone sitting on my desk), or pay any number of internet people to run it for you (I do this too). Big names in Virtual Private Servers (VPS)

  • Amazon EC2 (Yeah I have one of these.)
  • Linode (Yeah I have one of these too.)
  • Digital Ocean (Uh, yep this one too.)

We're using Digital Ocean, the steps to spin up a server will differ with approach but interacting with it once its up is pretty similar.

@whatsim
whatsim / gist:7426212
Created November 12, 2013 06:02
matrix from points
var sylvester = require('sylvester'), glMatrix = require('gl-matrix');
var points = {
topLeft : sylvester.Vector.create([-3.5530766369047617, 1.3324590773809524, 2.1444642857142853]),
topRight : sylvester.Vector.create([0.15434523809523798, -0.19136904761904774, 0.048714285714285266]),
bottomLeft : sylvester.Vector.create([-2.5932031249999996, 1.403546875, 4.597250000000001])
};
var mat = mapping(82,46,points.topLeft,points.topRight,points.bottomLeft);