Skip to content

Instantly share code, notes, and snippets.

View iwootten's full-sized avatar

Ian Wootten iwootten

View GitHub Profile
import time
import picokeypad as keypad
keypad.init()
keypad.set_brightness(1.0)
lit = 0
last_button_states = 0
colour_index = 0
@iwootten
iwootten / start_docker_compose.sh
Created January 29, 2016 11:45
Use your docker-machine host ip as docker-compose environment variable
sed -e "s/DOCKER_HOST_IP/$(docker-machine ip your-machine-name)/g" docker-compose.yml | docker-compose --file - up
@iwootten
iwootten / talk.py
Created April 26, 2015 08:13
Offspring wanted me to count to 1000000
import subprocess
for i in range(1, 1000001):
subprocess.call(["say", "%d" % i])
@iwootten
iwootten / oiio_convert.py
Last active March 17, 2021 02:44
Simple Python OpenImageIO example
import OpenImageIO as oiio
buf = oiio.ImageBuf("Test_003_02_X1_0001.cr2")
cropped = oiio.ImageBuf()
extended = oiio.ImageBuf(oiio.ImageSpec (3693, 2077, 3, oiio.FLOAT))
resized = oiio.ImageBuf(oiio.ImageSpec (1920, 1080, 3, oiio.FLOAT))
oiio.ImageBufAlgo.crop(cropped, buf, oiio.ROI(108, 3801, 514, 2085), nthreads=4)
oiio.ImageBufAlgo.paste(extended, 0, 253, 0, 0, cropped, nthreads=4)
oiio.ImageBufAlgo.resize(resized, extended, nthreads=4)
oiio.ImageBufAlgo.render_text(resized, 1300, 1030, "00001.cr2", 50, "Arial")
@iwootten
iwootten / server-patch.js
Last active December 23, 2015 21:59
Additions made to Ghosts server.js in order to enable proper upload to db importer
server.use('/ghost/debug/db/import/', express.multipart());
server.use('/ghost/debug/db/import/', express.multipart({uploadDir: __dirname + '/content/data'}));
@iwootten
iwootten / class-ghost.php
Created September 25, 2013 14:30
Changes made to the Wordpress Ghost export plugin to get it to write out
<?php
/**
* Plugin Name.
*
* @package Ghost
* @author Ghost Foundation
* @license GPL-2.0+
* @link http://ghost.org
* @copyright 2013 Ghost Foundation
*/