Skip to content

Instantly share code, notes, and snippets.

View pje's full-sized avatar
🦥

Patrick Ellis pje

🦥
  • Brooklyn
  • 11:55 (UTC -04:00)
View GitHub Profile
@pje
pje / keybase.md
Created September 28, 2016 15:33

Keybase proof

I hereby claim:

  • I am pje on github.
  • I am pje (https://keybase.io/pje) on keybase.
  • I have a public key whose fingerprint is 7FB1 9E38 88B0 6198 CE20 FDD3 B16F 572E 40D2 390A

To claim this, I am signing this object:

@pje
pje / ack_tracks_js.scpt
Last active March 12, 2017 20:54
itunes script to rename selected tracks' artist, title, and number using an arbitrary shell command given the track name through stdin
var app = Application.currentApplication();
var itunes = new Application('iTunes');
var selection;
app.includeStandardAdditions = true;
itunes.includeStandardAdditions = true;
var artistNameDialog = {
text: "function for artist name? echo \"$track_name\" | $this_command",
default: "/usr/local/bin/ack '^(\\d+) (.*) *- *(.*)$' --output '$2'"
@pje
pje / 2017.md
Last active May 26, 2022 21:51
2017: an unordered list of my favorite albums of the year
@pje
pje / partial_object.rb
Created April 11, 2018 00:11
Mocha matcher to recursively match nested data structures
require 'mocha/parameter_matchers/base'
module Mocha
module ParameterMatchers
# @example
# partial = {
# a: [ 1, 2 ],
# b: {
# hello: {
# world: [ 'foo' ]
@pje
pje / 2018.md
Last active May 26, 2022 21:51
2018: an unordered list of my favorite albums of the year
@pje
pje / either.rb
Created May 2, 2018 19:21
Simple implementation of the Either type for Ruby (except Left is called Failure and Right is Success)
class Either
attr_reader :value, :error
def initialize(_) ; raise(NotImplementedError.new) ; end
def failure? ; is_a?(Failure) ; end
def success? ; is_a?(Success) ; end
def get_or_else(_) ; raise(NotImplementedError.new) ; end
def map ; raise(NotImplementedError.new) ; end
def ==(other)
@pje
pje / Advent of Code 2018
Last active December 17, 2018 04:53
advent of code 2018
We couldn’t find that file to show.
@pje
pje / 2019.md
Last active May 26, 2022 21:51
2019: an unordered list of my favorite albums of the year
@pje
pje / 2020.md
Last active July 25, 2023 21:49
2020: an unordered list of my favorite albums of the year
@pje
pje / 2021.md
Last active September 1, 2023 16:11
2021: an unordered list of my favorite albums of the year