Skip to content

Instantly share code, notes, and snippets.

@benogle
benogle / api-throttling-429-error-handling.js
Created March 29, 2021 22:36
An example script consuming an API with various throttling and 429 "too many requests" error handling strategies.
// An example script consuming an API with various throttling and 429 error
// handling strategies.
//
// Blog post with more context
// https://www.useanvil.com/blog/2021-03-29-throttling-and-consuming-apis-with-429-rate-limits
//
// License: MIT
import fetch from 'node-fetch'
import mapLimit from 'async/mapLimit'

Keybase proof

I hereby claim:

  • I am benogle on github.
  • I am pageclip (https://keybase.io/pageclip) on keybase.
  • I have a public key whose fingerprint is 281B C8E2 0F0D A8FD E00A 8F9E 59CC A50C 4EFB DB82

To claim this, I am signing this object:

The latest version of each of these packages is affected.

Generated: Wed Jun 03 2015 18:15:00 GMT-0700 (PDT)

n Package Owner Total Affected Affected On Latest
1 file-types @execjosh 20670 0.3.0 : 20670
2 auto-indent @griiin 19527 0.1.0 : 19527
3 fancy-new-file @rev087 14661 0.7.0 : 14661
4 tab-history @guillaume86 13499 0.4.0 : 13499

Generated: Wed May 20 2015 16:56:45 GMT-0700 (PDT)

Event Action Event Label Total Events Unique Events Event Value Avg. Value
.bin@unknown Use Project::getDirectories()[0]?.resolve() instead 1 1 0 0.00
[email protected] Use a config schema instead. See the configuration section of https://atom.io/docs/latest/hacking-atom-package-word-count and https://atom.io/docs/api/latest/Config for more details 1 1 0 0.00
[email protected] Are you trying to listen for the 'core:confirm' Atom command with jQuery::on? jQuery::trigger can no longer be used to listen for Atom commands. Please use atom.commands.add instead. See the docs at https://atom.io/docs/api/latest/CommandRegistry#instance-add for details. 12 11 0 0.00
[email protected] Store package style sheets in the styles/ directory instead of stylesheets/ in the adwaita-ui package 1 1 0 0.00
[email protected] Store package style
@benogle
benogle / 0_reuse_code.js
Created April 3, 2014 23:34
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
sdf
sdf
sdf
sdf
@benogle
benogle / sdf.txt
Created March 28, 2014 17:17
sdfsdf
cats