A curated list of arrrrrrrrr!
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
#!/bin/bash | |
moonphase(){ | |
local lp=2551443 | |
local now=$(date -u +"%s") | |
local newmoon=592500 | |
local phase=$((($now - $newmoon) % $lp)) | |
local phase_number=$((((phase / 86400) + 1)*100000)) | |
# Multiply by 100000 so we can do integer comparison. Go Bash! |
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
#!/bin/bash | |
#get hex codes in form #fff and #ffffff | |
#checks to see if not - especially needed on #fff matches | |
#FIXME: - currently prints trailing character | |
if [[ ! -a $1 ]]; then | |
echo File not found | |
exit 1 | |
fi | |
sed ':a;N;$!ba;s/\n/ /g' "$1" | grep -o '\#[0-9a-fA-F]\{3\}[^0-9a-fA-F]' | sed 's/[^0-9a-fA-F#]//g' | sort -u |
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/bin/env python | |
""" | |
moonphase.py - Calculate Lunar Phase | |
Author: Sean B. Palmer, inamidst.com | |
Cf. http://en.wikipedia.org/wiki/Lunar_phase#Lunar_phase_calculation | |
""" | |
import math, decimal, datetime | |
dec = decimal.Decimal |