Skip to content

Instantly share code, notes, and snippets.

View Cherisea's full-sized avatar

Joey Cherisea Cherisea

View GitHub Profile
@Cherisea
Cherisea / dnsovertls.md
Created May 23, 2020 14:21 — forked from uraimo/dnsovertls.md
Configure your Mac to use DNS over TLS
@Cherisea
Cherisea / tweet_listener.py
Created August 22, 2019 01:51 — forked from hugobowne/tweet_listener.py
Here I define a Tweet listener that creates a file called 'tweets.txt', collects streaming tweets as .jsons and writes them to the file 'tweets.txt'; once 100 tweets have been streamed, the listener closes the file and stops listening.
class MyStreamListener(tweepy.StreamListener):
def __init__(self, api=None):
super(MyStreamListener, self).__init__()
self.num_tweets = 0
self.file = open("tweets.txt", "w")
def on_status(self, status):
tweet = status._json
self.file.write( json.dumps(tweet) + '\n' )
self.num_tweets += 1
import wx
# define the load function
def load(event):
file = open(filename.GetValue())
contents.SetValue(file.read())
file.close()
# define the save function
def save(event):
file = open(filename.GetValue(), 'w')
import wx
# define the load function
def load(event):
file = open(filename.GetValue())
contents.SetValue(file.read())
file.close()
# define the save function
def save(event):
file = open(filename.GetValue(), 'w')
@Cherisea
Cherisea / July 13th.py
Last active July 13, 2017 06:24
web crwaler
import random
import urllib.request
def download_web_image(url):
num = random.randrange(1, 100)
full_name = str(num) + '.jpg'
urllib.request.urlretrieve(url, full_name)
download_web_image("http://pic.58pic.com/58pic/11/84/23/13A58PIC6ZC.jpg")