start new:
tmux
start new with session name:
tmux new -s myname
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import sys | |
import os | |
class FileSampler: | |
def __init__(self): | |
self.parse_args(sys.argv) |
/* | |
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; |
# 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)) |
function encode52(c) { | |
return (c < 52 ? '' : encode52(parseInt(c / 52))) + ((c = c % 52) > 25 ? String.fromCharCode(c + 39) : String.fromCharCode(c + 97)); | |
}; |
def calculate_downtime_minutes | |
check_id = 387085 | |
user = "alerts@admin.mysquawkbox.com" | |
pass = "***" | |
key = "***" | |
today = DateTime.now.to_date | |
last_sunday = today - today.wday |
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDjUroth5dd9SB+U8SuAKnmGgrDPeHGFFwqAXKeNJ+wht6mVXLipDs01eVii3a7Ibkalh2v45+KleiQoXXYhaLuvuq1KskGU7lv5bJUcQWicoBWh/OtrrzmWHlsesq1EDXjqDL0bgm2sQ+efO5G1qnBhwZ7PNXH6CHb8ayuySk8m4N0R/8Sn188LwAdFy2jgcAWuOM8wXACK41JaH38HwMsgrjIphCoxZbAYtufa+wkqztEs546wBk6vDJn46J432LhxXuN5TY9BV043qLQl3Y9RDkRk5Siq63a3vioKYWsqlxIbiN0FAae9S6Klg0pVZYDsJajyYycMIJlGvAx7AGt |
#!/usr/bin/ruby | |
######################### | |
# | |
# Convert rubycode with 4-space indents | |
# to regulation 2-space indenting format. | |
# | |
# supply directory as argument: | |
# > ruby indentity_correction.rb ./my_code_dir | |
# |
# too much stuff to camelize the json object keys | |
# so that they are ready for the templates | |
def camelized(emp) | |
puts emp.inspect | |
if emp.is_a?(Array) | |
new = [] | |
emp.each {|e| new << camelize_keys(e)} | |
else | |
new = camelize_keys(emp) |
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'github/markup' | |
if ARGV.length == 1 | |
f = GitHub::Markup.render(ARGV[0]) | |
puts f | |
else | |
raise "Usage: markup <source_file> [ > <destination_file> ]" | |
end |