Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View bengl's full-sized avatar
💭
Set your status

Bryan English bengl

💭
Set your status
View GitHub Profile
@bengl
bengl / LICENSE.txt
Created December 13, 2012 10:00 — forked from 140bytes/LICENSE.txt
Do A Barrel Roll!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@bengl
bengl / barrel_bookmarklet.js
Created November 3, 2011 19:02
A bookmarklet to replicate Google's "do a barrel roll" on any arbitrary page.
javascript:(function(a,k,t,m,o,w,s){document.head.innerHTML+='<'+s+'@-'+m+k+m+t+'@-'+o+k+o+t+'@-'+w+k+w+t+'body{-'+m+a+'-'+o+a+'-'+w+a+'}</'+s})("-animation:r 4s 1;","-keyframes r{to{-","-transform:rotate(360deg)}}","moz","o","webkit","style>")
@bengl
bengl / .vimrc
Created February 28, 2012 00:53
auto-updating .vimrc
" ~/.vimrc
"
" Remote vimrc. Updates each time vim is started. This adds a bit of time to
" your vim startup, but I haven't found it to be a big deal.
"
" The bit.ly URL is the vimrc file from my dotfiles on github, raw. Replace it
" with your own.
"
" Why not just save it to ~/.vimrc? This way I can just update it on github
" and it's good to go on all my machines.
@bengl
bengl / mtjs.md
Last active October 5, 2021 16:31
Where to buy Multithreaded Javascript

Where to buy Multithreaded JavaScript:

This is an incomplete list! If you find a listing for "Multithreaded JavaScript: Concurrency Beyond the Event Loop" in your favourite bookstore, please leave a comment or DM @bengl on Twitter to have it added here.

Australia

Canada

@bengl
bengl / http-next.js
Last active September 13, 2020 09:17 — forked from wesleytodd/framework.js
Just noodling on the future Node.js and http
import http from 'http-next'
import fs from 'fs'
const server = http.createServer({
allowHTTP1: true,
allowHTTP2: true,
allowHTTP3: true,
key: fs.readFileSync('localhost-privkey.pem'),
cert: fs.readFileSync('localhost-cert.pem')
})
import pitesti from 'https://dev.jspm.io/pitesti'
import streams from 'https://dev.jspm.io/readable-stream'
import { assertEquals } from "https://deno.land/std/testing/asserts.ts"
const outputStream = new streams.Writable({
write (data, encoding, cb) {
Deno.stdout.writeSync(data)
cb()
}
})
@bengl
bengl / 0-BUNDLED-COWSAY-DEMO.md
Last active September 23, 2018 20:46
bundled cowsay app demo for qbundler

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!

// 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.
//
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;
}
// 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++) {