Skip to content

Instantly share code, notes, and snippets.

View sneeu's full-sized avatar
🦀
Hi

John Sutherland sneeu

🦀
Hi
View GitHub Profile
import random
import threading
import time
SPEED = 0.5
class Tamagotchi(object):
def __init__(self, name):
>>> class A(object):
... def __init__(self, a):
... self.a = a
... @classmethod
... def f(cls, a):
... return cls(a)
...
>>> class B(A):
... def __init__(self, a, b):
... super(B, self).__init__(a)

# Advanced Git: edPUG, July 2014

rm -rf example-repo
export GIT_COMMITTER_DATE="2014-07-15 19:01:00"

saystd "Advanced git"

Good evening.

clear; fanduel.sh | lolcat

def fizzbuzz():
for i in itertools.count(1):
if i % 15 == 0: yield 'Fizzbuzz'
elif i % 3 == 0: yield 'Fizz'
elif i % 5 == 0: yield 'Buzz'
else: yield i
@sneeu
sneeu / requirements
Last active August 29, 2015 13:58 — forked from judy2k/gitignore
#!/usr/bin/env bash
# To add two items to the current .gitignore file:
# requirement Django South
#
# To sort and de-dupe the current .gitignore file:
# requirement
args=( $@ )
args_len=${#args[@]}
requirements_file=${args[args_$len-1]}
# URLs:
# url('new/$', author_edit, name='author_new')
# url('(?P<author_id>\d+)/$', author_edit, name='author_edit')
def author_edit(request, author_id=None):
author = None
if author_id:

Keybase proof

I hereby claim:

  • I am sneeu on github.
  • I am sneeu (https://keybase.io/sneeu) on keybase.
  • I have a public key whose fingerprint is F1C1 4E72 FA47 500C D22F 1381 02BF 06E7 6310 142E

To claim this, I am signing this object:

@sneeu
sneeu / .vimrc
Last active August 29, 2015 13:56
set tabstop=4 shiftwidth=4 softtabstop=4
set expandtab
autocmd FileType css setlocal ts=4 sts=4 sw=4 noexpandtab
autocmd FileType html setlocal ts=4 sts=4 sw=4 noexpandtab
autocmd FileType xml setlocal ts=4 sts=4 sw=4 noexpandtab
autocmd FileType htmldjango setlocal ts=4 sts=4 sw=4 noexpandtab
autocmd FileType javascript setlocal ts=4 sts=4 sw=4 noexpandtab
autocmd FileType mustache setlocal ts=4 sts=4 sw=4 noexpandtab
autocmd FileType markdown setlocal ts=4 sts=4 sw=4 expandtab spell spelllang=en_gb

tmux intro

What is it?

A terminal multiplexer, much like screen.

Allows you to run multiple virtual terminals in a single terminal.

Why is it better than screen?

(def names ["John" "Gordon" "Dom" "Jamie" "Stuart" "Ben"])
(let [shuffled-names (shuffle names)]
(println (apply str (interpose " buys for " (cons (last shuffled-names) shuffled-names)))))