Skip to content

Instantly share code, notes, and snippets.

View blech's full-sized avatar

Paul Mison blech

View GitHub Profile
@joeycastillo
joeycastillo / bluemarble.py
Created August 1, 2020 20:12
Display real-time GOES-East imagery on a Waveshare 7-color EPD
# Based on Waveshare's epd5in65f.py demo. Copyright notice at end.
import sys
import os
picdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'pic')
libdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'lib')
if os.path.exists(libdir):
sys.path.append(libdir)
@almccon
almccon / .block
Last active October 26, 2018 17:28
WebGL Earth demo: watercolor
license: mit
@brokaw
brokaw / PrettyJSON.py
Last active February 2, 2024 04:29
A BBEdit text filter to prettify JSON.
#!/usr/bin/env python3
# A text filter for BBEdit. If it encounters a JSON error, it writes an error message
# to stderr (appears in a new BBEdit window) and leaves the original text unaltered.
# c.f. http://crisp.tumblr.com/post/2574967567/json-pretty-print-formatting-in-bbedit
# c.f. http://blog.scottlowe.org/2013/11/11/making-json-output-more-readable-with-bbedit/
import json
import sys
def main():
@veltman
veltman / README.md
Last active December 20, 2018 08:35
Electoral cartograms
#!/usr/bin/env python
import numpy as np
import cv2
from sys import argv
# Gaussian radius (should really be an argument):
r = 21
src, dst = argv[1:]
#!/usr/bin/env zsh
# ./day.sh month_number morning_day evening_day zoom_level
# Strictly alpha: for example, does not know how to handle
# month edges or unscheduled missing images.
set -eu
year=$1
@celoyd
celoyd / hi8-fetch.py
Last active August 8, 2023 05:05
Fetch and untile tiled Himawari-8 images from the http://himawari8.nict.go.jp PNG endpoint
import requests as req
import sys
from dateutil.parser import parse
from PIL import Image
from StringIO import StringIO
# hi8-fetch.py <date> <zoom level> <output>
# E.g.: hi8-fetch.py 2016-01-13T22:10:00 8 2016-01-13T221000-z8.png
# Fetch Himawari-8 full disks at a given zoom level.
# Valid zoom levels seem to be powers of 2, 1..16, and 20.
@TKIPisalegacycipher
TKIPisalegacycipher / DeleteGmusicDupes-Python35.py
Last active June 12, 2020 16:22 — forked from sckzw/README.md
Python script to find and delete duplicate tracks from Google Play Music library.
#!/usr/bin/env python
# created by shuichinet https://gist.github.com/shuichinet
# forked from https://gist.github.com/shuichinet/8159878 21 Nov 2015
# using minor edits by fcrimins https://www.reddit.com/user/fcrimins from https://www.reddit.com/r/google/comments/2xzgyv/remove_duplicate_songs_from_google_play_music/csh6mrh
# also using clever edits by Morgan Gothard https://medium.com/@mgothard
# updated for Python 3.5 by John M. Kuchta https://medium.com/@sebvance 22 Nov 2016 (hey I was busy)
# compiled by John M. Kuchta https://medium.com/@sebvance
# thanks to shuichinet, fcrimins and Mr. Gothard for their work
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zanarmstrong
zanarmstrong / index.html
Last active May 29, 2019 21:02
Which is bigger: Africa or North America?
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="overlay.css">
<link href='http://fonts.googleapis.com/css?family=Raleway:400,700' rel='stylesheet' type='text/css'>
<body>
<div id = "description">
<h2>Is Africa bigger than North America?</h2>
<p><strong>Yes!</strong> In fact, North America, including United States, Canada, Mexico, and Greenland, could easily fit inside Africa with plenty of room left to add Central America, Argentina, Chile, and Bolivia too.</p>
<p>Most of the maps we use day to day distort the relative sizes of countries, making countries near the equator look relatively small and countries near the north and south pole look relatively huge. However, we can compare the true sizes of countries by using a different type of map.</p>
<div><button name="Sweden,Madagascar">Sweden vs Madagascar</button><button name="Australia,Antarctica">Australia vs Antarctica</button><button name="Europe,Brazil">Europe vs Brazil</button><button name="US,Australia">United States vs Australia</b