Skip to content

Instantly share code, notes, and snippets.

View guybrush's full-sized avatar

Patrick guybrush

View GitHub Profile

this is followup to https://twitter.com/greggman/status/572858675720691714

though i dont fully understand it! i tried to make an example with https://github.com/greggman/requestanimationframe-fix.js and like 100 elements (to see an actuall difference :D) but my browser crashed due to too much webgl i guess? not sure, will look at this later some

### Keybase proof
I hereby claim:
* I am guybrush on github.
* I am guybrush (https://keybase.io/guybrush) on keybase.
* I have a public key whose fingerprint is 77B7 BD13 CA85 F10E 9E7C 3153 1B15 06A5 EAD1 5B5E
To claim this, I am signing this object:
@guybrush
guybrush / index.js
Created September 14, 2014 13:28
requirebin sketch
var Buffer = require('buffer')
var isbuffer = require('isbuffer')
var b = new Buffer(2)
@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'})
@guybrush
guybrush / gist:271ce34c9cdcc1211766
Last active August 29, 2015 14:04
flat dependency tree
~/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
$ npm run start
> [email protected] start /home/patrick/dev/glslify-workshopper
> mkdir answers; cd answers && NODE_ENV=development node ..
mkdir: cannot create directory `answers': File exists
|
===============================
= ~~~ glslify-workshopper ~~~ =
===============================
/*
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++) {
/*
[email protected] /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++) {
@guybrush
guybrush / ndarray-vs-obj.js
Last active August 29, 2015 14:01
bench ndarray vs obj
/*
[email protected]
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
[email protected]
ndarr : 8205.75ops/sec avg:0.12 max:2 min:0