Skip to content

Instantly share code, notes, and snippets.

View osteele's full-sized avatar

Oliver Steele osteele

View GitHub Profile
@osteele
osteele / pwm_explorer.ino
Created November 4, 2020 09:25
Use pots to control software PWM on Arduino, graph this on connected laptop
/*
PWM Explorer
Connect pots to pins A0 and A1.
Optionally connect LED to PIN 13 and grond (in series with 220 resistor).
*/
const int buttonPin = 2;
const int ledPin = LED_BUILTIN;
/* A reproduction, with modification, of a work by Vera Molnar.
* Click a square to start it falling.
* Author: Oliver Steele
* Source: https://gist.github.com/osteele/87563fa4daec182a8e8a64ed9946b1da
* This work is licensed under a Creative Commons Attribution 4.0 International License.
*/
final int size = 100;
final int displacement = 6;
FloatList xs = new FloatList();
/* A reproduction, with modification, of a work by Vera Molnar.
* Author: Oliver Steele
* Source: https://gist.github.com/osteele/4da0a93457a254969d9116e97dc16b2f
* This work is licensed under a Creative Commons Attribution 4.0 International License.
*/
final int size = 100;
final int displacement = 6;
void setup() {
size(800, 600);
@osteele
osteele / name-shuffler.pde
Last active October 28, 2020 08:54
Processing sketch to shuffle a list of names
// Name: name-shuffler.pde
// Author: Oliver Steele
// Source: https://gist.github.com/osteele/3351fb073ab0ea4e1568b7d7e9310447
// License: MIT
//
// Instructions:
// Edit a list of names into nameStrings, below.
// Run the program. It presents them shuffled.
// Click to shuffle agin.
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Serial.println("setup");
}
void loop() {
// put your main code here, to run repeatedly:
Serial.println(analogRead(A0));
// Serial.println(100);
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
rect(10, 10, 50, 50);
circle(20, 20, 30);
}
@osteele
osteele / cask
Created September 10, 2019 04:21
An abbreviation for `brew cask`, that doesn't require remembering which of `search` and `install` is `brew` vs. `brew cask`
#!/usr/bin/env bash -eu
# Like `brew cask`, except:
# 1. Shorter
# 2. Doesn't require that I remember which of `search` and `install` is `brew` vs. `brew cask`
if [[ $1 == search ]]; then
brew "$@"
else
brew cask "$@"
@osteele
osteele / chrome-tabs-to-md.sh
Last active July 10, 2019 19:55 — forked from samyk/chrome_tabs.osa
applescript to show all url+titles of Chrome tabs along with front window+tab url+title
#!/usr/bin/env bash
# shows all url+titles of Chrome along with front window+tab url+title
# Source: https://gist.github.com/osteele/704d40f90e17d7bc059d06731056bbe7
# Forked from: https://gist.github.com/samyk/65c12468686707b388ec43710430a421
# Original author: https://gist.github.com/samyk
(osascript << EOF
set titleString to ""
tell application "Google Chrome"
@osteele
osteele / README.md
Created April 24, 2018 12:30
Chris Morgan's bash-for-recording

A script bash-for-recording, for invocation by termrec. This does the following:

  • Set the window size to 80×24
  • Set HOME to a new empty directory
  • Set USER and NAME to dummy values (creating an actual new throwaway user account would be better here)
  • Set TERM to xterm-256color
  • Clear the environment (env -i)
  • Set a deliberately very simple and obvious prompt (which sets the title as well)
Verifying my Blockstack ID is secured with the address 13WDbJK44r4ysJUH4nJUyHBkgGm7tFabNw https://explorer.blockstack.org/address/13WDbJK44r4ysJUH4nJUyHBkgGm7tFabNw