This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/python | |
# -*- coding: utf-8 -*- | |
# Usage: pandoc --filter=wayback.py input | |
# Install pandocfilters and requests with pip before using | |
# Warning: may take a while to process input with lots of links | |
# Note: Links that can't be saved to WBM or already point to WBM are left as is | |
from pandocfilters import toJSONFilter, Link | |
import requests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get the current phase of the moon for use as prompt | |
# Adapted from: http://wan.pengganas.net/entry/calculating-phase-of-moon-in-ruby | |
function moonphase() { | |
/usr/bin/env ruby <<-EORUBY | |
# Convert a date to Julian. | |
def julian(year, month, day) | |
a = (14-month)/12 | |
y = year+4800-a | |
m = (12*a)-3+month |