Skip to content

Instantly share code, notes, and snippets.

@manguluka
manguluka / canvas.js
Created May 27, 2019 04:46 — forked from tbranyen/canvas.js
Lightweight canvas wrapper.
// Basic Usage:
//
// var main = new Canvas({ elem: "canvas" }, function(options) {
// // Instantiate anything specific here...
// // Main draw loop
// this.draw = function() {
//
// };
// });
//
@manguluka
manguluka / instrument.js
Created March 28, 2019 03:34 — forked from chriscoyier/instrument.js
The JS Instrumenting we do at CodePen
var esprima = require('esprima');
function instrument(code) {
var LOOP_CHECK = 'if (window.CP.shouldStopExecution(%d)){break;}';
var LOOP_EXIT = "\nwindow.CP.exitedLoop(%d);\n";
var loopId = 1;
var patches = [];
esprima.parse(code, {
@manguluka
manguluka / index.js
Last active January 13, 2019 20:09 — forked from zkat/index.js
npx is cool
#!/usr/bin/env node
var nodecast = require('nodecast);
var stream = nodecast.find();
stream.on('device', function(device) {
console.log('Found', device.name);//, device.info);
if (typeof device.apps === 'function') {
device.apps(function(err, apps){
console.log('Applications for', device.name, apps);
import macros, ../src/arraymancer
# Transforms
dumpTree:
network model_name:
context: ctx
input_shape: [1, 28, 28] # Real shape [N, 1, 28, 28]
layers:
class P5Controls {
constructor(config) {
this.config = config;
this.controls = {};
}
add(control) {}
setup() {
this.config.forEach((control, i) => {
switch (control.type) {
case "slider":