Skip to content

Instantly share code, notes, and snippets.

@alloy-d
alloy-d / colemak.vim
Created June 23, 2010 09:43
Keybindings for Vim in Colemak that don't move the navigation keys.
" My thrown-together-in-five-minutes Vim bindings for Colemak.
"
" The most radical change here is that 's' enters insert mode.
" Importantly, the movement keys remain unaltered.
"
" Any other keys (o, y, p, u, etc) use their Colemak locations
" because they're better (and my fingers have forgotten QWERTY).
" Movement
# Makefile for Tumblr themes.
# I am not even kidding.
THEME=nox
all: $(THEME).tumblr.html
$(THEME).css: $(THEME).sass
sass $(THEME).sass > $(THEME).css
@alloy-d
alloy-d / gist:471381
Created July 11, 2010 07:54
Finding the directory a file resides in in Go -- please tell me I'm doin' it wrong.
// I feel like this can't possibly be how you're *supposed*
// to find the directory a file resides in in Go.
package clever
import (
"path"
"runtime"
)
func GetMyDir() string {
@alloy-d
alloy-d / miu.go
Created July 19, 2010 02:06
A program that derives strings in Hofstadter's MIU-system in a brainless (but idiomatic Go) manner.
// Warning: eats memory quickly.
// Resource limiting recommended.
package main
import (
"fmt"
"os"
"strings"
)
#!/usr/bin/env python
import json
import sys
import time
import urllib
email = "[email protected]"
password = "Haha, like I'd show you!"
def get_fix(start=0, num=50):
@alloy-d
alloy-d / dsawork.cls
Created September 13, 2010 23:22
LaTeX class for homework and example usage.
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{dsawork}[2009/02/04 Class for DSA homework]
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions\relax
% Base on the standard article class
\LoadClass{article}
%\ProvidesPackage{dsawork}
@alloy-d
alloy-d / relational_algebra.tex
Created September 14, 2010 20:58
A section of a database systems homework that uses handy relational algebra commands.
\documentclass[letterpaper]{article}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{inconsolata}
%\pagestyle{empty}
%% About the assignment...
\newcommand{\name}{Adam Lloyd}
\newcommand{\class}{CSCI 4380}
@alloy-d
alloy-d / lighttpd.conf
Created February 17, 2011 00:29
Doing stuff on the Internet...
$HTTP["host"] =~ "nagato.alloy-d.net" {
proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => "3080" ) ) )
}
@alloy-d
alloy-d / .zshrc
Created February 20, 2011 06:03
.zshrc
# The following lines were added by compinstall
zstyle ':datetime:*' calendar-file '/home/adam/.calendar'
zstyle ':completion:*' format 'Completing %d:'
zstyle ':completion:*' group-name ''
zstyle ':completion:*' ignore-parents parent pwd .. directory
zstyle ':completion:*' list-colors ''
zstyle ':completion:*' list-suffixes true
zstyle ':completion:*' matcher-list '' 'm:{[:lower:]}={[:upper:]}' 'r:|[._-]=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}'
zstyle ':completion:*' max-errors 2 not-numeric
var useSeveralSmallAndSinglePurposeHelperFunctionsToManipulateASetOfClearlyNamedVariablesWithTheUltimatePurposeOfCreatingSomethingThatLooksLikeASpiralGalaxy = function () {
var imCallingThisVariableIndexOfArmInTheSpiralGalaxyToMakeBrianHappy = 0;
var imCallingThisVariableDistanceInArbitraryUnitsAlongTheCurveToMakeBrianHappy = 0;
var imCallingThisVariableTemporaryCounterVariableToMakeBrianHappy = 0;
var imCallingThisTheArrayOfStarsThatHasOneSubarrayForEachArmInTheSpiralGalaxyToMakeBrianHappy = [];
var getARandomColorThatIsEitherBluishOrReddish = function () {
// returns a random color that is either bluish or reddish.
// used in addStar().
}