Skip to content

Instantly share code, notes, and snippets.

Ricardo Tomasi ricardobeat

Block or report user

Report or block ricardobeat

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
ricardobeat / index.html
Created Sep 10, 2018
Inline event attributes benchmark
View index.html
<!doctype html>
const events = [
ricardobeat / task.js
Last active Mar 20, 2018
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 Mar 20, 2018
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({
ricardobeat / stupid-ie7-console-log.js
Last active Aug 29, 2015
IE7 panel for console.*
View stupid-ie7-console-log.js
;(function () {
var doc = document.documentElement
var IE7 = navigator.userAgent.indexOf('MSIE 7') > 0
logpane = document.createElement('div')
var height = 180
var width = 480
document.body.appendChild(logpane) = '#fff' = '10px' = IE7 ? 'absolute' : 'fixed'
You can’t perform that action at this time.