This file contains hidden or 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 | |
# execute `sudo apt-get install texlive-full` to install pdflatex | |
files = [file for file in os.listdir('.') if file.endswith('.tex')] | |
for file in files: | |
os.system('pdflatex '+file) |
This file contains hidden or 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/env python2.7 | |
# taken from https://www.youtube.com/user/sentdex | |
import time | |
import urllib2 | |
from urllib2 import urlopen | |
from lxml import html | |
sp500short = ['a', 'aa', 'aapl', 'abbv', 'abc', 'abt', 'ace', 'aci', 'acn', 'act', 'adbe', 'adi', 'adm', 'adp'] |
This file contains hidden or 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 | |
import spynner | |
import pyquery | |
import urllib | |
import os | |
# author: Nate Schultz | |
# contact: github.com/beefy | |
# created: 10/22/16 |
This file contains hidden or 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
/* $begin csapp.c */ | |
#include "csapp.h" | |
/************************** | |
* Error-handling functions | |
**************************/ | |
/* $begin errorfuns */ | |
/* $begin unixerror */ | |
void unix_error(char *msg) /* unix-style error */ | |
{ |
This file contains hidden or 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/env bash | |
do_push() { | |
while true; do | |
read -p "ready to push? " yn | |
case $yn in | |
[Yy]* ) read -p "commit msg: " msg; git add . -A; git commit -m "$msg"; git push; break;; | |
* ) kill -INT $$;; | |
esac | |
done |
This file contains hidden or 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
#include "csapp.h" | |
/* usage: ./echoclient host port */ | |
int main(int argc, char **argv) | |
{ | |
int clientfd, port; | |
char *host, buf[MAXLINE]; | |
rio_t rio; | |
host = argv[1]; | |
port = atoi(argv[2]); |
This file contains hidden or 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
# written by: https://github.com/beefy | |
# for: https://www.reddit.com/r/math/comments/6tcrxs/3x3_magic_square_of_squares_1000_prize/ | |
import numpy as np | |
while(1): | |
# generate a random 3x3 matrix | |
parker = np.random.randint(1000, size=(3, 3)) |
This file contains hidden or 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 time | |
import datetime | |
CURSOR_UP_ONE = '\x1b[1A' | |
ERASE_LINE = '\x1b[2K' | |
time_format = ['%I:%M:%S %p','%I %M %S %p'] | |
while (True): | |
print CURSOR_UP_ONE + ERASE_LINE + CURSOR_UP_ONE | |
print datetime.datetime.now().strftime(time_format[0]) | |
time_format.reverse() |
This file contains hidden or 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
function myFunction() { | |
var fromDate = new Date(2017,8,1,0,0,0); | |
var toDate = new Date(2017,8,16,0,0,0); | |
// delete from Sept 1 through Sept 15, 2017 | |
var calendar = CalendarApp.getCalendarsByName('NateSchultz')[0]; | |
var events = calendar.getEvents(fromDate, toDate); | |
for(var i=0; i<events.length;i++){ | |
var ev = events[i]; |
This file contains hidden or 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 tweepy | |
import time | |
def login_to_twitter(consumer_key, consumer_secret, access_token, access_token_secret): | |
auth = tweepy.OAuthHandler(consumer_key, consumer_secret) | |
auth.set_access_token(access_token, access_token_secret) | |
return tweepy.API(auth) | |
def tweet(api, tweet): |