Skip to content

Instantly share code, notes, and snippets.

View ablwr's full-sized avatar
✌️
always

Ashley Blewer ablwr

✌️
always
View GitHub Profile
@matthewmcvickar
matthewmcvickar / .bash_prompt
Last active December 20, 2022 22:59
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.)
# 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
@wcaleb
wcaleb / wayback.py
Last active January 16, 2021 22:55
Pandoc filter to replace Link URLs with Wayback Machine URLs
#!/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