Skip to content

Instantly share code, notes, and snippets.

View c4milo's full-sized avatar
:octocat:

Camilo Aguilar c4milo

:octocat:
View GitHub Profile
package main
import (
"fmt"
"math/rand"
"strconv"
"time"
"github.com/octplane/mnemo"
)
@indexzero
indexzero / README.md
Last active August 29, 2015 14:12
Myo C++ Header files. Who wants to write a node binding for this?

The state of Myo bindings in Node.js

... any takers? Comment on this gist! The discussion all started from a Tweet:

Who's going to be the first to write a wrapper for the @thalmic #myo C++ library? Latest headers: https://gist.github.com/indexzero/60d1224f0082f0d16f14

As pointed out by @c4milo there are a number of libraries that exist, but from first glance they all have deficiencies:

@ryanuber
ryanuber / raft-boltdb
Last active August 29, 2015 14:14
Raft backend benchmarks
BenchmarkBoltStore_FirstIndex-5 1000000 1932 ns/op
BenchmarkBoltStore_LastIndex-5 1000000 1907 ns/op
BenchmarkBoltStore_GetLog-5 300000 5931 ns/op
BenchmarkBoltStore_StoreLog-5 5000 266819 ns/op
BenchmarkBoltStore_StoreLogs-5 5000 300801 ns/op
BenchmarkBoltStore_DeleteRange-5 5000 322467 ns/op
BenchmarkBoltStore_Set-5 10000 247162 ns/op
BenchmarkBoltStore_Get-5 1000000 2176 ns/op
BenchmarkBoltStore_SetUint64-5 10000 240333 ns/op
BenchmarkBoltStore_GetUint64-5 1000000 2209 ns/op
git log --pretty="format:%an %ae" | sort | uniq -i | sort | sed -e 's/^ *[0-9]* //g' > AUTHORS
@joseph
joseph / gist:573248
Created September 10, 2010 07:29
Making sense of touch events on iframes in iOS 4.1
function translateTouchEvent(element, target, evt, edata) {
// IN 4.1 ONLY, if we have a touch start on the layer, and it's been
// almost no time since we had a touch end on the layer, discard the start.
// (This is the most broken thing about 4.1.)
if (
p.brokenModel_4_1 &&
!edata.frame &&
!p.touching &&
edata.start &&
p.edataPrev &&
@rogpeppe
rogpeppe / gist:874010
Created March 17, 2011 08:37
go map/slice/array benchmark
package main
import (
"fmt"
"testing"
)
const Size = 1e6
var (
array [Size]int
var http = require('http');
var options = {
host: 'localhost',
port: 3000,
path: '/',
method: 'POST'
};
var req = http.request(options, function(res) {
@johnkpaul
johnkpaul / gist:2361303
Created April 11, 2012 18:44
gruntjs Mocha task
/*
* grunt
* https://github.com/cowboy/grunt
*
* Copyright (c) 2012 "Cowboy" Ben Alman
* Copyright (c) 2012 John K. Paul @johnkpaul
* Licensed under the MIT license.
* http://benalman.com/about/license/
*/
@domenic
domenic / classes.js
Created June 6, 2012 22:18
DDDNYC talk notes
"use strict";
// Essentials of prototypes:
var carProto = {
drive: function () {
console.log("driving a " + this.color + " car");
}
};
<!DOCTYPE HTML>
<html lang="en-us">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Widgets Magazine</title>
<style type="text/css" media="screen">
</style>
<script type='text/javascript'>
(function() {
var useSSL = 'https:' == document.location.protocol;