Skip to content

Instantly share code, notes, and snippets.

@samestep
samestep / .dsl
Created May 5, 2022 14:47
untitled: a trio from https://penrose.ink
type Axes
type Function
predicate On(Function, Axes)
@samestep
samestep / list_classes.py
Created January 15, 2021 20:58
set of CircleCI resource classes
#!/usr/bin/env python3
import re
from pathlib import Path
import yaml
def all_resource_classes(thing):
if isinstance(thing, list):
@samestep
samestep / palindrome_dates.py
Created September 10, 2019 00:26
ISO 8601 palindrome dates with 4-digit years
import calendar
for year in range(10000):
year_string = '{:04d}'.format(year)
month_day = year_string[::-1]
month = int(month_day[0:2])
day = int(month_day[2:])
if 1 <= month <= 12:
weekday, days_in_month = calendar.monthrange(year, month)
if 1 <= day <= days_in_month:
@samestep
samestep / 73.py
Created July 18, 2019 17:05
GEB page 73 sequence
from bisect import bisect_right
positive = []
negative = []
# https://docs.python.org/3.7/library/bisect.html
def find_gt(a, x):
'Find leftmost value greater than x'
i = bisect_right(a, x)
if i != len(a):
@samestep
samestep / 95.pdf
Last active August 23, 2017 13:50
Number 95
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.