Skip to content

Instantly share code, notes, and snippets.

View soundanalogous's full-sized avatar

Jeff Hoefs soundanalogous

  • San Francisco, CA
View GitHub Profile
@soundanalogous
soundanalogous / AccelerometerBMA250
Last active August 29, 2015 13:57
Experimental BMA250 module for Breakout.js
/**
* Copyright (c) 2011-2014 Jeff Hoefs <soundanalogous@gmail.com>
* Released under the MIT license. See LICENSE file for details.
*/
JSUTILS.namespace('BO.io.AccelerometerBMA250');
/**
* @namespace BO.io
*/
@soundanalogous
soundanalogous / bma250
Created March 29, 2014 19:33
BMA250 example
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<style type="text/css">
body {
margin: 15px;
font-family: sans-serif;
@soundanalogous
soundanalogous / NetworkFirmata.ino
Last active August 29, 2015 14:15
StandardFirmata features + Stepper motor + Ethernet
/*
* Firmata is a generic protocol for communicating with microcontrollers
* from software on a host computer. It is intended to work with
* any host computer software package.
*/
/*
Copyright (C) 2006-2008 Hans-Christoph Steiner. All rights reserved.
Copyright (C) 2010-2011 Paul Stoffregen. All rights reserved.
Copyright (C) 2009 Shigeru Kobayashi. All rights reserved.
@soundanalogous
soundanalogous / ConfigurableFirmataYun.ino
Created June 24, 2015 03:23
ConfigurableFirmata for Arduino Yun
/*
Firmata is a generic protocol for communicating with microcontrollers
from software on a host computer. It is intended to work with
any host computer software package.
To download a host software package, please clink on the following link
to open the download page in your default browser.
https://github.com/firmata/ConfigurableFirmata#firmata-client-libraries
Copyright (C) 2006-2008 Hans-Christoph Steiner. All rights reserved.
Copyright (C) 2010-2011 Paul Stoffregen. All rights reserved.
Copyright (C) 2009 Shigeru Kobayashi. All rights reserved.
// BIND FIX FOR OLDER BROWSERS
if( Function.prototype.bind ) {
} else {
/** safari, why you no bind!? */
Function.prototype.bind = function (bind) {
var self = this;
return function () {
var args = Array.prototype.slice.call(arguments);
return self.apply(bind || null, args);
};
@soundanalogous
soundanalogous / jquery.ba-tinypubsub.js
Created October 1, 2012 21:15 — forked from cowboy/HEY-YOU.md
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011
* http://benalman.com/
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */
(function($) {
var o = $({});
$.subscribe = function() {
o.on.apply(o, arguments);
@soundanalogous
soundanalogous / unsigned-apk.md
Last active October 29, 2015 22:54
creating unsigned apk from Processing Android mode
  1. From the Processing menu, select: File > Export Android Project
  2. From your shell (Terminal), navigate to your the android directory that was created in the project folder
  3. Run: ant release
  4. Sign the build. From the android directory run: jarsigner -verbose -keystore ~/.android/debug.keystore -storepass android -keypass android bin/YOUR_APP_NAME.apk androiddebugkey
@soundanalogous
soundanalogous / serialHW.js
Created November 3, 2015 06:43
example of connecting to a serial device using BreakoutJS
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>Serial</title>
<!-- The following (socket.io.js) is only required when using the node_server -->
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Hello World</title>
</head>
<body>
<button id="ledToggle">Toggle LED</button>
<p id="btnStatus"></p>
<script src="../../dist/Breakout.js"></script>
// treat the scope as read-only in views
// treat the scope as write-only in controllers
/**
* use attrs to read from scope
*/
<div my-attribute="propName">
app.directive('myDirective', function () {