Skip to content

Instantly share code, notes, and snippets.

@connerbrooks
connerbrooks / glass.html
Created March 3, 2014 22:24
[wearscript]
<html style="width:100%; height:100%; overflow:hidden">
<body style="width:100%; height:100%; overflow:hidden; margin:0">
<script>
function main() {
if (WS.scriptVersion(1)) return;
WS.pebbleSetBody('connected!', false);
WS.gestureCallback('onPebbleSingleClick', function (name) {
WS.log('onPebbleSingleClick: ' + name);
switch (name) {
@connerbrooks
connerbrooks / wearscript-pebble.html
Last active August 29, 2015 13:56
Wearscript-pebble example
<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>
<!--currently works with a phone running WS connected to a pebble, running the Pebble Watch app from wearscript-pebble-->
@connerbrooks
connerbrooks / glass.html
Created March 5, 2014 16:00
[wearscript] Pebble API
<html style="width:100%; height:100%; overflow:hidden">
<body style="width:100%; height:100%; overflow:hidden; margin:0">
<script data-require="jquery" data-semver="2.0.3" src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
<script>
function main() {
if (WS.scriptVersion(1)) return;
WS.gestureCallback('onPebbleSingleClick', function (name) {
WS.log('onPebbleSingleClick: ' + name);
WS.pebbleSetTitle('Robot Control');
@connerbrooks
connerbrooks / gabydothis.md
Created March 21, 2014 19:39
Gabydothis.com

Here is how you make a webapp in 5 minutes

  • Set up dev environment
    • Install brew a pacage manager for mac
    • Install node package manager with brew, another package mananger (don't worry I think thats all of these)
    brew install npm
    
    • Install yo this will also install grunt and bower
      • read the getting started on that link
@connerbrooks
connerbrooks / glass.html
Created March 24, 2014 23:40
[wearscript] Myo Setup
<html style="width:100%; height:100%; overflow:hidden">
<body style="width:100%; height:100%; overflow:hidden; margin:0">
<script>
function server() {
//WS.myoTrain();
WS.say("myo stuff");
// Currently one of {NONE, FIST, FINGERS_SPREAD, WAVE_IN, WAVE_OUT}
WS.subscribe('myoEvent', function (chan, data) {
switch(data) {
case 'FINGERS_SPREAD':
@connerbrooks
connerbrooks / glass.html
Created March 25, 2014 01:59 — forked from drGrove/glass.html
[wearscript] Myo Hue
<html style="width:100%; height:100%; overflow:hidden">
<body style="width:100%; height:100%; overflow:hidden; margin:0; background: #000;">
<script data-require="jquery" data-semver="2.0.3" src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
<script>
function server() {
WS.say('Welcome to Wearscript Hue Glass Demo')
WS.log('Welcome to Wearscript Hue Glass Demo')
var numHue = 3;
function updateHue( hueState ){
@connerbrooks
connerbrooks / glass.html
Created March 25, 2014 02:08
[wearscript] Hue->Myo control
<html style="width:100%; height:100%; overflow:hidden">
<body style="width:100%; height:100%; overflow:hidden; margin:0">
<script data-require="jquery" data-semver="2.0.3" src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
<script>
function server() {
WS.say('I am phone')
WS.log('I am a phone')
WS.myoTrain();
// Currently one of {NONE, FIST, FINGERS_SPREAD, WAVE_IN, WAVE_OUT}
@connerbrooks
connerbrooks / glass.html
Created March 25, 2014 20:15 — forked from coryk135/glass.html
[wearscript] pokebattle
<html style="width:100%; height:100%; overflow:hidden">
<head>
<style>
#screen{
height: 360px;
width: 640px;
font-family: helvetica;
background: url("http://www.pokemontopaz.net/uploads/misc/battlegrass.png");
background-repeat: no-repeat;
background-size: 640px 360px;
@connerbrooks
connerbrooks / glass.html
Created March 26, 2014 21:40
[wearscript] Pebble->Glass Control
<html style="width:100%; height:100%; overflow:hidden">
<body style="width:100%; height:100%; overflow:hidden; margin:0">
<script>
function main() {
if (WS.scriptVersion(1)) return;
WS.pebbleSetTitle('Pebble->Glass Control');
WS.pebbleSetSubtitle('');
WS.pebbleSetBody('connected!', false);
WS.say('connected');
@connerbrooks
connerbrooks / glass.html
Created March 26, 2014 21:41 — forked from kurtisnelson/glass.html
[wearscript] Control your Glass with Myo, Pebble, or Magnets
<html style="width:100%; height:100%; overflow:hidden">
<body style="width:100%; height:100%; overflow:hidden; margin:0">
<script>
function server() {
WS.myoTrain();
WS.say("ready");
WS.pebbleSetBody('connected!', false);
// Currently one of {NONE, FIST, FINGERS_SPREAD, WAVE_IN, WAVE_OUT}
WS.gestureCallback('onMyo', function (x) {
if(x == "WAVE_IN"){