Skip to content

Instantly share code, notes, and snippets.

View gorhgorh's full-sized avatar

Jérôme Zhang gorhgorh

View GitHub Profile
.DS_Store
.AppleDouble
.LSOverride
Icon
# Thumbnails
._*
# Files that might appear on external disk
/* jshint forin:true, noarg:true, noempty:true, eqeqeq:true, bitwise:true,
* strict:true, undef:true, curly:true, browser:true, indent:2, maxerr:50
*/
/*
* Note: use http://www.jshint.com/ to validate your code and make sure it
* doesn't catch any bad practices or error prone programming, also it may
* be handy to leave the options you validated your code with at the top
* of the file so it can be easiy validated later
*/
@gorhgorh
gorhgorh / modernizr_leap.js
Last active August 29, 2015 13:55
test to see if a leapD deamon is running
Modernizr.addTest('leap', function(){
var leapSupport;
// function test leapDeamon presence
function checkLeap() {
// create a websocket to the lead daemon
// i maybe i should just test that, bot something else could provide a webosket here ?
var ws = new WebSocket("ws://localhost:6437/");
// if there is one i( provide the event on open
@gorhgorh
gorhgorh / modernizrLeap.js
Last active August 29, 2015 13:56
Modernizr test for leap motion
function checkLeap () {
// Hard dependency on websockets; quick exit if not supported
if (!Modernizr.websockets) {
Modernizr.addTest('leap', false);
}
// Try and connect to the leap daemon
var ws = new WebSocket("ws://localhost:6437/");
ws.onopen = function(event) {
Modernizr.addTest('leap', true);
@gorhgorh
gorhgorh / mdnLive.sublime-snippet
Created March 9, 2014 15:15
snippet to generate markup tio insert a live exemple in mdn documentation
<snippet>
<content><![CDATA[
<h2 name="$1">$1</h2>
<h3>HTML</h3>
<pre class="brush: html">
${2:Sample HTML Content}</pre>
<h3>CSS</h3>
<pre class="brush: css">
${3:Sample CSS Content}</pre>
<h3>JavaScript</h3>
//-----------------------------------------------//
// SPARK CORE SIMPLE TONE GENERATOR //
//===============================================//
// Copy this into a new application at: //
// https://www.spark.io/build and go nuts! //
//-----------------------------------------------//
// Technobly / BDub - Jan 2014 //
//===============================================//
#define NOTE_B2 4065

Keybase proof

I hereby claim:

  • I am gorhgorh on github.
  • I am gorhgorh (https://keybase.io/gorhgorh) on keybase.
  • I have a public key whose fingerprint is 58E3 7E45 C967 4D37 D395 6EB7 0629 7DF8 0DCB 26D3

To claim this, I am signing this object:

var SensorTag = require('sensortag');
console.log("looking for a sensorTag");
SensorTag.discover(function(sensorTag) {
console.log("found one");
sensorTag.connect(function() {
console.log("connected to sensortag");
sensorTag.discoverServicesAndCharacteristics(function() {
console.log("characteristics discovered");
@gorhgorh
gorhgorh / gist:313a588a063ad516a61c
Created August 23, 2015 11:26
adapt install process output
$ adapt create course
Confirm type (course)
Confirm name (my-adapt-course) catbot
Confirm branch (master)
Confirm create now? (y)
downloading framework to catbot done!
installing node dependencies
npm ERR! fetch failed https://registry.npmjs.org/gzip-size/-/gzip-size-0.1.1.tgz
npm WARN retry will retry, error on last attempt: Error: socket hang up
npm ERR! fetch failed https://registry.npmjs.org/zlib-browserify/-/zlib-browserify-0.0.3.tgz
@gorhgorh
gorhgorh / config.json
Last active August 29, 2015 14:28
simple novce version check vs required version (could be used to check adapt's min version vs current one)
{
"_maxNodeVer": "0.10.33",
"_defaultLanguage": "en",
"_defaultDirection": "ltr",
"_questionWeight": 1,
"_accessibility": {
"_isEnabled": true,
"_shouldSupportLegacyBrowsers": true,
"_isTextProcessorEnabled": true
},