Skip to content

Instantly share code, notes, and snippets.

git remote set-url origin [email protected]:user1/your-repo-name.git
@richarddunks
richarddunks / ssh_config_example.sh
Created March 7, 2023 03:23 — forked from datapolitan/ssh_config_example.sh
Example SSH config file
#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
cd ~/.ssh/
touch config
@richarddunks
richarddunks / key_setup.sh
Created March 7, 2023 03:23 — forked from datapolitan/key_setup.sh
Multiple keys for Github account
#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
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()
#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 = ""
from twython import Twython
twitter = Twython(APP_KEY, APP_SECRET,
OAUTH_TOKEN, OAUTH_TOKEN_SECRET)