Skip to content

Instantly share code, notes, and snippets.

View alchzh's full-sized avatar

Albert Zhang alchzh

View GitHub Profile
@alchzh
alchzh / corner_plot.py
Last active May 25, 2023 13:36
Plotting multiple titles on an axis via monkey-patching (for corner.py)
import matplotlib.pyplot as plt
import matplotlib.transforms as mtransforms
import matplotlib.lines as mlines
import corner
from types import MethodType
# Matplotlib text doesn't support multiple colors, so we need to perform
# some hacks to place text neatly
@alchzh
alchzh / 2946597.csv
Created April 17, 2022 23:15
Potter County daily weather data
We can't make this file beautiful and searchable because it's too large.
"STATION","NAME","LATITUDE","LONGITUDE","ELEVATION","DATE","DAPR","DAPR_ATTRIBUTES","DASF","DASF_ATTRIBUTES","MDPR","MDPR_ATTRIBUTES","MDSF","MDSF_ATTRIBUTES","PRCP","PRCP_ATTRIBUTES","SNOW","SNOW_ATTRIBUTES","SNWD","SNWD_ATTRIBUTES","TMAX","TMAX_ATTRIBUTES","TMIN","TMIN_ATTRIBUTES","TOBS","TOBS_ATTRIBUTES","WDFG","WDFG_ATTRIBUTES","WSFG","WSFG_ATTRIBUTES","WT01","WT01_ATTRIBUTES","WT03","WT03_ATTRIBUTES","WT04","WT04_ATTRIBUTES","WT05","WT05_ATTRIBUTES","WT06","WT06_ATTRIBUTES","WT09","WT09_ATTRIBUTES","WT11","WT11_ATTRIBUTES"
"USC00361806","COUDERSPORT 4 NW, PA US","41.83333","-78.06667","701.3","1980-01-01",,,,,,,,,"0.00",",,0,0700","0.0",",,0","0.0",",,0","37",",,0","26",",,0","32",",,0,1800",,,,,,,,,,,,,,,,,,
"USC00361806","COUDERSPORT 4 NW, PA US","41.83333","-78.06667","701.3","1980-01-02",,,,,,,,,"0.00",",,0,0700","0.0",",,0","0.0",",,0","32",",,0","22",",,0","23",",,0,1800",,,,,,,,,,,,,,,,,,
"USC00361806","COUDERSPORT 4 NW, PA US","41.83333","-78.06667","701.3","1980-01-03",,,,,,,,,"0.00","T,,0,0700"
@alchzh
alchzh / index.html
Last active February 5, 2022 22:51
Redirect
<form name='search' action='https://directory.columbia.edu/people/search' method='post'>
<input id="hello" type="hidden" name="filter.searchTerm">
</form>
<script>
window.onload = function onload() {
document.getElementById("hello").value = decodeURI(window.location.search.substring(1));
document.forms["search"].submit();
}
</script>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alchzh
alchzh / index.html
Created January 6, 2017 21:43
stuff
<html>
<head>
</head>
<body>
<script>
myAudio = new Audio('http://mc.artofproblemsolving.com/sounds/intro.ogg');
myAudio.addEventListener('ended', function() {
this.currentTime = 0;
this.play();
}, false);
@alchzh
alchzh / exo.svg
Last active October 9, 2020 04:43
Made with matplotlib
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alchzh
alchzh / wm.py
Last active August 24, 2016 23:22
WIP GFS WRF forecast
"""
A script to run a WRF forecast for Pennsylvania,
but it can easily be modified for anything else by
changing params and modifying namelist.wps files.
Should be run automatically by cron or equivalent
Requires requests and f90nml modules because I'm lazy
and this is really meant for (my!) personal usage...
Make sure WPS and WRFV3 are all in the directory