Skip to content

Instantly share code, notes, and snippets.

View pdex's full-sized avatar
🌴
On vacation

Chris Keating pdex

🌴
On vacation
View GitHub Profile
@pdex
pdex / Rona-songs.md
Last active March 21, 2020 06:38
Rona songs
@pdex
pdex / devtop-bootstrap.sh
Last active May 31, 2022 20:06
devtop bootstrap
#!/bin/bash
sudo apt-get update
sudo apt-get install -y tmux htop git-core openjdk-11-jdk-headless tree docker.io
sudo usermod -aG docker $(whoami)
echo '*.swp' > .gitignore_global
cat > .tmux.conf <<EOF
title: "Lane Fujita - Star Wars: The Force Awakens"
emojis:
- name: starwars
src: http://lanefujita.com/emoji/images/starwars.gif
- name: "true"
src: http://lanefujita.com/emoji/images/true.gif
- name: bb8
src: http://lanefujita.com/emoji/images/bb8.gif
- name: rey
src: http://lanefujita.com/emoji/images/rey.gif
export MARKPATH=$HOME/.marks.d
function jump {
if [[ -z "$1" ]]; then
echo "usage: jump markname"
else
if [[ -L "$MARKPATH/$1" ]]; then
cd -P "$MARKPATH/$1" 2>/dev/null
else
echo "No such mark: '$1'"
fi

Keybase proof

I hereby claim:

  • I am pdex on github.
  • I am pdex (https://keybase.io/pdex) on keybase.
  • I have a public key whose fingerprint is F916 1337 8197 C3A4 D26B 8410 5071 6D14 100E D501

To claim this, I am signing this object:

@pdex
pdex / iterfoo.py
Created August 27, 2012 17:31
iterator decorators / function composition
#!/usr/bin/python
import itertools
def iterchain( fn ):
def new( *iterables ):
return itertools.imap( fn, *iterables )
return new
def itersink( fn ):
def new( *iterables ):
@pdex
pdex / .vimrc
Created May 10, 2012 18:43
vim session file magic
"session magic
function! SaveSession()
"v:this_session is set (by vim) to the last loaded or saved session file
if v:this_session != ""
echo 'Saving session "' . v:this_session . '"'
execute 'mksession! ' . v:this_session
endif
endfunction
au VimLeave * :call SaveSession()
@pdex
pdex / bwarz.py
Created February 16, 2010 19:01
Baseball Warz!
#!/usr/bin/python
""" This is a rough draft of ccumby's dream world """
class Territory:
#TODO should there be different kinds of terrain?
def __init__(self):
self.occupier = None
class Team:
def __init__(self, name):