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.support.wait import WebDriverWait | |
class WaitBrowser(object): | |
def __init__(self, **kw): | |
self.browser = webdriver.PhantomJS() | |
def readystate_complete(self): |
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/bash | |
## include --upsert if adding to a prexistitng collection | |
mongoimport -d db_name -c coll_name --type csv --file file.csv --headerline |
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
# lets make some dummy data | |
n_rows <- 1000 | |
n_cols <- 100 | |
mat <- matrix(0, nrow=n_rows, ncol=n_cols) | |
mat <- apply(mat, 2, function(x) { return(rbinom(n_rows, size=1, prob=0.1))}) | |
colnames(mat) <- paste0("event", 1:n_cols) | |
rownames(mat) <- paste0("pol", 1:n_rows) | |
# lets take a look at it before we do some math | |
head(mat) |
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
#!/bin/sh | |
curl http://cat.www.$1.com.meowbify.com/ > index.html | |
s3cmd put index.html s3://$1.cat/ |
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 os | |
import sys | |
import time | |
import random | |
VOICES = [ | |
"Agnes", | |
"Alex", | |
"Alice", | |
"Alva", |
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
thai spicy เผ็ดร้อนไทย, pik nam pla (พริกน้ำปลา) on the side |
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 facepy import GraphAPI | |
import facepy | |
import re | |
import json | |
#meta variables | |
access_token = 'your_token' | |
page_id = 'the_page' # input page id here | |
base_query = page_id + '/feed?limit=300' |
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 requests | |
import urllib | |
import json | |
ZIP_CODES = [ | |
'11211' | |
] | |
def get_rect_from_zip(session, zip_code): | |
""" |
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
170.149.168.130 www.facebook.com | |
170.149.168.130 facebook.com | |
170.149.168.130 static.ak.fbcdn.net | |
170.149.168.130 www.static.ak.fbcdn.net | |
170.149.168.130 login.facebook.com | |
170.149.168.130 www.login.facebook.com | |
170.149.168.130 fbcdn.net | |
170.149.168.130 www.fbcdn.net | |
170.149.168.130 fbcdn.com | |
170.149.168.130 www.fbcdn.com |
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
#see below for query specifications | |
getInsights <- function( | |
username = "Insights4R@gmail.com", | |
password = "googleinsights4r", | |
text_query = "'hello world'", | |
date_query = "1/2004 108m", | |
geo_query = "US", | |
search_type= "all", | |
filter_category="none"){ |