Skip to content

Instantly share code, notes, and snippets.

View cafedomingo's full-sized avatar

Patrick cafedomingo

View GitHub Profile
@cafedomingo
cafedomingo / keybase.md
Created September 22, 2019 19:11
Keybase proof

Keybase proof

I hereby claim:

  • I am cafedomingo on github.
  • I am cafedomingo (https://keybase.io/cafedomingo) on keybase.
  • I have a public key ASBhaYp3Vvk5tOWwTVhNY_9KUZ61B40958b-Th7AQvo4Ego

To claim this, I am signing this object:

@cafedomingo
cafedomingo / RunOnceFactory.js
Last active March 26, 2026 00:35
Takes a function and returns a function that will only be run once.
const runOnce = function(func) {
let hasRun = false;
let result;
return function(...args) {
if (!hasRun) {
hasRun = true;
result = func.apply(this, args);
}
return result;
};