Skip to content

Instantly share code, notes, and snippets.

ricardobeat / Brewfile
Last active Oct 25, 2022
Mac CI runner
View Brewfile
brew 'coreutils'
brew 'tmux'
brew 'jq'
brew 'htop'
brew 'wget'
brew 'tree'
brew 'aria2'
brew 'xcbeautify'
brew 'git'
ricardobeat / index.html
Created Sep 10, 2018
Inline event attributes benchmark
View index.html
<!doctype html>
const events = [
ricardobeat / task.js
Last active Nov 4, 2020
Taks sample
View task.js
const { task, read, write } = require('taks')
const _postcss = require('postcss')
const _rollup = require('rollup')
const _uglify = require('uglify-es')
const postcss = task.plugin(async function (input, output, options) {
let opts = Object.assign({ from: undefined, plugins: [] }, options)
let src = await read(input)
let { css } = await _postcss(opts.plugins).process(src, opts)
return write(output, css)
ricardobeat / task.js
Last active Nov 4, 2020
minimal task runner
View task.js
#!/usr/bin/env node
const _tasks = {}
function task (name, fn) {
_tasks[name] = fn
} = async function (name, wait) {
if (!name) return console.warn(`Usage: node task [name]`)
if (!_tasks[name]) return console.warn(`No task named ${name}`)
ricardobeat /
Created Apr 10, 2017
Git: digging for lost code - unlabeled stashes etc
git fsck --no-reflogs | awk '/dangling commit/ {print $3}'| while read hash; do
echo "$hash"
git show $hash | grep -H -C4 svg

Simple comparison between Atomic CSS vs 'standard' CSS. Might not be representative of larger files.


file raw gzip
with-atomic.css 576b 325b
with-atomic.html 1183b 254b
without-atomic.css 1676b 324b
without-atomic.html 714b 199b
View abortable-promise.js
function AbortablePromise (fn) {
var abortHandler;
function onAbort (abortFn) {
abortHandler = abortFn;
var promise = new Promise(function (resolve, reject) {, resolve, reject, onAbort);
View gist:4bb8ffe1a12120a2923c
Verifying I am +ricardobeat on my passcard.
View when.js
Promise.prototype.spread = function (fn) {
this.then(function (values) {
fn.apply(this, values)
function when () {
var requirements =, 0)
return Promise.all({