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
Last active August 29, 2015 13:57
[wearscript] stop wearscript
<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">
<script>
function main() {
if (WS.scriptVersion(1)) return;
@scottgwald
scottgwald / README.md
Last active August 29, 2015 13:57
[wearscript] gather magnetic field data

How to use

Overall steps:

  • Copy/paste glass.html into the WearScript playground to run data collection for a while.
  • When ready, launch the Stop card in WearScript to halt data collection.
  • On your computer, clone this gist: git clone https://gist.github.com/9612993.git
  • Enter the directory with the code: cd 9612993
  • Plug in Glass / phone / tablet and make sure adb has recognized it adb devices.
  • Run script chmod +x unpack.sh &amp;&amp; ./unpack.sh
@scottgwald
scottgwald / glass.html
Last active August 29, 2015 13:57
[wearscript] GlassProv2
<html>
<body>
<script>
var me;
function main() {
WS.serverConnect('{{WSUrl}}', function () {
// WS.say("Server connected yeah.");
console.log(WSRAW.getGlassID());
me = WSRAW.getGlassID();
console.log(me);
@scottgwald
scottgwald / glass.html
Created March 24, 2014 18:48
glassprov for kurt
<html>
<body>
<script>
var me;
function main() {
WS.serverConnect('ws://glassprov.media.mit.edu:8080/ws', function () {
// WS.say("Server connected yeah.");
console.log(WSRAW.getGlassID());
me = WSRAW.getGlassID();
console.log(me);
@scottgwald
scottgwald / glass.html
Created March 29, 2014 06:43
[wearscript] goofin around
<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>
function server() {
@scottgwald
scottgwald / glass.html
Created March 31, 2014 06:29
[wearscript] card with new photo
<html>
<head>
<title>Nothing in particular</title>
<script src="https://raw.github.com/janl/mustache.js/master/mustache.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/zepto/1.0/zepto.min.js"></script>
</head>
<body>
<script type="text/html" id="tpl_card0">
<article>
<section>
@scottgwald
scottgwald / glass.html
Last active August 29, 2015 13:58
[wearscript] AprilFool
<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
Created April 10, 2014 21:29
[wearscript] nametagz
<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>
@scottgwald
scottgwald / glass.html
Created April 13, 2014 19:44
[wearscript] testes
<html>
</html>
@scottgwald
scottgwald / glass.html
Created April 13, 2014 19:47
[wearscript] testes 123
<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>
function server() {