Skip to content

Instantly share code, notes, and snippets.

test1
content of file
@HebeHH
HebeHH / reddit_cmdline_search.py
Last active August 3, 2018 15:27
Search through specific subreddits from the command line. Returns titles and vote scores only
import praw
import re
from tqdm import tqdm
import pandas as pd
pd.options.display.max_colwidth = 70
# pick subreddits, any delimiter but letter, number and new line is okay (will default to r/news if no valid input)
subreddits = "+".join(re.findall(r'[A-Za-z0-9]+', raw_input("Enter desired subreddits on one line\n")))
print "Your subreddits are: " + subreddits
import praw
import re
import pandas as pd
# connect to reddit
reddit = praw.Reddit(client_id='my_id', client_secret='my_secret', user_agent='me')
# get new submissions from News
submissions = []
for submission in reddit.subreddit("News").new(limit = None):
@HebeHH
HebeHH / turtle-messenger.py
Created February 1, 2019 18:48
Turn plain text into a messenger chat animation using python's turtle graphic library.
import turtle
# msgr font is Roboto
# draw rounded corner
def corner(tess):
for i in range(15):
tess.right(6)
tess.forward(2)
# draw rounded, filled rectangle of around (40+h)*(40+w) dimensions
@HebeHH
HebeHH / eps-to-pdf.sh
Created February 19, 2019 09:48
Batch eps to pdf from mac command line
FILES="*.eps"; for f in $FILES; do ps2pdf -dEPSCrop $f; done