Skip to content

Instantly share code, notes, and snippets.

View klaaz0r's full-sized avatar
🚢
shipping

Klaas Foppen klaaz0r

🚢
shipping
View GitHub Profile
@logaretm
logaretm / sw.js
Created February 25, 2020 20:46
Caching GraphQL responses with Service Workers
const QUERY_CACHE_KEY = 'CACHE_V_0';
const GRAPHQL_URL = 'https://example.com/graphql';
self.addEventListener('fetch', e => {
if (isGraphql(e.request)) {
handleGraphQL(e);
}
});
@klaaz0r
klaaz0r / waitForDomElement.js
Last active October 12, 2022 11:34
Wait for a DOM element to appear with a MutationObserver
const waitForElement = selector => new Promise((resolve, reject) => {
const element = document.querySelector(selector);
if (element) {
return resolve(element);
}
const timeout = setTimeout(() => reject(new Error('element not found')), 15000);
const walkDOM = (node, fn) => {

This is unmaintained, please visit Ben-PH/spacemacs-cheatsheet

Useful Spacemacs commands

  • SPC q q - quit
  • SPC w / - split window vertically
  • SPC w - - split window horizontally
  • SPC 1 - switch to window 1
  • SPC 2 - switch to window 2
  • SPC w c - delete current window
@staltz
staltz / introrx.md
Last active September 24, 2024 06:42
The introduction to Reactive Programming you've been missing