Skip to content

Instantly share code, notes, and snippets.

#Set up a Node.js environment
language: node_js
node_js:
- '0.10'
env:
global:
secure: "ecVAPtm1YNT4USYEbG5lnLnQ9pBWSDKHdjhUbQSk35UvunixLOvU/oeHzWqTIoDxEFKf0HehSXW9tM569bsBZth9O7WBwJAhSNkUrPVF4WDT1p+zsuakSZuZTAEVCqbeL+pPdVR968ML1UKP0hLgTbgDvM9HpyM4YQxVAOXfskI="
#Include the Sauce Connect plugin to allow tunneling.
@bitdivision
bitdivision / Full_rx.c
Last active August 29, 2015 14:07
Scripts to accompany Zoetrope Blog Post
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
#include "printf.h"
// Hardware configuration: Set up nRF24L01 radio on SPI bus plus pins 9 & 10 for CE and CSn
RF24 radio(9,10);
uint64_t addresses[] = {0x5544332200LL,0x5544332201LL};
@bitdivision
bitdivision / EncodingCommands.sh
Last active August 29, 2015 14:06
Zoetrope Encoding Commands
### Gif
convert -delay 20 -loop 0 *.jpg output.gif
### WebP (lossless)
for file in *.jpg; do cwebp -lossless ${file} -o ${file%.jpg}.webp; done
webpmux -frame 0000.webp +0+0+200 ... -o output.webp
### WebP (lossy)
for file in *.jpg; do cwebp ${file} -o ${file%.jpg}.webp; done
webpmux -frame 0000.webp +0+0+200 ... -o output.webp
### x264 (lossless)
ffmpeg -r 8 -i %04d.jpg -vcodec libx264 -crf 0 -y output.mp4
var testPage = require('./testPage.js');
var protractor = require('protractor');
describe('Desktop testing', function() {
it('should display the widget when a zBoxElement is tapped', function() {
testPage.navigate();
testPage.openWidget();
expect(testPage.widgetColorbox.isDisplayed()).toBe(true);
});
});
### Keybase proof
I hereby claim:
* I am bitdivision on github.
* I am rfwebb (https://keybase.io/rfwebb) on keybase.
* I have a public key whose fingerprint is 014C 1CDC A774 028B 41DC 5523 99B9 54C8 BB77 17F2
To claim this, I am signing this object:
@bitdivision
bitdivision / mjpeg.py
Created April 28, 2014 09:53
Simple stream from DSLR with autofocus
#!/usr/bin/python
'''
Author: Zoetrope Ltd.
MJPEG stream from DSLR with autofocus
Based on Igor Maculan's simple mjpg http server:
https://gist.github.com/n3wtron/4624820
'''
import camera
from PIL import Image, ImageFilter, ImageChops, ImageStat, ImageDraw
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer
@bitdivision
bitdivision / estimateFocus.py
Last active August 29, 2015 14:00
Function to estimate focus in an image region
def estimateFocus(file, s=5):
im = Image.open(file).convert("L")
w,h = im.size
box = (w/2 - 50, h/2 - 50, w/2 + 50, h/2 + 50)
im = im.crop(box)
imf = im.filter(ImageFilter.MedianFilter(s))
d = ImageChops.subtract(im, imf, 1, 100)
return ImageStat.Stat(d).stddev[0]
@bitdivision
bitdivision / SetManualFocus.py
Last active August 29, 2015 14:00
Function to drive focus motor
def setManualFocus(cam, focusPoint):
focusList = ['Near 1', 'Near 2', 'Near 3', 'None', 'Far 1', 'Far 2', 'Far 3']
conf = camera.Config(cam)
root = conf.get_root_widget()
child = root.get_child_by_name("manualfocusdrive")
child.set_value(focusList[focusPoint])
conf.set_config()
@bitdivision
bitdivision / MJPEG.py
Last active August 29, 2015 14:00
Simple DSLR MJPEG Server
#!/usr/bin/python2.7
'''
Author: Igor Maculan - [email protected]
A Simple mjpg stream http server
Modified for DSLR interface by Zoetrope Ltd.
'''
from PIL import Image
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer
import StringIO
@bitdivision
bitdivision / imageCapture.py
Last active August 29, 2015 14:00
Simple DSLR Image Capture
import camera
capture = camera.Camera()
capture.capture_to_file('image.jpg')