Skip to content

Instantly share code, notes, and snippets.

View pje's full-sized avatar
:octocat:

Patrick Ellis pje

:octocat:
  • Brooklyn
  • 07:13 (UTC -04:00)
View GitHub Profile
@pje
pje / 2024.md
Last active April 18, 2024 16:12
An unordered list of my favorite albums of the year
@pje
pje / 2023.md
Last active February 29, 2024 16:14
2023: an unordered list of my favorite albums of the year
@pje
pje / list.go
Created June 23, 2022 21:39
A simple golang implementation of a doubly-linked list that supports generics.
// A generic doubly-linked list
package list
// the zero value is ready to use.
type List[T any] struct {
root Element[T]
Len int
}
@pje
pje / 2022.md
Last active September 1, 2023 16:01
2022: 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
@pje
pje / 2020.md
Last active July 25, 2023 21:49
2020: an unordered list of my favorite albums of the year
@pje
pje / 2019.md
Last active May 26, 2022 21:51
2019: an unordered list of my favorite albums of the year
@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 / 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 / 2018.md
Last active May 26, 2022 21:51
2018: an unordered list of my favorite albums of the year