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/env python | |
# weather | |
# Jim Bagrow | |
# Last Modified: 2014-01-01 | |
""" | |
This script requires: | |
1. a weather underground API key |
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/env bash | |
# these can also be commandline args... | |
OLD_TEX=paper_orig.tex # previous draft, submission, etc. | |
NEW_TEX=paper.tex # current working version | |
if [[ "$1" = 'clean' ]]; then | |
rm -f diff* | |
else | |
latexdiff $OLD_TEX $NEW_TEX > diff.tex |
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 | |
echo -e "\033[0mCOLOR_NC (No color)" | |
echo -e "\033[1;37mCOLOR_WHITE\t\033[0;30mCOLOR_BLACK" | |
echo -e "\033[0;34mCOLOR_BLUE\t\033[1;34mCOLOR_LIGHT_BLUE" | |
echo -e "\033[0;32mCOLOR_GREEN\t\033[1;32mCOLOR_LIGHT_GREEN" | |
echo -e "\033[0;36mCOLOR_CYAN\t\033[1;36mCOLOR_LIGHT_CYAN" | |
echo -e "\033[0;31mCOLOR_RED\t\033[1;31mCOLOR_LIGHT_RED" | |
echo -e "\033[0;35mCOLOR_PURPLE\t\033[1;35mCOLOR_LIGHT_PURPLE" | |
echo -e "\033[0;33mCOLOR_YELLOW\t\033[1;33mCOLOR_LIGHT_YELLOW" | |
echo -e "\033[1;30mCOLOR_GRAY\t\033[0;37mCOLOR_LIGHT_GRAY" |
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/env python | |
# encoding: utf-8 | |
""" | |
MONitor & EXecute | |
Yong-Yeol Ahn (http://yongyeol.com/) | |
This script monitors multiple files and executes the given command when | |
any of those files is changed. |
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/python | |
import sys, os, time | |
import tty | |
from select import select | |
class TerminalFile: | |
"""Adapted from http://code.activestate.com/recipes/203830/""" | |
def __init__(self,infile): | |
if not infile.isatty(): |
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
ENGINE = latexmk -pdf -silent -view=none | |
SOURCES = cover_letter paper paper_supp | |
MERGEFILE = paper_wCoverLetterSupp_$(shell date "+%Y%m%d").pdf | |
TEMPS = aux blg fdb_latexmk log out synctex.gz | |
MERGECMD= | |
ifneq ($(MERGEFILE),) | |
MERGECMD=gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=$(MERGEFILE) $(SOURCES:=.pdf) | |
endif |
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
javascript: | |
var youtubeid = getQueryVariable("v"); | |
if (youtubeid != undefined){ | |
window.location="http://youtube.googleapis.com/v/"+youtubeid+"&autoplay=1"; | |
} | |
function getQueryVariable(variable) { | |
/* courtesy: http://stackoverflow.com/a/1623707 */ | |
var query = window.location.search.substring(1); | |
var vars = query.split("&"); |
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/env python | |
# weighted_choice.py | |
# Jim Bagrow | |
# Last Modified: 2012-11-06 | |
import random, bisect | |
import pylab | |
def weighted_choice(choices, num_draws=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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# exhaustive_search_linearRegression.py | |
# Jim Bagrow | |
# Last Modified: 2015-10-05 | |
import sys, os | |
import numpy as np | |
import scipy, scipy.stats |
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/env python | |
# color_stuff.py | |
# Jim Bagrow | |
# Last Modified: 2016-12-01 | |
import colorsys | |
def distinguishable_colors(num, sat=1.0, val=1.0): | |
"""Generate a list of `num' rgb hexadecimal color strings. The strings are |
OlderNewer