Skip to content

Instantly share code, notes, and snippets.

View jacobrosenthal's full-sized avatar

Jacob Rosenthal jacobrosenthal

View GitHub Profile
@jacobrosenthal
jacobrosenthal / index.ios.js
Last active September 23, 2015 02:11
React Native Swipe Example
'use strict';
var React = require('react-native');
var {
StyleSheet,
PanResponder,
View,
AppRegistry,
Dimensions
} = React;
@jacobrosenthal
jacobrosenthal / index.ios.js
Last active September 15, 2015 23:48
Example React Native BLE
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
'use strict';
var React = require('react-native');
var {
AppRegistry,
Text,
@jacobrosenthal
jacobrosenthal / gist:489022611eca9c60f5c9
Last active September 7, 2015 22:19
ios combines scan response and adv packets clobbering the adv packet's manufacturer data so devices like wimoto who store data there are out of luck
RCTLogInfo(@"startScanning %@ %d", uuids, allowDuplicates);
NSMutableDictionary *scanOptions = [NSMutableDictionary dictionaryWithObject:@NO
forKey:CBCentralManagerScanOptionAllowDuplicatesKey];
if(allowDuplicates){
[scanOptions setObject:@YES forKey:CBCentralManagerScanOptionAllowDuplicatesKey];
}
[centralManager scanForPeripheralsWithServices:nil options:scanOptions];
@jacobrosenthal
jacobrosenthal / Doesnt stop
Created September 5, 2015 22:20
uid advertising (and probably more) doesnt stop from websocket -- notice the xpc stop confirm time is too short
[email protected] ws /Users/jacobrosenthal/Downloads/ble_software
> DEBUG=bindings node ./node_modules/eddystone-beacon/node_modules/bleno/ws-slave.js
bindings sendCBMsg: 1, {
"kCBMsgArgName": "node-1441491214887",
"kCBMsgArgOptions": {
"kCBInitOptionShowPowerAlert": 1
},
"kCBMsgArgType": 1
} +0ms
@jacobrosenthal
jacobrosenthal / eddystone mac bindings debug
Created August 29, 2015 14:57
eddystone mac bindings debug
Jacobs-MacBook-Air:redux-friendlist-demo jacobrosenthal$ DEBUG=bindings node node_modules/eddystone-beacon/examples/url/simple.js
bindings sendCBMsg: 1, {
"kCBMsgArgName": "node-1440860023598",
"kCBMsgArgOptions": {
"kCBInitOptionShowPowerAlert": 1
},
"kCBMsgArgType": 1
} +0ms
bindings xpcEvent: {
"kCBMsgId": 6,
### Keybase proof
I hereby claim:
* I am jacobrosenthal on github.
* I am jacobrosenthal (https://keybase.io/jacobrosenthal) on keybase.
* I have a public key whose fingerprint is 987C E5D1 F64A 7791 425A 041A C01F 65B1 923F 1D5A
To claim this, I am signing this object:
@jacobrosenthal
jacobrosenthal / gist:11a20b87d9da65c46ee5
Created May 29, 2015 17:32
Minidrone Rolling Spider UUIDS
Discovered characteristic 9a66fa000800919111e4012d1540cb8e
Discovered characteristic 9a66fa010800919111e4012d1540cb8e
Discovered characteristic 9a66fa020800919111e4012d1540cb8e
Discovered characteristic 9a66fa030800919111e4012d1540cb8e
Discovered characteristic 9a66fa040800919111e4012d1540cb8e
Discovered characteristic 9a66fa050800919111e4012d1540cb8e
Discovered characteristic 9a66fa060800919111e4012d1540cb8e
Discovered characteristic 9a66fa070800919111e4012d1540cb8e
Discovered characteristic 9a66fa080800919111e4012d1540cb8e
Discovered characteristic 9a66fa090800919111e4012d1540cb8e
RollingSpider finding: fa4e842bacc44b11850653e3dced8110
RollingSpider.on(stateChange)
RollingSpider#poweredOn
RollingSpider.on(discover)
f883f1d7d07b4e9fabe23426c2c2fc82
undefined
-1
-1
RollingSpider.on(discover)
aabc4123e4fd4c1fb276a8c9b1496210
RollingSpider = require("rolling-spider");
var temporal = require("temporal");
var options = { uuid: "fa4e842bacc44b11850653e3dced8110",
logger: console.log};
var yourDrone = new RollingSpider(options);
yourDrone.connect(function() {
console.log("connect");
yourDrone.setup(function() {
@jacobrosenthal
jacobrosenthal / .travis.yml
Created April 1, 2015 07:04
Arduino command line travis testing
# Test build your arduino libraries with travis and the official arduino tool chain
# assumes directory structure
# /NullStream
# NullStream.h
# NullStream.cpp
# examples
# NullStreamExample
# NullStreamExample.ino