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 twython import Twython | |
twitter = Twython(APP_KEY, APP_SECRET, | |
OAUTH_TOKEN, OAUTH_TOKEN_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
#Courtesy of https://gist.github.com/videlais/10d2e4648c7429cbb55b/ | |
import tweepy | |
class TwitterAPI: | |
def __init__(self): | |
consumer_key = "" | |
consumer_secret = "" | |
auth = tweepy.OAuthHandler(consumer_key, consumer_secret) | |
access_token = "" | |
access_token_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
from sklearn.datasets import load_iris | |
from sklearn.ensemble import RandomForestClassifier | |
import pandas as pd | |
import numpy as np | |
iris = load_iris() | |
df = pd.DataFrame(iris.data, columns=iris.feature_names) | |
df['is_train'] = np.random.uniform(0, 1, len(df)) <= .75 | |
df['species'] = pd.Categorical.from_codes(iris.target, iris.target_names) #change from pd.Factor(), which has been deprecated | |
df.head() |
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
#create an ssh key for the second account | |
ssh-keygen -t rsa -C "[email protected]" | |
#when prompted, make sure you name the file something other than the default | |
#"Enter file in which to save the key (/Users/you/.ssh/id_rsa): /Users/you/.ssh/id_rsa2" | |
#add the second key to the ssh agent | |
ssh-add ~/.ssh/id_rsa2 | |
#copy public key to the clipboard |
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
cd ~/.ssh/ | |
touch config |
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
#user1 account | |
Host github.com-user1 | |
HostName github.com | |
User git | |
IdentityFile ~/.ssh/id_rsa | |
#user2 account | |
Host github.com-user2 | |
HostName github.com | |
User git |
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
git remote set-url origin [email protected]:user1/your-repo-name.git |
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
git remote set-url origin [email protected]:user1/your-repo-name.git |
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
<!DOCTYPE html> | |
<!-- Based on an example from Chris Whong's class on creating a basic interactive map with JavaScript. See the CartoDB Academy for a step-by-step tutorial: http://docs.cartodb.com/tutorials/create_map_cartodbjs.html --> | |
<html> | |
<head> | |
<title>Your Title Here</title> | |
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/> | |
<link rel="shortcut icon" href="http://cartodb.com/assets/favicon.ico" /> |
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/bash | |
#------------------------------------------------------------ | |
# We assume the dump files have been generated using pg_dump: | |
# | |
# pg_dump -a --column-inserts -x -O -t table_name database_name -f /tmp/dmp_file_name | |
# | |
#------------------------------------------------------------ | |
# Provide details of your CartoDB account: |
NewerOlder