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 runhaskell | |
module FindTax where | |
-- To use this program, change the following two values: | |
-- 1. amounts: This is the list of individual amounts, NOT including tax. | |
amounts :: [Double] | |
amounts = [22.09, 81.89, 16.24] |
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
! Block annoying Substack stuff | |
substack.com,overcomingbias.com,astralcodexten.com,mindthefuture.info,benlandautaylor.com##.subscribe-dialog | |
substack.com,overcomingbias.com,astralcodexten.com,mindthefuture.info,benlandautaylor.com##.subscribe-dialog-scroll-modal-scroll-capture | |
substack.com,overcomingbias.com,astralcodexten.com,mindthefuture.info,benlandautaylor.com##[class*=".frontend-components-SubscribePrompt-module__subscribeDialog--"] | |
substack.com,overcomingbias.com,astralcodexten.com,mindthefuture.info,benlandautaylor.com##[class*=".frontend-components-SubscribePrompt-module__background--"] | |
substack.com,overcomingbias.com,astralcodexten.com,mindthefuture.info,benlandautaylor.com##.post-end-cta-full | |
substack.com,overcomingbias.com,astralcodexten.com,mindthefuture.info,benlandautaylor.com##.show-subscribe.subscription-widget | |
substack.com,overcomingbias.com,astralcodexten.com,mindthefuture.info,benlandautaylor.com##.topbar-content | |
substack.com,overcomingbias.com,astralcodexten.com,mindthefuture.info,benland |
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 python3 | |
import requests | |
query = """ | |
{ | |
posts(input: { | |
terms: { | |
view: "top" | |
limit: 50 |
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 python3 | |
import numpy as np | |
import matplotlib.pyplot as plt | |
buyers = [3.25 - 0.25*n for n in range(0, 11)] | |
sellers = [3.25 - 0.25*n for n in range(0, 11)] | |
price_deltas = [0.01 * x for x in range(0, 1000)] | |
trading_prices = [] |
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
def defined(v): | |
return "v = \"" + v.replace("\\", "\\\\").replace("\"", "\\\"").replace("\n", "\\n") + "\"\n\nprint(v)\n\nprint(defined(v))" | |
v = "def defined(v):\n return \"v = \\\"\" + v.replace(\"\\\\\", \"\\\\\\\\\").replace(\"\\\"\", \"\\\\\\\"\").replace(\"\\n\", \"\\\\n\") + \"\\\"\\n\\nprint(v)\\n\\nprint(defined(v))\"\n" | |
print(v) | |
print(defined(v)) |
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 python3 | |
dominoes = [("ab", "abab"), ("b", "a"), ("aba", "b"), ("aa", "a")] | |
def top_str(state): | |
return "".join(t[0] for t in state) | |
def bottom_str(state): | |
return "".join(t[1] for t in state) |
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 python3 | |
x = 99901 | |
y = 6994 | |
m = 3 | |
x1 = x // (10**m) | |
x0 = x % (10**m) | |
y1 = y // (10**m) | |
y0 = y % (10**m) |
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 python3 | |
# Use like this: | |
# cat file.txt | ./de_italicize.py | |
import sys | |
italic_lowercase_a = '𝘢' | |
italic_uppercase_a = '𝘈' |
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 python3 | |
import matplotlib.pyplot as plt | |
import numpy as np | |
def f(x, j, n): | |
if ((j-1)/(n+1) <= x) and (x <= (j - 1/2)/(n+1)): | |
return 2 * (n+1) * (x - (j-1)/(n+1)) | |
if ((j - 1/2)/(n+1) <= x) and (x <= j/(n+1)): |
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
10#10___ | |
1 | |
x0#10___ | |
3 | |
x0#10___ | |
3 | |
x0#10___ | |
5 | |
x0#x0___ | |
6 |
NewerOlder