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
if status is-interactive | |
# Commands to run in interactive sessions can go here | |
end | |
alias gs='git status' | |
alias gc='git commit' | |
alias gp='git pull' | |
alias gpush='git push' | |
alias ga='git add' | |
alias gaa='git add --all' |
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
# https://fishshell.com/ | |
sudo apt-add-repository ppa:fish-shell/release-3 -y | |
sudo apt update | |
sudo apt install -y fish | |
chsh -s `which fish` | |
# git shortcuts | |
mkdir -p ~/.config/fish/ | |
touch ~/.config/fish/config.fish | |
echo " |
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
#Python 3 | |
import fileinput | |
import os | |
TARGET_EXTENSION = ".php" | |
FIND = "REMOTE_ADDR" | |
REPLACE = "HTTP_CF_CONNECTING_IP" | |
def replace(f): |
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
""" | |
Bound by our cache table which is every combination of subproblem, so | |
cities * months. Worst case we fill each of those cells (every city is | |
neighbors with every other city); filling in a cell takes worst case #cities | |
work (if it's neighbors with every other city) giving us overall bounding | |
O( cities * months * cities ) | |
""" | |
from collections import defaultdict | |
table = defaultdict(dict) |
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 bs4 import BeautifulSoup | |
import requests | |
states = ['AL', 'AK', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'FL', 'GA', 'HI', 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS', 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR', 'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'WA', 'WV', 'WI', 'WY'] | |
for state in states: | |
stateselection = "http://www.icee.com/locationsICEE.asp?state=%s" % state | |
r = requests.get(stateselection) | |
soup = BeautifulSoup(r.text, "html.parser") | |
rows = soup.find_all("option") |
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 github import Github | |
username = "username" | |
password = "pass" | |
g = Github(username, password) | |
user = g.get_user() | |
pages = user.get_repos() | |
i = 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 random | |
trials = 100 | |
stay = [] | |
switch = [] | |
for t in range(trials): | |
possibilities = [1,2,3] | |
ans = random.choice(possibilities) | |
stay_ans = random.choice(possibilities) | |
stay.append(stay_ans == ans) #either true or false |
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 flask import Flask, request | |
app = Flask(__name__) | |
@app.route("/", methods=['GET', 'POST']) | |
def hello(): | |
if request.method == 'GET': | |
request.args["field"] | |
return "Hello World" | |
if request.method == 'POST': |
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
setxkbmap -option caps:none | |
xmodmap -e "keycode 66 = Escape" |
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 | |
import re, time | |
driver = webdriver.Firefox() | |
regex = re.compile("https?://([\S]+)") | |
for line in open ('FILE.txt', 'r'): | |
m = regex.search(line) | |
if m != None: | |
wayback = "https://web.archive.org/save/" + m.group(1) |