Skip to content

Instantly share code, notes, and snippets.

View schuyler's full-sized avatar

Schuyler Erle schuyler

View GitHub Profile
@schuyler
schuyler / brooklyn_bridge_photo.md
Last active September 26, 2022 17:14
When was this photo of the Brooklyn Bridge taken?

Around 2010 or so, I bought a print of this photo in a frame at either Target or Ikea, I can't recall which, because it made me nostalgic for New York City, which I had just left.

an image of the Brooklyn Bridge with the full moon setting behind it

After spending about a year with this print on my wall, I realized that the orientation of bridge and moon in the original photo could probably be used to work out when the photo was taken.

My first estimate was that photo was taken from Emily Warren Roebling Plaza in Empire Fulton Ferry State Park just to the north of the southeast pier of the Brooklyn Bridge. The coordinates are roughly 40.70427ºN, 73.99420ºW.

@schuyler
schuyler / survivor.pl
Last active September 14, 2020 15:21
Prolog script to choose teams for single-elimination "survivor" pools
% ?- schedule(W), pick(W, T).
%
% pick(season, league) picks favorites for each week in the season, selecting
% each team no more than once.
pick([], []).
pick([Week|Rest_of_Season], [Team|Rest_of_League]) :-
faves(Week, Faves),
is_in(Team, Faves),
pick(Rest_of_Season, Rest_of_League),
@schuyler
schuyler / total_solar_eclipses.md
Last active December 4, 2021 05:39
Total Solar Eclipses

Selected total solar eclipses through 2045

These eclipses were chosen by virtue of the possibility of viewing totality from somewhere on a continental landmass in the temperate or tropical latitudes.

  • 2020 Dec 14 - Chile, Argentina (canceled due to COVID-19)
  • 2023 Apr 20 - Hybrid eclipse, possible totality in Indonesia, or western Australia (1m 15s max)
  • 2023 Oct 14 - An annular eclipse visible from the western United States, not unlike the annular eclipse of 2012.
  • 2024 Apr 08 - The Great American Eclipse of 2024. Best seen from northern Mexico or southwestern Texas. (4m 28s max)
@schuyler
schuyler / enp0s21f0u1
Last active July 10, 2019 19:24
Debian network interface configuration for USB tether
# Debian network interface configuration for USB tether
# /etc/network/interfaces.d/enp0s21f0u1
allow-hotplug enp0s21f0u1
iface enp0s21f0u1 inet dhcp
description usb-tether
post-up /usr/local/sbin/firewall.sh
@schuyler
schuyler / firewall.sh
Last active July 10, 2019 18:19
basic Linux firewall
#!/bin/sh
# based on https://debian-administration.org/article/23/Setting_up_a_simple_Debian_gateway
LAN=wlp2s0
ISP=enp0s21f0u1
# Exit if any command fails.
set -e
PATH=/usr/sbin:/sbin:/bin:/usr/bin
-----BEGIN PGP MESSAGE-----
Comment: https://keybase.io/download
Version: Keybase Go 1.0.18 (darwin)
wcFMA3zq9wQpBChYARAApgeaFHC3nbwIZFUkb6OMTQqQkvAnDGS9atKGO3RNH8+N
EI3g3lsQitNbHG+hUv2vCvOPz6Q1pjfD+wzTbYnAPgNWNZMGkVoB7MgZIpo0g4+3
gIYcCEepoe7LgoBMlh0X9CjWZEO/DpqGxx/kfX5EsCUmF4b+A/JS326E5UCA8Djz
QTxoSpxbYFDIyaCUh5kJGgaOP77WPewEnYBkGAfovFgFdk+A5DCAbe+BalMs8hw1
Zu6szJGBv9bXDy3iAXmX1sqse3uCq4uwGxk/rOWEwTYmb8nb7bfqCXC9y0MZpJBx
O73gVn3RE7vbTwaQdfEoW4NwuUoP0pYkGk1aVx1REROov5vPz18oXZ7lMpONW80V
@schuyler
schuyler / keybase.md
Created January 30, 2017 22:59
Keybase proof

Keybase proof

I hereby claim:

  • I am schuyler on github.
  • I am schuyler (https://keybase.io/schuyler) on keybase.
  • I have a public key ASAmCjm9owN2COQyzkyFqy6HTyJr44Mu-26Ki_RjaF4b1Ao

To claim this, I am signing this object:

@schuyler
schuyler / feature.sh
Created May 13, 2013 19:36
simple Git workflow script
# Workflow:
#
# 1. feature start 000-new-feature
# 2. git commit -m "here's my new feature"
# 3. feature update
# 4. git commit -m "here's some tests"
# 5. feature diff
# 6. feature finish 000-new-feature
# 7. git push origin master
@schuyler
schuyler / rack_test.rb
Last active December 15, 2015 05:39
Rack::Test doesn't pass a request body for GET requests?
if env["REQUEST_METHOD"] == "GET"
# merge :params with the query string
if params = env[:params]
params = parse_nested_query(params) if params.is_a?(String)
params.update(parse_nested_query(uri.query))
uri.query = build_nested_query(params)
end
@schuyler
schuyler / .bash_profile
Last active December 14, 2015 20:49
my .bashrc
source .bashrc
if [ `hostname -s` != $MY_LAPTOP ]; then
# reattach or start a new screen. don't make it a login shell.
screen -xRR -ln
fi