Skip to content

Instantly share code, notes, and snippets.

View guybrush's full-sized avatar

Patrick guybrush

View GitHub Profile
@guybrush
guybrush / index.js
Created February 18, 2014 02:57
requirebin sketch
var ndarray = require('ndarray')
var cwise = require('cwise')
var s = 4
var arr0 = new ndarray(new Uint8Array(s*s*s),[s,s,s])
var arr1 = new ndarray(new Uint8Array(s*s*s/2*2*2),[s/2,s/2,s/2])
arr0.set(1,1,1,1)
var lod = cwise
{
"name": "issue-browserify-glsl-parser",
"version": "0.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "browserify test.js > bundle.js"
},
"author": "",
"license": "ISC",
ok test/tap/404-parent.js ............................... 4/4
ok test/tap/circular-dep.js ............................. 2/2
ok test/tap/config-meta.js .......................... 767/767
ok test/tap/dedupe.js ................................... 3/3
ok test/tap/false_name.js ............................... 2/2
ok test/tap/git-cache-locking.js ........................ 2/2
not ok test/tap/ignore-install-link.js .................. 1/2
Command: "/usr/local/bin/node ignore-install-link.js"
TAP version 13
not ok 1 Failed to link /home/patrick/tmp/npm-link-issue globally
@guybrush
guybrush / ndarray-vs-obj.js
Last active August 29, 2015 14:01
bench ndarray vs obj
/*
node@0.10.28
ndarr : 2030.75ops/sec avg:0.49 max:2 min:0
obj : 8245ops/sec avg:0.12 max:5 min:0
ndarr : 1958.5ops/sec avg:0.51 max:1 min:0
obj : 8099.25ops/sec avg:0.12 max:1 min:0
node@0.11.13
ndarr : 8205.75ops/sec avg:0.12 max:2 min:0
/*
node@0.11.13 /usr/local/n/versions/0.11.13/bin/node
set : 5115.5ops/sec avg:0.2 max:2 min:0
assign: 121.82ops/sec avg:8.21 max:16 min:7
*/
var ndarr = ndarray(new Uint8Array(32*32*32),[32,32,32])
for (var i=0;i<32*32*32;i++) {
/*
this an approach to be able to use typedarray.set to set continuous parts
of an ndarray:
var store = ndarray(new Store(new Uint8Array(32*32*32*3*3*3)),[32*3,32*3,32*3])
var chunks = {}
for (var x=0;x<3;x++)
for (var y=0;y<3;y++)
for (var z=0;z<3;z++) {
$ npm run start
> glslify-workshopper@0.0.0 start /home/patrick/dev/glslify-workshopper
> mkdir answers; cd answers && NODE_ENV=development node ..
mkdir: cannot create directory `answers': File exists
|
===============================
= ~~~ glslify-workshopper ~~~ =
===============================
~/dev/lib/protocol-buffers $ covert test/basic.js
[stdin]:2413
lete (__coverageWrap(9)(require.cache))[(__coverageWrap(10)(require.resolve(__
^
TypeError: Object function (e){var n=t[o][1][e];return s(n?n:e)} has no method 'resolve'
at Object.<anonymous> ([stdin]:2413:114)
at Object../ ([stdin]:2421:4)
at s ([stdin]:1:220)
at [stdin]:1:271
@guybrush
guybrush / gist:271ce34c9cdcc1211766
Last active August 29, 2015 14:04
flat dependency tree

regarding the "diamond" dependency problem (see bionode/bionode#9 (comment)), you can use multiple versions of the same package in go (with a flat file-tree):

$GOPATH/pkg/X@0.1
$GOPATH/pkg/X@0.2
$GOPATH/pkg/Y@0.1   // import "X@0.1"
$GOPATH/pkg/Z@0.1   // import "X@0.2"

though go get will not enforce it, also the community arround go does not seem to embrace versioning.

@guybrush
guybrush / crypto-webworker.html
Created August 7, 2014 20:31
firefox 31 issue: crypto in webworker
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<script>
console.log(crypto.getRandomValues(new Uint8Array(1)))
var src = 'crypto.getRandomValues(new Uint8Array(1))'
var blob = new Blob([src],{type:'text/javascript'})