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
import smtplib | |
from email.MIMEBase import MIMEBase | |
from email.MIMEText import MIMEText | |
from email.MIMEMultipart import MIMEMultipart | |
from email import Encoders | |
import time | |
import os | |
def load_attachments(folder): | |
# clean up folder name |
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
from mrjob.job import MRJob | |
from mrjob.protocol import JSONValueProtocol, JSONProtocol, RawProtocol | |
import json | |
from urlparse import urlparse | |
img_formats = [ | |
'jpg', | |
'gif', | |
'png' | |
] |
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
list_of_dicts = [{'a':1}, {'b':2}] | |
list_of_dicts[-1]['b'] = 3 | |
print list_of_dicts[-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
import json | |
import tweepy | |
import os | |
import json | |
consumer_key = '' | |
consumer_secret = '' | |
access_key = '' | |
access_secret = '' |
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
import pandas as pd | |
import json | |
import sys | |
def csv2json(file_path): | |
df = pd.read_csv(file_path, encoding='latin1') | |
output = [] | |
for i in df.index: | |
row = {} |
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
var KNOWN_TLDS = [ | |
'aero', 'asia', 'biz', 'cat', 'com', 'coop', 'info', | |
'int', 'jobs', 'mobi', 'museum', 'name', 'net', 'org', 'post', 'pro', | |
'tel', 'travel', 'xxx', 'edu', 'gov', 'mil', 'nyc', 'ac', | |
'ad', 'ae', 'af', 'ag', 'ai', 'al', 'am', 'an', 'ao', 'aq', 'ar', | |
'as', 'at', 'au', 'aw', 'ax', 'az', 'ba', 'bb', 'bd', 'be', 'bf', | |
'bg', 'bh', 'bi', 'bj', 'bm', 'bn', 'bo', 'br', 'bs', 'bt', 'bv', | |
'no', 'bw', 'by', 'bz', 'ca', 'cc', 'cd', 'cf', 'cg', 'ch', 'ci', | |
'ck', 'cl', 'cm', 'cn', 'co', 'cr', 'cs', 'cu', 'cv', 'cx', 'cy', | |
'cz', 'dd', 'de', 'dj', 'dk', 'dm', 'do', 'dz', 'ec', 'ee', 'eg', |
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/python | |
# -*- coding: utf-8 -*- | |
from socketIO_client import SocketIO | |
ADDRESS = "https://chat.meatspac.es" | |
class MeatListener(object): | |
def __init__(self): | |
# connect to socket |
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
from selenium import webdriver | |
from datetime import datetime | |
import os, time | |
# TASK OBJECT | |
def taskrabbit(task): | |
""" | |
taskrabbit works by taking in a task dictionary with the following key value pairs: |
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
from selenium import webdriver | |
from selenium.webdriver.common.keys import Keys | |
b = webdriver.Chrome() | |
b.get("http://chat.meatspac.es") | |
chat = b.find_element_by_id('add-chat') | |
chat.send_keys("I just meatsted with python") | |
chat.send_keys(Keys.RETURN) |
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
<html> | |
<head> | |
</head> | |
<body> | |
<h1> sheetmusic </h1> | |
</body> | |
<script> | |
// notes and scales |