Skip to content

Instantly share code, notes, and snippets.

View jbaiter's full-sized avatar

Johannes Baiter jbaiter

View GitHub Profile
@jbaiter
jbaiter / gist:9538491
Created March 13, 2014 22:31
Small jpegtran/PyPy benchmark
# Requires jpegtran-cffi
[1] import jpegtran
[2] %timeit -n10 -r5 jpegtran.JPEGImage('someimage.jpg').exif_thumbnail.as_blob()
import logging
import threading
import time
import RPi.GPIO as GPIO
from spreads.plugin import HookPlugin, TriggerHooksMixin
from spreads.util import DeviceException
@jbaiter
jbaiter / gist:4f385a20d7c56410fb10
Last active August 29, 2015 14:04
Installing spreads on a virgin Raspbian installation
Become root:
$ su
Add spreads repository:
echo "deb http://spreads.jbaiter.de/raspbian wheezy main" >> /etc/apt/sources.list
Update system to newest packages:
$ apt-get update
$ apt-get upgrade
@jbaiter
jbaiter / gist:d816c28fe0a73086e1e5
Last active August 29, 2015 14:05
Laser plugin sketch
from spreads.plugin import HookPlugin, CaptureHooksMixin
class LaserPlugin(HookPlugin, CaptureHooksMixin):
def __init__(self, config):
self._counter = 0
self._interval = config['interval'].get(int)
def capture(self, devices, path):
counter += 1
if self._counter % self._interval != 0:
#!/bin/bash
pip -q install -e $GIT_DIR/..

Keybase proof

I hereby claim:

  • I am jbaiter on github.
  • I am jbaiter (https://keybase.io/jbaiter) on keybase.
  • I have a public key whose fingerprint is 5B56 6828 8ADF 7ACC 6C91 6102 F105 9F94 7961 6773

To claim this, I am signing this object:

==12012== Memcheck, a memory error detector
==12012== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==12012== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==12012== Command: /home/jojo/.envs/jpegtran/bin/python2.7-dbg blowup.py /home/jojo/scans/cryptonomicon/data/raw
==12012==
==12012== Invalid read of size 4
==12012== at 0x48EE26: PyObject_Free (obmalloc.c:989)
==12012== by 0x48F9EC: _PyObject_DebugFreeApi (obmalloc.c:1507)
==12012== by 0x48F7EF: _PyMem_DebugFree (obmalloc.c:1429)
==12012== by 0x47EECB: dictresize (dictobject.c:676)
@jbaiter
jbaiter / gist:1072084
Created July 8, 2011 15:28
ff4 dte routine
arch snes.cpu; lorom // Load settings for SNES/WDC65816 in LoROM mode
.org $00b4a2
jsl check_codes_cont
fill 3,$ff
.org $01ecb0
check_codes_cont
cmp #$c3
bne +
@jbaiter
jbaiter / SPC Upload
Created August 8, 2011 23:46
SPC Upload routine that doesn't crash, but whose data doesn't appear in the SMP RAM and which doesn't execute the desired offset according to the trace...
namespace spc
define spcaddr #$0100
define spcexec #$0100
// DESIGN:
// Base address for spc data is fixed
// Specific offset is handed via X register (16bit)
// First 2 bytes of spc data is length
// -> ACL to 8bit, LDA spc_length -> TAY
namespace mute
// FLG register
flag:
dw $000f // length of the code
lda #$6c
sta $f2
lda #$20 // unmute, disable_echo
sta $f3
cmp $f3, #$20
bne flag