This file contains hidden or 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 ruby | |
require 'net/smtp' | |
require 'time' | |
require 'yaml' | |
size_map = { | |
'S' => 'small', | |
'M' => 'medium', | |
'L' => 'large', | |
'XL' => 'extra large', |
This file contains hidden or 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/sh | |
ACTION=${1-help} | |
HOST=`hostname | cut -d'.' -f 1` | |
case "$ACTION" in | |
on) | |
setxkbmap us -variant colemak | |
xset r rate 255 | |
case "$HOST" in |
This file contains hidden or 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
KERNEL!="hiddev[0-9]", GOTO="disable_touchpad_with_external_mouse_end" | |
ACTION=="add", RUN+="/usr/local/bin/touchpad off" | |
ACTION=="remove", RUN+="/usr/local/bin/touchpad on" | |
LABEL="disable_touchpad_with_external_mouse_end" |
This file contains hidden or 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
<script type="text/javascript"> | |
var disqus_url = "{Permalink}"; | |
var disqus_title ="{block:PostTitle}{PostTitle}{/block:PostTitle}"; | |
</script> | |
{block:Permalink} | |
<div id="disqus_thread"></div> | |
<script type="text/javascript"> | |
(function() { | |
var dsq = document.createElement('script'); |
This file contains hidden or 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 ruby | |
infile = File.new("index.html", "r") | |
outfile = File.new("big.html", "w") | |
mapfile = File.new("misc/urls", "r") | |
map = {} | |
while line = mapfile.gets do | |
parts = line.split(" ") | |
map[parts[0]] = parts[1] |
This file contains hidden or 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
redo-ifchange $1.tex | |
TMPDIR="$3-dir" | |
TEXARGS="-output-directory $TMPDIR $1.tex" | |
mkdir $TMPDIR | |
pdflatex $TEXARGS > /dev/null | |
pdflatex $TEXARGS > /dev/null | |
mv $TMPDIR/resume.pdf $3 | |
rm -rf $TMPDIR |
This file contains hidden or 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
### SYSTEM DEFAULTS {{{1 | |
if [ -f /etc/bashrc ]; then | |
source /etc/bashrc | |
fi | |
if [ -f /etc/bash_completion ]; then | |
source /etc/bash_completion | |
fi | |
### BASICS {{{1 |
This file contains hidden or 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
set-option -g prefix C-x | |
unbind-key C-b | |
bind-key C-x send-prefix | |
set-window-option -g mode-keys emacs | |
set-option -g status-keys emacs | |
bind-key bspace previous-window | |
bind-key ' ' next-window | |
bind-key - last-window |
This file contains hidden or 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
state :start do | |
transition [ | |
"need to log in", | |
"ready to post a job", | |
] | |
end | |
state "need to log in" do | |
if !body.index("log in") return false | |
transition [ |
This file contains hidden or 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
module Stateful | |
class PostconditionFailed < RuntimeError; end | |
class NoAvailableTransition < RuntimeError; end | |
class State | |
def initialize(opts={}) | |
@pre = opts[:pre] | |
@post = opts[:post] | |
@proc = opts[:proc] | |
@transitions = opts[:transitions] | |
end |