Skip to content

Instantly share code, notes, and snippets.

Avatar

Bradley Farias bmeck

View GitHub Profile
View why-i-need-private-declarations.js
'use strict';
/**
* @template {Object} O
* @constructor
* @param {O} o
* @returns {O}
*/
function Override(o) {
return o;
}
View check.js
#! /usr/bin/env node
// get file slim.code.js.lz4 from https://github.com/nodejs/Gzemnid/blob/master/doc/Using_pre-built_datasets.md
// lz4cat < slim.code.js.lz4 | node check.js
'use strict';
;(async () => {
const rl=require("readline").createInterface({
input: process.stdin,
crlfDelay: Infinity
});
let current_file = null;
@bmeck
bmeck / taint.log
Last active Jan 14, 2019
taint from `require('internal/url')` Node.js v10.14.2
View taint.log
require
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/Users/bfarias/Documents/node/test/parallel/test-internal-module-taint.js:7:3)
at Module._compile (internal/modules/cjs/loader.js:722:30)
at Object..js (internal/modules/cjs/loader.js:733:10)
at Module.load (internal/modules/cjs/loader.js:621:32)
at tryModuleLoad (internal/modules/cjs/loader.js:564:12)
at Function._load (internal/modules/cjs/loader.js:556:3)
at Function.runMain (internal/modules/cjs/loader.js:775:12)
_load
View files and occurances
This file has been truncated, but you can view the full file.
el.js-controls-1.0.0.tgz/src/controls/index.coffee:1:export * from './control'
el.js-controls-1.0.0.tgz/src/controls/index.coffee:2:export * from './text'
el.js-controls-1.0.0.tgz/src/controls/index.coffee:3:export * from './textarea'
el.js-controls-1.0.0.tgz/src/controls/index.coffee:4:export * from './checkbox'
el.js-controls-1.0.0.tgz/src/controls/index.coffee:5:export * from './select'
el.js-controls-1.0.0.tgz/src/controls/index.coffee:6:export * from './quantity-select'
el.js-controls-1.0.0.tgz/src/controls/index.coffee:7:export * from './country-select'
el.js-controls-1.0.0.tgz/src/controls/index.coffee:8:export * from './state-select'
el.js-controls-1.0.0.tgz/src/controls/index.coffee:9:export * from './user-email'
View bench.js
'use strict';
require('http').createServer(
(req, res) => {
require('fs').createReadStream('/dev/random').pipe(res);
}
).listen(8080);
@bmeck
bmeck / checked.js
Created Sep 13, 2018
`node --experimental-policy policy.json checked.js` , from https://github.com/bmeck/node/tree/policy
View checked.js
console.log('typeof fs %s', typeof require('fs'));
View proof
Let us see the response to: "Street Fighter the movie has a better plot than Street Fighter the game."
View example.md
`/my-website/` - `package.json`
`/src/`
`/pages/` - `index.html` - `about.html`
`/assets/` - `site.css` - `site.js`
@bmeck
bmeck / bus.js
Created Jun 23, 2018
it is a better API at least
View bus.js
// Example way to construct a Bus
//
// const ctrl = new SharedArrayBuffer(12);
// const size = new SharedArrayBuffer(4);
// let busSize = 4096;
// const data = new SharedArrayBuffer(busSize);
// const bufs = {ctrl,size,data,};
// const bus = new Bus(bufs);
'use strict';
@bmeck
bmeck / commands.js
Last active Jun 29, 2018
Show fs.readFile callback acting as if it was sync in another thread (naive impl)
View commands.js
module.exports = {
__proto__: null,
START: 0,
WORKER_READY: 2,
BUS_READY: 3,
BUS_DRAINED: 4,
BUS_END: 5,
WORKER_ERROR: 6,
};
You can’t perform that action at this time.