Skip to content

Instantly share code, notes, and snippets.

View drGrove's full-sized avatar
😎

Danny Grove drGrove

😎
View GitHub Profile
// Requires jQuery from http://jquery.com/
// and jQuerySparklines from http://omnipotent.net/jquery.sparkline
// AngularJS directives for jquery sparkline
angular.module('sparkline', []);
angular.module('sparkline')
.directive('jqSparkline', [function () {
'use strict';
return {
@drGrove
drGrove / deploy.sh
Created July 9, 2014 18:45
A Ansible-Playbook Wrapper
#!/bin/bash
FILE=$1
if [ ! -z $2 ]
then
SCRIPTS_PATH=$2
else
if [ ! -z $ANSIBLE_SCRIPTS ]
then
SCRIPTS_PATH=$ANSIBLE_SCRIPTS
else
@drGrove
drGrove / rightmostchar.js
Created May 16, 2014 20:30
Rightmost Char
'use strict'
var fs = require('fs');
fs
.readFileSync(process.argv[2])
.toString()
.split('\n')
.forEach(function(line){
if(line != ""){
line = line.split(',')
var string = line[0];
@drGrove
drGrove / capscr.sh
Created March 29, 2014 00:57
Capscr
#!/bin/bash
timestamp="$(date +%y%m%d%H%M%S)"
targetbase="$HOME/capscr"
mkdir -p $targetbase
[ -d $targetbase ] || exit 1
import $targetbase/$timestamp.png
@drGrove
drGrove / glass.html
Created March 25, 2014 23:50
[wearscript] Crazyflie Glass Driver
<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>-->
<script data-require="jquery" data-semver="2.0.3" src="http://code.jquery.com/jquery-2.0.3.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>
WS.log('Wearscript CrazyFlie Driver');
@drGrove
drGrove / glass.html
Created March 24, 2014 22:10
[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 ){
@drGrove
drGrove / glass.html
Created March 24, 2014 21:48 — forked from bwhite/glass.html
[wearscript] Myo Demo
<html style="width:100%; height:100%; overflow:hidden">
<body style="width:100%; height:100%; overflow:hidden; margin:0">
<script>
function server() {
setTimeout(WS.myoTrain, 250);
return;
WS.gestureCallback('onMyo', function (x) {
WS.say(x);
});
WS.sensorOn('myoOrientation', .15, function (data) {
@drGrove
drGrove / glass.html
Created March 24, 2014 21:11
[wearscript] Simple
<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>
WS.log('Welcome to WearScript');
@drGrove
drGrove / glass.html
Created March 24, 2014 20:18 — forked from coryk135/glass.html
[wearscript] Myo
<html>
<head>
<meta charset="utf-8">
<title>2048</title>
<style>
html, body {
margin: 0;
padding: 0;
background: #faf8ef;
@drGrove
drGrove / dkafljd.html
Created March 23, 2014 02:52
[wearscript] test
fdakfdjlakj