Skip to content

Instantly share code, notes, and snippets.

View ryanvazquez's full-sized avatar

Ryan Vazquez ryanvazquez

  • New York, New York
View GitHub Profile
@ryanvazquez
ryanvazquez / setIntervalTimeout.js
Last active April 15, 2022 16:22
Simple utility for creating variadic intervals
// setIntervalTimeout sits somewhere between setTimeout and setInterval,
// allowing a finite or infinite number of fixed or variadic intervals.
// Returns a cleanup function to clear the current timeout.
// Note: IE does not support generators.
function setIntervalTimeout(callback, iterable, ...args){
if (!(Symbol.iterator in iterable)){
throw new Error(`Expected valid iterable. Received: ${iterable}.`);
@ryanvazquez
ryanvazquez / app-info.yaml
Last active August 25, 2020 17:00
Sample YAML config
cost-insights:
backendUrl: http://some-url.com
metrics:
mmau:
name: Cost per Million MAU
description: >
This description appears in the subheader
legend:
title: Spotify MAU
description: >
Summary of all failing tests
FAIL src/plugins/lineage/DagreGrNode.test.js
● <Node /> › renders the supplied element
TypeError: Cannot assign to read only property 'getBBox' of object '[object HTMLUnknownElement]'

 10 | describe('<Node />', () => {
 11 | beforeEach(() => {
> 12 | window.HTMLUnknownElement.prototype.getBBox = function() {
 | ^
 13 | return { width: 100, height: 100 };
@ryanvazquez
ryanvazquez / TaskQueue.js
Created December 11, 2019 02:39
An async task queue
class TaskQueue {
constructor(config = {}){
this.config = Object.assign({
concurrency: 1,
rejectOnError: true,
timeout: 0
}, config);
this.remaining = 0;
this.running = 0;
@ryanvazquez
ryanvazquez / helloWorld.js
Created August 15, 2019 20:09
Hello World!
console.log('Hello World!');