Skip to content

Instantly share code, notes, and snippets.

View willtim's full-sized avatar

Tim Williams willtim

  • London
View GitHub Profile
@willtim
willtim / git-cheatsheet.txt
Created November 17, 2017 16:43
Git cheatsheet
* Git Cheatsheet
git stash --keep-index
git clean -d -n
git commit --amend (amend last commit)
git reflog (a history of the commits HEAD has been pointed at; undo pulls, rebases etc)
@willtim
willtim / explore.el
Created August 10, 2017 16:29
Emacs project explorer
;; project tree explorer
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; see https://github.com/nathankot/dotemacs/blob/master/init.el
(use-package projectile
:ensure projectile
:config (projectile-global-mode t)
:init
;; (setq projectile-require-project-root nil)
(setq projectile-enable-caching t)
@willtim
willtim / keybase.md
Created April 3, 2017 21:52
Proof of github identity

Keybase proof

I hereby claim:

  • I am willtim on github.
  • I am willtim (https://keybase.io/willtim) on keybase.
  • I have a public key whose fingerprint is 0BE4 0021 BC8C 398F 7BF3 EBD3 5140 CC90 BC07 887C

To claim this, I am signing this object:

@willtim
willtim / .minttyrc
Created January 13, 2017 18:35
minttyrc - zenburn
BoldAsFont=-1
Columns=160
Rows=60
ClipShortcuts=no
CtrlShiftShortcuts=yes
Term=xterm-256color
CursorType=block
# Zenburn scheme - Source: http://slinky.imukuppi.org/zenburnpage/
CursorColour=#BFBFBF
@willtim
willtim / .tmux.conf
Created January 13, 2017 18:34
tmux.conf for cygwin
# Tim Williams .tmux.conf
# Note: can query default bindings with tmux list-keys
# Hierarchy:
# Server
# ㄴSession
# ㄴWindow
# ㄴPane
@willtim
willtim / Prac1_handleKey.hs
Last active August 29, 2015 14:03
Hoodlums: Purely Functional Text Editing
------------------------------------------------------------
-- Hoodlums: Purely Functional Text Editing
--
-- handleKey implementation for Prac1.hs
-- see https://personal.cis.strath.ac.uk/conor.mcbride/CS410/
--
-- Note: you will also need to change the "Here" data type to
-- accomodate a String payload
--
@willtim
willtim / source-annotations.tex
Created June 12, 2014 06:23
Source annotation example in Latex
\documentclass{beamer}
\usepackage{listings}
\usepackage{tikz}
\usetikzlibrary{fit,calc,shadows}
% Define styles for balloons and lines
\tikzstyle{line} = [draw, rounded corners=3pt, -latex]
\tikzstyle{balloon} = [draw, fill=blue!20, opacity=0.4, inner sep=4pt, rounded corners=2pt]
@willtim
willtim / Compiler2.hs
Last active August 29, 2015 14:01
Compiler for an SSA register machine
{-# LANGUAGE NoMonomorphismRestriction #-}
import Control.Applicative
import Control.Monad.State
import Control.Monad.Writer
import Data.IntMap (IntMap)
import qualified Data.IntMap as IM
import Text.ParserCombinators.UU (pChainl)
import Text.ParserCombinators.UU.BasicInstances(pSym)
import Text.ParserCombinators.UU.Utils
@willtim
willtim / Compiler1.hs
Created May 6, 2014 16:54
Compiler for a stack machine
{-# LANGUAGE NoMonomorphismRestriction #-}
import Control.Applicative
import Text.ParserCombinators.UU (pChainl)
import Text.ParserCombinators.UU.BasicInstances(pSym)
import Text.ParserCombinators.UU.Utils
-- | Huttons razor
data Exp = Add Exp Exp
@willtim
willtim / SplitOn.hs
Created April 28, 2014 19:41
Split a string up by occurrences of a substring
import Control.Arrow (second)
import qualified Data.List as L
splitOn :: Eq a => [a] -> [a] -> [[a]]
splitOn sep = L.unfoldr f
where
f [] = Nothing
f xs = Just $ second (drop l) $ breakList (L.isPrefixOf sep) xs
l = length sep