Skip to content

Instantly share code, notes, and snippets.

View alanzchen's full-sized avatar

Alan Chen alanzchen

View GitHub Profile
#
# Worksheet A
#
# This worksheet is also a Python program. Your task is to read the
# task descriptions below and then write one or more Python statements to
# carry out the tasks. There's a Python "print" statement before each
# task that will display the expected output for that task; you can use
# this to ensure that your statements are correct.
#
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alanzchen
alanzchen / nicehash.30s.py
Created January 17, 2018 08:53
A Nicehash worker monitor plugin for BitBar.
#!/usr/bin/python
# coding=utf-8
"""
# <bitbar.title>Nicehash Stats</bitbar.title>
# <bitbar.version>v1</bitbar.version>
# <bitbar.author>alan</bitbar.author>
# <bitbar.author.github>alanzchen</bitbar.author.github>
# <bitbar.desc>
# Displays current Nicehash Worker Stats
# </bitbar.desc>
@alanzchen
alanzchen / ChiMerge.ipynb
Last active April 17, 2024 17:29
ChiMerge implementation in Python 3.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/python
# coding=utf-8
"""
# <bitbar.title>Next Train Home</bitbar.title>
# <bitbar.version>v1</bitbar.version>
# <bitbar.author>alan</bitbar.author>
# <bitbar.author.github>alanzchen</bitbar.author.github>
# <bitbar.desc>
# The next train home.
# </bitbar.desc>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alanzchen
alanzchen / lastfm.120s.py
Created July 7, 2019 19:32
Last.fm user feed to Apple Music
#!/usr/local/bin/python3
# coding=utf-8
"""
# <bitbar.title>Your Music</bitbar.title>
# <bitbar.version>v1</bitbar.version>
# <bitbar.author>alan</bitbar.author>
# <bitbar.author.github>alanzchen</bitbar.author.github>
# <bitbar.desc>
# I love you(r) (music).
# </bitbar.desc>
@alanzchen
alanzchen / NotionURL.patch
Created May 23, 2020 23:27
Patch Notion.so to allow all deep links / url protocols
--- urlHelpers.js 2020-05-23 18:17:11.000000000 -0500
+++ urlHelpersPatch.js 2020-05-23 18:18:42.000000000 -0500
@@ -113,14 +113,7 @@
if (parsed.host && hostBlacklist[parsed.host]) {
return;
}
- if (parsed.protocol === "http:" ||
- parsed.protocol === "https:" ||
- parsed.protocol === "mailto:" ||
- parsed.protocol === "itms-apps:" ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 10.
"year","state","state_po","state_fips","state_cen","state_ic","office","candidate","party","writein","candidatevotes","totalvotes","version","notes"
1976,"Alabama","AL",1,63,41,"US President","Carter, Jimmy","democrat",FALSE,659170,1182850,20171015,NA
1976,"Alabama","AL",1,63,41,"US President","Ford, Gerald","republican",FALSE,504070,1182850,20171015,NA
1976,"Alabama","AL",1,63,41,"US President","Maddox, Lester","american independent party",FALSE,9198,1182850,20171015,NA
1976,"Alabama","AL",1,63,41,"US President","Bubar, Benjamin """"Ben""""","prohibition",FALSE,6669,1182850,20171015,NA
1976,"Alabama","AL",1,63,41,"US President","Hall, Gus","communist party use",FALSE,1954,1182850,20171015,NA
1976,"Alabama","AL",1,63,41,"US President","Macbride, Roger","libertarian",FALSE,1481,1182850,20171015,NA
1976,"Alabama","AL",1,63,41,"US President","","",TRUE,308,1182850,20171015,NA
1976,"Alaska","AK",2,94,81,"US President","Ford, Gerald","republican",FALSE,71555,123574,20171015,NA
1976,"Alaska","AK",2,94,81,"US Presid