Skip to content

Instantly share code, notes, and snippets.

💭
Set your status

Bryan English bengl

Block or report user

Report or block bengl

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bengl
bengl / 0-BUNDLED-COWSAY-DEMO.md
Last active Sep 23, 2018
bundled cowsay app demo for qbundler
View 0-BUNDLED-COWSAY-DEMO.md

This is an example app that has been bundled with qbundler.

It's a bundled version of https://github.com/bengl/qbundler/tree/master/testapp.

You can try this yourself!

Just npm i -g qdd, then download this JS file and run it. A server will be running after it quickly downloads its dependencies, like magic!

View qdd-cowsay-demo.js
// Try running this file with:
//
// npx -p bengl/qdd qdd-node qdd-cowsay-demo.js
//
// `qdd-node` will read the package-lock data below, use it to install the
// dependencies to the qdd cache, then run this file with a shimmed module
// loader that will load from the qdd cache!
//
// This would also work with an ordinary package-lock.json file in the $PWD.
//
View funfunfunfun.js
const { Readable } = require('stream');
const oldOn = Readable.prototype.on;
Readable.prototype.on = function on(name, fn) {
oldOn.apply(this, arguments);
if (name !== 'allData' || this._readableState.objectMode) {
return;
}
View loopyfunctioney.js
// Try running this file in Node 8.2.1
// Try running this file in Node 8.3.0
// Try running this file in d8 for Node 8.3.0
function empty() {}
let i, j, d;
for(j = 0; j < 5; j++) {
d = Date.now();
for (i = 0; i < 1e7; i++) {
View BUILDING_NODE_CUBE.md
View testing.sh
#!/usr/bin/env bash
echo "This works!"
View NodeTodo Getting Started.md
  • Create a GitHub account (if you don't already have one)
  • On the command line, in your home directory or a directory you have for projects, run: git clone https://github.com/nodejs/node.git
  • When that is done: cd node
  • Go to https://github.com/nodejs/node and use the "Fork" button to fork your own repo of node
  • On the page for your fork, use the "Clone or download" button and copy the URL for cloning to your clipboard, then run: git remote add mine <paste that URL here!>
  • Follow the instructions at https://github.com/nodejs/node/blob/master/BUILDING.md to build Node.js.
  • Email help@nodetodo.org or tweet at @NodeTodo to get a good first contribution to work on or to get help with any of the above steps.
View keybase.md

Keybase proof

I hereby claim:

  • I am bengl on github.
  • I am bengl (https://keybase.io/bengl) on keybase.
  • I have a public key whose fingerprint is 37D2 6669 8039 4F22 43B7 FF45 145D 4E0D 7970 799A

To claim this, I am signing this object:

View exportedFunction.js
// tern: const Thing = require('./thing.js')
/**
* @param {Thing} thing
*/
module.exports = function (thing) {
thing.foo();
}
@bengl
bengl / commits.js
Last active Aug 29, 2015
Analyse the commits on node core to see how many are doc-only, etc.
View commits.js
/**
* Plop this in your node git repo and run:
*
* $ node commits.js [num of commits you want to analyse (default 1000)]
*/
var exec = require('child_process').exec;
function gitDiffTree(commit, recursive, cb) {
exec('git diff-tree --name-only --no-commit-id ' + (recursive ? '-r ' : '') + commit, function(err, data) {
You can’t perform that action at this time.