Skip to content

Instantly share code, notes, and snippets.

@jnwhiteh
jnwhiteh / main.tex
Created May 14, 2012 09:45
LatexBox_GetTexRoot issue
\documentclass{article}
\begin{document}
\include{section1}
\end{document}
@jnwhiteh
jnwhiteh / common.vim
Created March 13, 2012 10:13
Add support for %! TEX root = foo.tex to LatexBox
" 2a. scan current file for %! TEX root = foo.tex
let texfile = matchlist(getline(1), '%!TEX root = \(.*\)')[1]
if texfile != ""
return texfile
endif
@jnwhiteh
jnwhiteh / Makefile
Created September 5, 2011 17:57
Problem with channel receive
include $(GOROOT)/src/Make.inc
TARG=foo
GOFILES=\
foo.go \
include $(GOROOT)/src/Make.pkg
@jnwhiteh
jnwhiteh / install-ljitrocks.sh
Created August 4, 2011 14:49
Install luajit+luarocks in sandboxed environment
#!/usr/bin/env bash
set -e
die() {
echo "$1";
exit 1;
}
# Fetch and install LuaJIT/LuaRocks into the local directory
@jnwhiteh
jnwhiteh / updatecontacts.py
Created July 26, 2011 11:57
Update contacts using Google contacts API
import atom
import re
import gdata.contacts.data
import gdata.contacts.client
import gdata.gauth
# This script updates all contacts with email addresses @comlab.ox.ac.uk to
# @cs.ox.ac.uk to go along with the renaming of our department.
sourcename = "some-name-for-this-script-v1"
@jnwhiteh
jnwhiteh / install.sh
Created June 13, 2011 16:14
lua+luarocks in sandboxed environment
#!/usr/bin/env bash
set -e
die() {
echo "$1";
exit 1;
}
# Fetch and install Lua/LuaRocks/Kepler into the local directory
@jnwhiteh
jnwhiteh / install_mongrel2.sh
Created December 2, 2010 11:58
Script that can be used to install zeromq/mongrel2 into a sandboxed environment
# Installs Mongrel/ZeroMQ/Sqlite into a sandboxed environment
set -o errexit
set -o nounset
PWD=`pwd`
SANDBOX="$PWD/sandbox"
mkdir -p "$SANDBOX/src"
pushd "$SANDBOX/src"
#!/usr/bin/env bash
set -e
die() {
echo "$1";
exit 1;
}
# Fetch and install Lua/LuaRocks into the local directory
require 'formula'
class Go <Formula
head 'https://go.googlecode.com/hg/', :revision => 'release'
homepage 'http://golang.org'
aka 'google-go'
skip_clean 'bin'
import Criterion
import Criterion.Main
import System.IO
import Data.Text (Text(..))
import qualified Data.Text as T
import qualified Data.Text.IO as TIO
lipsum = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ultricies nulla sapien. Mauris eget dui eros. Vivamus eleifend condimentum leo sit amet tempus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vestibulum auctor mattis ante vitae dictum. Praesent sed lacus nisl. In molestie ultricies lorem, non pulvinar felis bibendum a. Donec id urna eget enim tincidunt condimentum. Curabitur id nibh ut risus tincidunt faucibus sit amet ut augue. Mauris aliquet leo elementum dui convallis egestas. Curabitur consequat lobortis dapibus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas."
tlipsum = (T.pack lipsum)