Skip to content

Instantly share code, notes, and snippets.

import sys
import requests
import random
import time
import pandas as pd
try:
plist = df = pd.read_csv('./resources/pokemon_list.csv', usecols=['pokemon'])['pokemon'].tolist()
except:
# fallback in case file's not available
Which celebrity went on the fastest, hardest and most destructive downwards spiral from their peak?
people of reddit who survive on less than 8 hours of sleep, how?
Men, how do you respond to the unsolicited vag pics that flood your DMs?
What's a massive scandal / controversy that people seem to have forgotten about?
Men of Reddit: what’s the creepiest thing a woman has ever said to you?
What addiction is seen as completely normal by society?
You’re stuck in a room with every person you’ve ever had sex with. What’s your first move?
What's something boys can never tell their girlfriends?
There is foreplay before sex. What is a good "afterplay"? Is there any?
If band names were literal, what would be the worst concert to attend?
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 10.
"-- starting hand #1 (No Limit Texas Hold'em) (dealer: ""bbe7f7ff8a @ f32c848544"") --",2021-11-06 13:39:56.924,163620599692400
"Player stacks: #1 ""bbe7f7ff8a @ f32c848544"" (50.00) | #2 ""a09ad17e08 @ f78f9a5134"" (50.00) | #3 ""9c9a08e0a9 @ 9dfda9292c"" (50.00) | #4 ""ef45085576 @ 6eec6cef42"" (50.00) | #8 ""59babec8c0 @ 18de6efd2f"" (100.00) | #10 ""ddf91c890a @ a6240283d4"" (50.00)",2021-11-06 13:39:56.924,163620599692407
"""a09ad17e08 @ f78f9a5134"" posts a small blind of 0.10",2021-11-06 13:39:56.924,163620599692414
"""9c9a08e0a9 @ 9dfda9292c"" posts a big blind of 0.20",2021-11-06 13:39:56.924,163620599692415
"""ef45085576 @ 6eec6cef42"" folds",2021-11-06 13:40:36.937,163620603693700
"""59babec8c0 @ 18de6efd2f"" folds",2021-11-06 13:40:38.022,163620603802200
"""ddf91c890a @ a6240283d4"" calls 0.20",2021-11-06 13:40:41.108,163620604110800
"""bbe7f7ff8a @ f32c848544"" calls 0.20",2021-11-06 13:40:42.858,163620604285800
"""a09ad17e08 @ f78f9a5134"" calls 0.20",2021-11-06 13:40:45.877,163620604587700
"Th
@dobeok
dobeok / dict.py
Last active August 19, 2022 03:19
dictionary comprehensions
dict = {
'A': 3,
'B': 2,
'C': 1,
'D': 5,
'E': 4,
}
# sorting dictionary by values
{k: v for k, v in sorted(dict.items(), key=lambda item: item[1])}
@dobeok
dobeok / estimate-pi.py
Created August 8, 2022 15:15
Estimate pi using Monte-Carlo simulation
import matplotlib.pyplot as plt
import random
# for reproducibility
random.seed(42)
# euclidean distance
def distance_from_origin(point):
return (point[0]**2 + point[1]**2) ** .5
@dobeok
dobeok / image-cropper.py
Last active August 8, 2022 15:24
Batch cropping images
"""
used to crop similarly sized images consistently, producing neater outputs
"""
import numpy as np
from PIL import Image
file_list = ['post2.png', 'post3.png']
output = []
for file in file_list: