Skip to content

Instantly share code, notes, and snippets.

Avatar
✌️
always

Ashley ablwr

✌️
always
View GitHub Profile
@wcaleb
wcaleb / wayback.py
Last active Jan 16, 2021
Pandoc filter to replace Link URLs with Wayback Machine URLs
View wayback.py
#!/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
@matthewmcvickar
matthewmcvickar / .bash_prompt
Last active May 11, 2020
Get the current phase of the moon and use it to print an emoji moon phase image. OS X only, requires some shell knowledge. (Emoji moon phases will not show up here, but they will when you copy and paste or download the file.)
View .bash_prompt
# 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