Skip to content

Instantly share code, notes, and snippets.

getify / 1.js
Last active September 19, 2019 08:56
quick sketch of CAF
send = CAF(send);
var prevSend = Promise.resolve();
function onSend(evt) {
prevSend.finally(function f(){
prevSend = send(
CAF.timeout(1000,"send took too long."),
{ some: "data" }
Rich-Harris /
Last active March 27, 2024 06:09
The truth about Svelte

I've been deceiving you all. I had you believe that Svelte was a UI framework — unlike React and Vue etc, because it shifts work out of the client and into the compiler, but a framework nonetheless.

But that's not exactly accurate. In my defense, I didn't realise it myself until very recently. But with Svelte 3 around the corner, it's time to come clean about what Svelte really is.

Svelte is a language.

Specifically, Svelte is an attempt to answer a question that many people have asked, and a few have answered: what would it look like if we had a language for describing reactive user interfaces?

A few projects that have answered this question:

GuilloOme / background.js
Last active March 24, 2023 20:05
Puppeteer (v.0.12.0) navigation blocking workaround
(function() {
'use strict';
// keep track of all the opened tab
let tabs = {};
// Get all existing tabs
chrome.tabs.query({}, function(results) {
results.forEach(function(tab) {
tabs[] = tab;
praveenpuglia /
Last active March 28, 2024 15:06
Everything you need to know about Shadow DOM

I am moving this gist to a github repo so more people can contribute to it. Also, it makes it easier for me to version control.

Please go to - for latest version of this document. Also, if you find the document useful, please shower your love, go ⭐️ it. :)

Shadow DOM

Heads Up! It's all about the V1 Spec.

In a nutshell, Shadow DOM enables local scoping for HTML & CSS.

ghaiklor /
Created August 19, 2015 11:40
NodeJS Create Environment method
Environment* CreateEnvironment(Isolate* isolate, uv_loop_t* loop, Handle<Context> context, int argc, const char* const* argv, int exec_argc, const char* const* exec_argv) {
HandleScope handle_scope(isolate);
Context::Scope context_scope(context);
Environment* env = Environment::New(context, loop);
uv_check_init(env->event_loop(), env->immediate_check_handle());
getify / gist:1b26accb1a09aa53ad25
Last active April 20, 2024 11:35
first draft sketch of a "Worker" polyfill
<!DOCTYPE html>
<meta charset="utf-8">
<title>Worker Polyfill</title>
<script src="polyfill.worker.js"></script>
<h1>Worker Polyfill</h1>
paulmillr /
Last active June 10, 2024 18:10
Most active GitHub users (by contributions).

Most active GitHub users (

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

 .filter(user =&gt; user.followers &gt; 1000)