Skip to content

Instantly share code, notes, and snippets.


John Whittington tuna-f1sh

View GitHub Profile
tuna-f1sh /
Last active Jan 5, 2021
Async task that updates PIL Image with Game of Life
Game of Life async task that updates passed PIL Image with generations
loosely based on
but fixes the critical bug which runs the frame update loop on a transient grid resulting in wrong behaviour - I don't have enough points to post fix!
Copied from part of a bigger project I'm working on, this can still be run with the python flipdot module imported using a script.
import random, asyncio
from PIL import Image
tuna-f1sh /
Last active Nov 8, 2017 — forked from naholyr/
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.


Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
tuna-f1sh / serial.js
Last active Jul 20, 2017
Serial port buffer unload test
View serial.js
var SerialPort = require('serialport');
var port = new SerialPort('/dev/ttyUSB0', {
baudRate: 4800
port.on('open', function() {
port.write(new Buffer(256), function(err) {
if (err) {
return console.log('Error on write: ', err.message);
tuna-f1sh /
Last active Feb 17, 2017
Convert Atmel Studio auto Makefile to Unix based one
# @j_whittington
# Script to convert makefile generate from atmel studio 7 (windows)
# to linux path, assuming that you have gcc on PATH
# based on
tuna-f1sh /
Created Aug 3, 2016
Convert Proteus gerber export to layer based file extensions
import os,sys
# Get folder
if len(sys.argv) > 1:
folder = sys.argv[1]
# folder = os.path.dirname(os.path.realpath(__file__))
folder = os.getcwd()
convert = {
tuna-f1sh / .bashrc
Created Mar 4, 2016
My portable bashrc
View .bashrc
#enables color in the terminal bash shell export
#sets up the color scheme for list export
# for a colourful vim
export TERM='xterm-256color'
tuna-f1sh / .inputrc
Last active Aug 17, 2016
My portable inputrc
View .inputrc
# use ctrl+left/right arrow keys to jump over words
"\e[5C": forward-word
"\e[5D": backward-word
# enable autocomplete (using up/down arrow keys)
"\e[B": history-search-forward
"\e[A": history-search-backward
# ignore case when autocomplete file/directory name using tab
set completion-ignore-case on
tuna-f1sh / vimrc
Last active Jan 25, 2017
My portable vimrc
View vimrc
set nocompatible "Use vim rather than vi settings
" useful commands for ctags - ]/[i next text under cursor, ]/[d difinition down/up, capital all in file in preview
if has("win32")
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim