Skip to content

Instantly share code, notes, and snippets.

View robhanlon22's full-sized avatar

Rob Hanlon robhanlon22

View GitHub Profile
@robhanlon22
robhanlon22 / 808_clap_chatgpt.bash
Created March 17, 2023 03:42
ChatGPT-generated bash script that generates an 808 clap from scratch
#!/bin/bash
duration=0.1
decay=0.3
volume=0.6
dd if=/dev/urandom bs=1 count=$((44100*duration)) 2>/dev/null | \
od -An -vtx1 | \
tr ' ' '\n' | \
while read hex; do
byte=$(printf "%d" "0x$hex")
@robhanlon22
robhanlon22 / day6.sh
Last active December 7, 2022 01:40
day6.sh
#!/usr/bin/env bash
s="$(< /dev/stdin)"
n="$1"
for (( i = 0; i < ${#s} - n; i++ )); do
unset m
declare -A m
for (( j = 0; j < n; j++ )); do
@robhanlon22
robhanlon22 / aoc2022_day6.clj
Last active December 6, 2022 17:40
aoc2022_day6.clj
(defn check
[n coll]
(loop [i 0
v coll]
(let [x (take n v)]
(cond
(< (count x) n)
nil
(= (count (set x)) n)
@robhanlon22
robhanlon22 / king county election results
Last active August 1, 2017 18:54
king county election results scraper
this just scrapes KING5's election "Hot Races" results page forever every 60
seconds. do the whole bundle install dance then run ruby election_results.rb. if
you only care about Tacoma races or something, just specify that as an argument,
e.g. ruby election_results.rb Tacoma
Current production and writing projects:
▪ Myself: https://soundcloud.com/robhanlon
▪ Cid & Fancy, a collaboration with Futurewife: https://soundcloud.com/cidandfancy
▪ SGF, electronic pop: http://www.sgf.zone/
I also play synths and sax in Cataldo, a pop band: https://www.cataldomusic.com/
1. Rinse coffee filter with hot water. Rinsing the filter makes it so you don’t lose coffee to saturating the filter paper. It also mitigates some papery taste, I guess, but it’s very minor.
2. Grind 17g of coffee. I use 17g per 300g of water at this point. I try to dial in a grind that is about the consistency of kosher salt. On my grinder, it’s the coarsest setting, but it will be different for yours. Pour the coffee into the dripper.
3. “Bloom” the coffee. Pour 34 grams (2x the grind weight) of 205 degree water over the grounds. Try to saturate all of the coffee. You’ll see the coffee start to foam. This is the coffee releasing CO2. You bloom the grounds in order to release this trapped CO2 in order to make for a more even coffee extraction. Without the bloom, the CO2 will push water away from the grounds and you’ll miss some of the coffee. Wait until the foaming subsides, 30-45 seconds. The fresher the coffee is, the more it will foam. Also, if the coffee is really over-roasted (think Starbucks coffee)
@robhanlon22
robhanlon22 / keybase.md
Created April 12, 2014 02:41
keybase prove github

Keybase proof

I hereby claim:

  • I am ohwillie on github.
  • I am ohwillie (https://keybase.io/ohwillie) on keybase.
  • I have a public key whose fingerprint is E954 1FD2 DCDA 7187 50CA EF89 D071 9237 1A12 F649

To claim this, I am signing this object:

@robhanlon22
robhanlon22 / erin.txt
Created March 24, 2014 18:58
single art
.................................................
.................................................
.................................................
.................................................
.................................................
.................................................
.................................................
...SGSGSGSGSG.SGSGSGSGSG.SGSGSGSGSG.SG......SG...
...SG.........SG......SG.....SG.....SGSG....SG...
require 'json'
require 'hashie'
def _transform(object, *tasks)
[*tasks]
.map { |task| task.respond_to?(:call) ? task : task.first.method(task.last) }
.reduce { |memo, task| ->(*args) { task.(memo.(*args)) } }
.call(object)
end
// node_server.js
var db = requre('./db');
app.get('/getTest', function(request, response) {
var testId = 1;
db.getTest(testId, function (err, data) {
// I don't actually know how to send data using express.
response.pumpThatShitOut(data);
});