This file contains hidden or 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
➜ hallucinations python3 analyze.py | |
1: {"temperature":{"value":75,"unit":"F"}} | |
1: {"temperature":{"value":75,"units":"F"}} | |
1: {"temperature":75,"unit":"F"} | |
1: {"temperature":75,"unit":"F"} | |
1: {"temperature":{"value":75,"units":"F"}} | |
1: {"temperature":75,"units":"F"} | |
1: {"current_temperature":{"value":75,"unit":"F"}} | |
1: {"Temperature":{"Fahrenheit":75}} | |
1: {"reading":"75F"} |
This file contains hidden or 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
List every song that the Grateful Dead covered from another band, and include the original band that performed it. | |
As a constantly evolving band with an extensive career, the Grateful Dead have covered numerous songs by other artists. Though it's challenging to provide a fully comprehensive list, here are some notable covers and their original artists: | |
"Morning Dew" - Bonnie Dobson | |
"Viola Lee Blues" - Cannon's Jug Stompers | |
"Cold Rain and Snow" - Obray Ramsey | |
"Turn On Your Love Light" - Bobby "Blue" Bland | |
"Death Don't Have No Mercy" - Reverend Gary Davis | |
"I Know You Rider" - Traditional (popularized by various folk artists) |
This file contains hidden or 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
diff --git a/Procfile b/Procfile | |
new file mode 100644 | |
index 0000000..c2c566e | |
--- /dev/null | |
+++ b/Procfile | |
@@ -0,0 +1 @@ | |
+web: bundle exec puma -C config/puma.rb | |
diff --git a/app/controllers/upload_controller.rb b/app/controllers/upload_controller.rb | |
new file mode 100644 | |
index 0000000..2157acf |
This file contains hidden or 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
import csv | |
from fpdf import FPDF | |
pdf = FPDF() | |
MAJOR = 12 | |
MINOR = 10 | |
# download from Google Sheets as CSV to addresses.csv | |
with open('addresses.csv', newline='') as csvfile: |
This file contains hidden or 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
import boto3 | |
dynamo = boto3.resource('dynamodb') | |
def truncate_table(table_name): | |
table = dynamo.Table(table_name) | |
table_key_names = [key.get("AttributeName") for key in table.key_schema] | |
response = table.scan(ProjectionExpression=", ".join(table_key_names) | |
data = response.get('Items') | |
while 'LastEvaluatedKey' in response: |
This file contains hidden or 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
import urllib | |
import re | |
URLS = { | |
'10 Inbound Wisconsin & Madera': 'http://webservices.nextbus.com/service/publicXMLFeed?command=predictions&a=sf-muni&r=10&s=6966', # noqa E501 | |
'48 Inbound Wisconsin & 25th': 'http://webservices.nextbus.com/service/publicXMLFeed?command=predictions&a=sf-muni&r=48&s=3513', # noqa E501 | |
} | |
SECONDS_MINUTES_RE = re.compile('seconds="(\d+)" minutes="(\d+)"') |
This file contains hidden or 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
require 'net/http' | |
README = <<-EOS | |
posts = [ | |
{ | |
url: 'https://localhost:3000/', | |
body: '{"status": "OK", "id": 1}' | |
}, | |
{ | |
url: 'https://localhost:3000/', |
This file contains hidden or 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
# API endpoint that takes ~3.8s to respond | |
TARGET_URI = 'http://localhost:3000/delay' | |
SAMPLE_BODY = {} | |
def post_body! | |
Net::HTTP.post_form(TARGET_URI, SAMPLE_BODY).body | |
print ?. | |
end | |
1.upto(5).each do |concurrency| |
This file contains hidden or 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
# These commands are to be run in different tmux panes to quickly copy the | |
# contents of one hard drive to another. `rsync` is used for it's robustness, | |
# interruptibility, and efficiency in incremental updates. | |
# | |
# After the initial clone, the same `rsync` command can be run to copy just the | |
# new/changed files from source to target. | |
# tmux pane 1 | |
rsync --inplace --whole-file --partial --progress -a /Volumes/amsterdam/ /Volumes/stockholm/ |
This file contains hidden or 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
""" | |
$ sudo dtruss -f -t open python main.py | |
18564/0xc29254: open("function-main-start\0", 0x1000000, 0x1B6) = -1 Err#2 | |
18564/0xc29254: open("/anaconda3/lib/python3.6/__pycache__/random.cpython-36.pyc\0", 0x1000000, 0x1B6) = 3 0 | |
18564/0xc29254: open("/anaconda3/lib/python3.6/lib-dynload/math.cpython-36m-darwin.so\0", 0x0, 0x0) = 3 0 | |
18564/0xc29254: open("/anaconda3/lib/python3.6/__pycache__/hashlib.cpython-36.pyc\0", 0x1000000, 0x1B6) = 3 0 | |
18564/0xc29254: open("/anaconda3/lib/python3.6/lib-dynload/_hashlib.cpython-36m-darwin.so\0", 0x0, 0x0) = 3 0 | |
18564/0xc29254: open("/anaconda3/lib/libssl.1.0.0.dylib\0", 0x0, 0x0) = 3 0 | |
18564/0xc29254: open("/anaconda3/lib/libcrypto.1.0.0.dylib\0", 0x0, 0x0) = 3 0 |
NewerOlder