Skip to content

Instantly share code, notes, and snippets.

View bagrow's full-sized avatar

Jim Bagrow bagrow

View GitHub Profile
@bagrow
bagrow / calc_diff.sh
Created February 1, 2011 00:50
Semi-automatic way to track changes in a latex file
#!/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
@bagrow
bagrow / jet_colors.gnu
Created February 1, 2011 00:12
Love or hate the matlab jet colormap? Want it in gnuplot? Here's how to do it!
set palette defined (0 0.0 0.0 0.5, \
1 0.0 0.0 1.0, \
2 0.0 0.5 1.0, \
3 0.0 1.0 1.0, \
4 0.5 1.0 0.5, \
5 1.0 1.0 0.0, \
6 1.0 0.5 0.0, \
7 1.0 0.0 0.0, \
8 0.5 0.0 0.0 )
import execnet, gevent
# Use boto to get images ip
from boto.ec2.connection import EC2Connection
conn = EC2Connection('secret', 'secret')
my_ami = conn.get_all_instances()
my_instances = my_ami[1].instances
servers = []
for instance in my_instances:
servers.append(instance.public_dns_name)
@yy
yy / monex.py
Last active November 4, 2020 01:49
MONitor multiple files & EXecute the given command.
#!/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.
"""