Skip to content

Instantly share code, notes, and snippets.

View enaeseth's full-sized avatar

Eric Naeseth enaeseth

View GitHub Profile
@enaeseth
enaeseth / yaml_ordered_dict.py
Created February 25, 2011 19:54
Load YAML mappings as ordered dictionaries
import yaml
import yaml.constructor
try:
# included in standard lib from Python 2.7
from collections import OrderedDict
except ImportError:
# try importing the backported drop-in replacement
# it's available on PyPI
from ordereddict import OrderedDict
@enaeseth
enaeseth / gist:837628
Created February 21, 2011 20:06
Automatically open NERDTree when running vim with no arguments
function! AutoOpenNERDTree()
if has('gui_running') && argc() == 0
:NERDTree
endif
endfunction
function! AutoFocusAwayFromNERDTree()
if has('gui_running') && argc() == 0
:wincmd l
endif

Another very common justification for the hourglass model is that students must learn it before they move on to more creative forms of writing. It doesn't take much reflection to see that this is nonsense. You don't learn to hit a tennis ball by strapping your upper arm to your body, and when you can manage to make a stroke with this crippling disadvantage, unstrap your arm so you can swing more freely. You learn by trying to hit naturally, if awkwardly, from the outset and, by practice, gradually learn to hit more accurately. The same should apply to writing. The hourglass method has little to do with learning or with writing. Few people who master it go on to write more creative essays. They have been so deeply damaged by their training they're usually too scared to venture beyond it in case they make mistakes. (p. 7)

#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db

Winter 2010

  1. Piano Hero (CS 400, 3 credits)
  2. Database Systems (CS 334, 6 credits, 5a)
  3. British Comedy (ENGL 365, 6 credits, 2a)
import java.net.*; // for DatagramSocket, DatagramPacket, and InetAddress
import java.io.*; // for IOException
public class UDPEchoClientTimeout {
// Resend timeout (milliseconds)
private static final int TIMEOUT = 3000;
// Maximum retransmissions
private static final int MAXTRIES = 5;
public static void main(String[] args) throws IOException {
/**
* Returns the ${2:description}.
* @return ${2:description}
*/
public ${3:String} get${1/./\u$0/}() {
return ${1:fieldName};
}
@enaeseth
enaeseth / example.tex
Created September 24, 2009 02:07
Nested lists in LaTeX
\begin{enumerate}
\setcounter{enumi}{-1} % make counting start at zero instead of one
\item I spent five minutes preparing this example. (0)
\item \begin{enumerate}
\item First sub-problem (1a)
\item Second sub-problem (1b)
\end{enumerate}
\item An answer to a problem with no sub-parts (2)