Skip to content

Instantly share code, notes, and snippets.

@garrows
garrows / SetupBluetooth.ino
Last active December 17, 2022 12:30
Configure HC-06 bluetooth chip to work with the Johnny-Five javascript robotics library
/*
This is for configuring the hc-06 bluetooth chip to work with Johnny-Five javascript robotics library.
Might also work with the hc-05.
Author: Glen Arrowsmith (@garrows)
*/
#define ROBOT_NAME "RandomBot"
@garrows
garrows / debuggingGaffa.md
Last active August 29, 2015 13:57
Debugging Gaffa

Debugging Gaffa

Inspect element. Click it. The selected element is now $0 in the javascript console

$0.viewModel
$0.viewModel.enabled
$0.viewModel.enabled.binding
$0.viewModel.enabled.value
@garrows
garrows / gulpfile.js
Last active August 29, 2015 13:57
Gulp watch with LiveReload
var gulp = require('gulp'),
compress = require('gulp-uglify'),
stylus = require('gulp-stylus'),
concat = require('gulp-concat'),
browserify = require('gulp-browserify'),
livereload = require('gulp-livereload');
var liveReloadServer = livereload();
gulp.task('styles', function() {
@garrows
garrows / ProxyEventer.js
Last active December 24, 2015 11:09
Simple proxy and event listener
MyObject.prototype.on = function (eventName, callback) {
if (this.eventListeners[eventName] == undefined) {
this.eventListeners[eventName] = [];
}
if (typeof callback == "function") {
this.eventListeners[eventName].push(callback);
} else {
throw "can not subscribe with a non function callback";
}
}