Skip to content

Instantly share code, notes, and snippets.

View justmytwospence's full-sized avatar

Spencer justmytwospence

View GitHub Profile
@justmytwospence
justmytwospence / keybase.md
Created October 31, 2017 15:30
Proof for Keybase.io

Keybase proof

I hereby claim:

  • I am justmytwospence on github.
  • I am justmytwospence (https://keybase.io/justmytwospence) on keybase.
  • I have a public key ASDemKLHtCcmEFUpeBKZ6vtO8t1wjGMB8ROswxerxovUOAo

To claim this, I am signing this object:

-modi [string] Enabled modi
combi (XResources)
-opacity [number] Window opacity
80 (XResources)
-width [number] Window width
50 (Default)
-lines [number] Number of lines
15 (Default)
-columns [number] Number of columns
1 (Default)
@justmytwospence
justmytwospence / brutus.py
Last active August 29, 2015 14:13
Fun brute force Caesar cipher decryptor
def brute_caesar_decrypt(encrypted):
import string
alphabet = string.ascii_letters
for shift in range(-13, 13):
shifted = alphabet[-shift:] + alphabet[:-shift]
decrypted = ''.join([shifted[alphabet.index(char)] for char in encrypted])
print decrypted.lower()
" http://recursivedream.com/blog/2012/auto-completing-google-contacts-in-vim/
" Escape query and handle goobook errors
function! mailcomplete#Complete(findstart, base)
if a:findstart == 1
let line = getline('.')
let idx = col('.')
while idx > 0
let idx -= 1
let c = line[idx]
" break on header and previous email
@justmytwospence
justmytwospence / cache.py
Created July 10, 2014 18:44
A decorator that "caches" results of an arbitrary function based on its arguments.
def cache(func):
saved = {}
@wraps(func)
def newfunc(*args):
if args in saved:
return newfunc(*args)
result = func(*args)
saved[args] = result
return result
return newfunc
@justmytwospence
justmytwospence / preamble.tex
Created July 4, 2014 02:37
Basic LaTeX preamble, especially for Rnoweb files.
\documentclass{article}
\usepackage{graphicx,hyperref,amsmath,natbib,bm,url} % Common packages
\usepackage[australian]{babel} % Ascending date format
\usepackage[a4paper,text={16.5cm,25.2cm},centering]{geometry} % Document size
\usepackage[compact,small]{titlesec} % Title spacing
\setlength{\parskip}{1.2ex} % Paragraph spacing
\setlength{\parindent}{0em} % Paragraph indentation
\clubpenalty = 10000 % Prevent orphans
\widowpenalty = 10000 % Prevent widows
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<style>
#chart {
height: 500px;
}
.node rect {
cursor: move;
fill-opacity: .9;
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>D3 Page Template</title>
<script type="text/javascript" src="d3/d3.js"></script>
<script type="text/javascript" src="d3/lib/colorbrewer/colorbrewer.js"></script>
<style>
rect:active {
fill: 'orange';
@justmytwospence
justmytwospence / contract-optimization.ipynb
Created March 14, 2014 06:21
Business Strategies for Big Data assignment
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.