Skip to content

Instantly share code, notes, and snippets.

View scottgwald's full-sized avatar

Scott W. Greenwald scottgwald

View GitHub Profile
@scottgwald
scottgwald / glass.html
Created February 7, 2014 21:21 — forked from bwhite/glass.html
[wearscript] All gestures get logged to the console and the onGesture results are spoken aloud
<html style="width:100%; height:100%; overflow:hidden">
<body style="width:100%; height:100%; overflow:hidden; margin:0">
<canvas id="canvas" width="640" height="360" style="display:block"></canvas>
<script>
function show(msg) {
WS.log(msg)
WS.cardModify(0, WS.cardFactory(msg, ''));
}
function onGesture(gesture) {
@scottgwald
scottgwald / glass.html
Last active August 29, 2015 13:56 — forked from bwhite/glass.html
[wearscript] Eye tracker calibration
<html style="width:100%; height:100%; overflow:hidden">
<head><script src="https://api.picar.us/wearscriptdev/bower_components/msgpack-javascript/msgpack.js"></script></head>
<body style="width:100%; height:100%; overflow:hidden; margin:0">
<canvas id="canvas" width="640" height="360" style="display:block"></canvas>
<script>
function publish() {
var data = msgpack.pack(Array.prototype.slice.call(arguments));
WS.publish(arguments[0], btoa(data.map(function (x) {return String.fromCharCode(x)}).join('')));
}
@scottgwald
scottgwald / glass.html
Created March 1, 2014 02:45 — forked from bwhite/glass.html
[wearscript] card tree example
<html style="width:100%; height:100%; overflow:hidden">
<body style="width:100%; height:100%; overflow:hidden; margin:0">
<script>
function server() {
WS.displayCardTree();
var select = function () {WS.say('select')};
var tap = function () {};
var select = function (n) {return function () {WS.say('select ' + n);WS.log('select ' + n)}};
var log = function (n) {return function () {WS.log('log ' + n)}};
var tap = function (n) {return function () {WS.say('tap ' + n);WS.log('tap ' + n)}};
@scottgwald
scottgwald / glass.html
Last active August 29, 2015 13:57 — forked from suryabhupa/glass.html
[wearscript] space ship
<html style="width:100%; height:100%; overflow:hidden">
<head>
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/zepto/1.0/zepto.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script>-->
</head>
<body style="width:100%; height:100%; overflow:hidden; margin:0">
<canvas id="canvas" width="640" height="360" style="display:block"></canvas>
<script>
function showImage(imageDataArray) {
WS.say("Got your image");
@scottgwald
scottgwald / cpu.js
Created April 17, 2014 01:48 — forked from bwhite/cpu.js
/*
JSNES, based on Jamie Sanders' vNES
Copyright (C) 2010 Ben Firshman
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@scottgwald
scottgwald / glass.html
Last active August 29, 2015 14:00
[wearscript] popdeals
<html style="width:100%; height:100%; overflow:hidden">
<head>
<style type="text/css">
body {
background: url("http://web.mit.edu/birkanu/www/popdeals-logo.png");
width: 100%;
height: 100%;
overflow: hidden;
margin: 0;
}
@scottgwald
scottgwald / glass.html
Last active August 29, 2015 14:01 — forked from kevint2u/glass.html
[wearscript] kevin app
<html style="width:100%; height:100%; overflow:hidden">
<head>
<!-- You can include external scripts here like so... -->
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/zepto/1.0/zepto.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script>-->
</head>
<body style="width:100%; height:100%; overflow:hidden; margin:0">
<canvas id="canvas" width="640" height="360" style="display:block"></canvas>
<script>
// Constants
@scottgwald
scottgwald / glass.html
Last active August 29, 2015 14:01 — forked from birkanu/popdeals.html
[wearscript] pop deals new
<html style="width:100%; height:100%; overflow:hidden">
<head>
<style type="text/css">
body {
background: url("http://web.mit.edu/birkanu/www/popdeals-logo.png");
width: 100%;
height: 100%;
overflow: hidden;
margin: 0;
}
@scottgwald
scottgwald / glass.html
Created May 17, 2014 01:40 — forked from bwhite/glass.html
[wearscript] AR tag reader, new syntax
<html style="width:100%; height:100%; overflow:hidden">
<body style="width:100%; height:100%; overflow:hidden; margin:0" bgcolor="#000">
<script>
function main() {
if (WS.scriptVersion(1)) return;
WS.picarusARTagFactory(function (model) {
model.processStream(function (tags) {
WS.log(JSON.stringify(tags));
var out = 'Tag';
for (var i = 0; i < tags.length; i++)
<html style="width:100%; height:100%; overflow:hidden">
<head>
<!-- You can include external scripts here like so... -->
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/zepto/1.0/zepto.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script>-->
</head>
<body style="width:100%; height:100%; overflow:hidden; margin:0">
<canvas id="canvas" width="640" height="360" style="display:block"></canvas>
<script>
// Constants