Skip to content

Instantly share code, notes, and snippets.

View slmyers's full-sized avatar
💯
crushing code

Steven Myers slmyers

💯
crushing code
View GitHub Profile
eventLoop = {
taskQueues: {
events: [], // UI events from native GUI framework
parser: [], // HTML parser
callbacks: [], // setTimeout, requestIdleTask
resources: [], // image loading
domManipulation[]
},
microtaskQueue: [
// now an npm package qith 100% code coverage:
// https://github.com/WebReflection/endow#endow---
// (c) Andrea Giammarchi, @WebReflection (ISC)
const mix = Super => ({
with: (...mixins) =>
mixins.reduce(
(Class, Mixin) => {
Class = Mixin(Class);
if (!Mixin.hasOwnProperty(Symbol.hasInstance)) {
@ebidel
ebidel / coverage.js
Last active April 27, 2024 04:13
CSS/JS code coverage during lifecycle of page load
Moved to https://github.com/ebidel/puppeteer-examples
@isaacplmann
isaacplmann / table-of-contents.md
Last active April 22, 2024 03:36
Advanced Angular Patterns
@kharandziuk
kharandziuk / article.md
Last active March 2, 2021 03:41
Node.js Streams and Reactive Programming Primer

This article shows how to apply Node.js Stream and a bit of Reactive programming to a real(tm) problem. The article is intended to be highly practical and oriented for an intermediate reader. I intentionally omit some basic explanations. If you miss something try to check the API documentation or its retelling(e.g.: this one)

So, lets start from the problem description. We need to implement a simple web scraper which grabs all the data from some REST API, process the data somehow and inserts into our Database. For simplicity, I omit the details about the actual database and REST API(in real life it was the API of some travel fare aggregator website and a Pg database)

Consider we have two functions(code of the IO simulator functions and the other article code is here):

getAPI(n, count) // pseudo API ca
<p>hello {{name}}</p>
@a-s-o
a-s-o / Caddyfile
Last active January 6, 2021 10:28
Single page app rewriting with Caddy server
localhost:80
gzip
ext .html
root /home/deploy/current/build/www
proxy /graphql localhost:3000
rewrite /login {
to {path} /login
}
@nolanlawson
nolanlawson / es6modules.md
Last active September 1, 2016 00:00
The case for Rollup and ES modules in frontend code

The case for Rollup and ES modules in frontend code

TLDR: Rollup and ES modules give us:

  • smaller bundles due to tree-shaking and scope-hoisting, and
  • faster runtime perf than CommonJS, by avoiding runtime module resolution

Sources to back up these wild claims:

@btroncone
btroncone / rxjs_operators_by_example.md
Last active July 16, 2023 14:57
RxJS 5 Operators By Example
@btroncone
btroncone / ngrxintro.md
Last active February 9, 2024 15:37
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents