start new:
tmux
start new with session name:
tmux new -s myname
import os | |
import sys | |
import re | |
import boto3 | |
import zipfile | |
def parse_s3_uri(url): | |
match = re.search('^s3://([^/]+)/(.+)', url) | |
if match: | |
return match.group(1), match.group(2) |
############################# | |
# | |
# Appends the camera model, | |
# extracted from the EXIF data | |
# to the file name. | |
# | |
# RAW file support comes via | |
# a Perl command-line tool | |
# called `exiftool` | |
# |
# Pylab BOXPLOTS in 538 style | |
import matplotlib.pyplot as plt | |
import itertools | |
def box_plot(boxes, figsize=(5,4), ymax=None, title=None, xlabels=[]): | |
def setBoxColors(bp): | |
colours = ["#30a2da","#6d904f","#8b8b8b","#fc4f30","#e5ae38"] | |
n_boxes = len(bp['boxes']) | |
fte = list(itertools.islice(itertools.cycle(colours), n_boxes)) |
/* | |
Taken and cribbed from blog.datalicious.com/free-download-all-australian-postcodes-geocod | |
May contain errors where latitude and longitude are off. Use at own non-validated risk. | |
*/ | |
SET NAMES utf8; | |
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; | |
DROP TABLE IF EXISTS postcodes_geo; |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import sys | |
import os | |
class FileSampler: | |
def __init__(self): | |
self.parse_args(sys.argv) |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import sys | |
import os | |
class FileSplitter: | |
def __init__(self): | |
self.parse_args(sys.argv) |
#!/usr/bin/python | |
import sys | |
import os | |
import math | |
import scipy.stats | |
normal_distribution_calculations =[ | |
(1, "Probability that score is less than x (area below)", ["Enter score: "], lambda dist,score: dist.cdf(score)), | |
(2, "Maximum score to satisfy Pr(x) (area below)", ["Enter probability: "], lambda dist,prob: dist.ppf(prob)), | |
(3, "Probability that score is more than x (area above)", ["Enter score: "], lambda dist,score: dist.sf(score)), |
alias aliases="egrep '^[^#$ ]' $0 | sed -E 's/^alias ([^=]+)=/\1 => /g' | sort" |
NODES = { | |
1 => [2,4,5], | |
2 => [1,3,4,5,6], | |
3 => [2,5,6], | |
4 => [1,2,5,7,8], | |
5 => [1,2,3,4,6,7,8,9], | |
6 => [2,3,5,8,9], | |
7 => [4,5,8], | |
8 => [4,5,6,7,9], | |
9 => [5,6,8] |