This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Struct utilities | |
# Author:: Matt Sullivan (mailto:[email protected]) | |
# Attempt to require Ruby Gems; 1.8.X gem support only | |
begin | |
require 'rubygems' | |
rescue LoadError | |
# Ruby Gems not installed | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Remote API wrapper for Locksmith | |
""" | |
import urllib | |
import urllib2 | |
import json | |
LOCKSMITH_HOST = 'https://locksmith.artsalliancemedia.com' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import struct | |
# MXF Keys | |
MXF_KEYS = { | |
'\x06\x0e\x2b\x34\x02\x53\x01\x01\x0d\x01\x01\x01\x01\x01\x51\x00' : 'MPEG2VIDEODESCRIPTOR', | |
'\x06\x0e\x2b\x34\x02\x53\x01\x01\x0d\x01\x01\x01\x01\x01\x5a\x00' : 'JPEG2000PICTURESUBDESCRIPTOR', | |
'\x06\x0e\x2b\x34\x02\x53\x01\x01\x0d\x01\x01\x01\x01\x01\x48\x00' : 'WAVEAUDIODESCRIPTOR', | |
'\x06\x0e\x2b\x34\x02\x53\x01\x01\x0d\x01\x01\x01\x01\x01\x37\x00' : 'SOURCEPACKAGE', | |
'\x06\x0e\x2b\x34\x01\x02\x01\x01\x0d\x01\x03\x01\x15\x01\x05\x00' : 'MPEG2ESSENCE', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var MuxDemux = require('mux-demux'); | |
var net = require('net'); | |
var Model = require('scuttlebutt/model'); | |
var aModel = new Model | |
var aModelStream = aModel.createStream() | |
var bModel = new Model | |
var bModelStream = bModel.createStream() | |
// Server |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Parses out motion data from the Axis camera motion stream | |
*/ | |
var util = require('util'), | |
Stream = require('stream').Stream | |
var MotionLevelStream = function() { | |
this.readable = true | |
this.writable = true | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Parses out motion data from the Axis camera motion stream | |
* Implemented with the new Node streams using prototypes | |
*/ | |
var Transform = require('stream').Transform | |
var MotionLevelStream = function() { | |
Transform.call(this, {objectMode: true}) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Parses out motion data from the Axis camera motion stream | |
* Implemented with the new Node streams | |
*/ | |
var stream = require('stream'), | |
util = require('util') | |
var MotionLevelStream = function() { | |
stream.Transform.call(this, {objectMode: true}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os.path | |
import shutil | |
import hashlib | |
import logging | |
# Support both Python 2 and 3 urllib2 importing | |
try: | |
from urllib.request import urlopen, Request | |
except ImportError: | |
from urllib2 import urlopen, Request |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.wear; | |
import android.app.Activity; | |
import android.hardware.Sensor; | |
import android.hardware.SensorEvent; | |
import android.hardware.SensorEventListener; | |
import android.hardware.SensorManager; | |
import android.os.Bundle; | |
import android.support.wearable.view.WatchViewStub; | |
import android.util.Log; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Updated example from http://rosettacode.org/wiki/Hello_world/Web_server#Rust | |
// to work with Rust 1.0 beta | |
use std::net::{TcpStream, TcpListener}; | |
use std::io::{Read, Write}; | |
use std::thread; | |
fn handle_read(mut stream: &TcpStream) { | |
let mut buf = [0u8 ;4096]; |
OlderNewer