Skip to content

Instantly share code, notes, and snippets.


Matthew Johnson copperlight

View GitHub Profile
import bz2
import fnmatch
import gzip
import os
import re
from typing import Callable, Generator, List, Optional, Pattern, Tuple
Generators for building log processing pipelines.
copperlight /
Last active Aug 19, 2019
Raspbian Stretch ALSA Config for PyAudio
copperlight /
Last active Aug 17, 2019
Install Python 3.7 on Raspbian Stretch
sudo apt-get install screen
View pet-snippet.toml
description = "list remote branches"
command = "git branch -r"
output = ""
description = "list all local and remote branches"
command = "git branch -a"
output = ""
copperlight / .bashrc
Created Aug 11, 2016
Window Subsystem for Linux ssh-agent Configuraton
View .bashrc
# ... more above ...
# wsfl bash is not a login shell
if [ -d "$HOME/bin" ] ; then
# ssh-agent configuration
if [ -z "$(pgrep ssh-agent)" ]; then
rm -rf /tmp/ssh-*
copperlight /
Last active Jun 8, 2016 — forked from ourway/
Running a bottle app with gunicorn
from bottle import Bottle
app = Bottle()
def index():
'''test me'''
return '<h1>Hello Bottle!</h1>''localhost', port=8080, server='gunicorn', reload=True, workers=4, debug=True)
def diamond(width, offset):
for w in (range(1, width) + range(width, 0, -1))[::2]:
print " " * offset,
print " " * int((width - w) / 2),
print "x" * w
View fizzbuzz.clj
(defn fizzbuzz [start end]
(doseq [n (range start end)]
(zero? (mod n 15)) (println "FizzBuzz")
(zero? (mod n 5)) (println "Buzz")
(zero? (mod n 3)) (println "Fizz")
:else (println n))))
View diamond.clj
(defn diamond [width offset]
(doseq [w (take-nth 2 (concat (range 1 width) (range width 0 -1)))]
(print (apply str (repeat offset " ")))
(print (apply str (repeat (/ (- width w) 2) " ")))
(print (apply str (repeat w "x")))