Skip to content

Instantly share code, notes, and snippets.

View paulsmith's full-sized avatar
😀
Hi, friends

Paul Smith paulsmith

😀
Hi, friends
View GitHub Profile
@paulsmith
paulsmith / day3part2.go
Created December 5, 2017 21:06
AOC 2017 day 3 part 2
package main
import (
"fmt"
"os"
)
type grid map[complex128]int
func (g grid) neighbors(pos complex128) int {
@paulsmith
paulsmith / jazz.md
Last active September 11, 2017 21:50
jazz for raph
  • The Necks - long, deeply improvisational "drone" jazz from Australia, start with "Hanging Gardens"
  • John Zorn & Masada - klezmer-influenced, razor-sharp virtuosic sax
  • Miles Davis - later electric period, "On the Corner", "Bitches Brew", also "In a Silent Way" one of my absolute faves
  • Ellington, Roach, Mingus - "Money Jungle", a one-off, so aging Duke could play around with a post-bop trio
  • Andrew Hill - Monk-esque pianist/composer, check out "Point of Departure"
  • John Coltrane - "My Favorite Things", "Giant Steps", and "A Love Supreme", all in the pantheon
  • Steve Reid - "Nova": hard to find but wicked
  • Bill Evans - sublime pianist, anything from him
  • Michael Naura Quartet - vibraphones, "Call": one of my absolute all-time favorite records
  • Don Cherry - trumpeter, "Brown Rice"
@paulsmith
paulsmith / numeronym.el
Created July 12, 2017 15:31
numeronym minor mode
(defun pas-numeronym ()
"Replace last word with its numeronym. eg.: 'accessibility' with 'a11y'."
(interactive)
(save-excursion
(backward-word)
(let ((count 0) (the-word (current-word)))
(while (looking-at "[a-zA-Z']")
(setq count (1+ count))
(forward-char 1))
(if (>= count 4)
@paulsmith
paulsmith / make-precommit.log
Last active January 6, 2017 19:03
Running `make precommit` on commit 335c7b6863046ecd92bb1e4c384b23e13adf0403
************* Module grumpy.compiler.block
compiler/block.py:443: Unused argument 'unused_node' (unused-argument)
************* Module grumpy.compiler.block_test
compiler/block_test.py:81: Using deprecated method assertRegexpMatches() (deprecated-method)
compiler/block_test.py:83: Using deprecated method assertRegexpMatches() (deprecated-method)
compiler/block_test.py:85: Using deprecated method assertRegexpMatches() (deprecated-method)
compiler/block_test.py:87: Using deprecated method assertRegexpMatches() (deprecated-method)
compiler/block_test.py:89: Using deprecated method assertRegexpMatches() (deprecated-method)
compiler/block_test.py:91: Using deprecated method assertRegexpMatches() (deprecated-method)
compiler/block_test.py:93: Using deprecated method assertRegexpMatches() (deprecated-method)
@paulsmith
paulsmith / README
Last active December 2, 2016 04:58
day 1 of 2016 advent of code solution, parts 1 & 2
for http://adventofcode.com/2016/day/1
$ # copy day 1 puzzle input to file
$ make day1
$ ./day1 < day1.input
# part 1 output
$ touch day1.c && make CFLAGS=-DPART2 day1
$ ./day1 < day1.input
# part 2 output
@paulsmith
paulsmith / wopr-scenarios.txt
Created September 29, 2016 18:35
WOPR nuclear war scenarios
U.S. FIRST STRIKE
USSR FIRST STRIKE
NATO / WARSAW PACT
FAR EAST STRATEGY
US USSR ESCALATION
MIDDLE EAST WAR
USSR CHINA ATTACK
INDIA PAKISTAN WAR
MEDITERRANEAN WAR
HONGKONG VARIANT
@paulsmith
paulsmith / tcpproxy.go
Created May 10, 2016 17:18
simple TCP forwarder, go run tcpproxy.go
package main
import (
"flag"
"io"
"log"
"net"
)
func main() {
@paulsmith
paulsmith / keyboards.md
Last active March 18, 2016 16:36
I'm frustrated about keyboards

I'm frustrated about keyboards dot text

I've yet to find a keyboard with which I'm really happy. Going back a few years, I started with a generic Model M-like tank of a keyboard, with buckling spring keys. I eventually became unsatisfied with the typing noise (it was distracting to me and my office-mate) and its sheer size. A large part of the footprint of the keyboard was its plastic border, which served no function. It also wasted space with its numeric keypad, which I never used. The problem with keyboard footprint is, while I try to keep my hands on the keyboard as much as possible, when I reach for the mouse or trackpad I don't want to swing my hand and arm too far to the right -- too slow, too much of a context switch, and too painful in the long run. Having to move past a numeric keypad was a pain.

Speaking of pain, I also worried about the position of my hands, so for my next keyboard I bought an ergonomic wireless model by Microsoft. It solved the footprint problem by having the numeric

@paulsmith
paulsmith / keyboards.md
Created February 10, 2016 17:48
I'm frustrated about keyboards

I'm frustrated about keyboards dot text

When I'm working at my desk, I put my laptop on a stand and hook it up to an external monitor and a USB hub with a keyboard and mouse

@paulsmith
paulsmith / assert.go
Last active August 29, 2015 14:26
assert in Go
package main
import (
"fmt"
"os"
"runtime"
)
func main() {
foo(0)