(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf
:
I hereby claim:
To claim this, I am signing this object:
// this is taken from here: | |
// https://dev.to/rfornal/creating-a-document-fragment-5g7l | |
let fragmentFromString = (stringHTML) => { | |
let temp = document.createElement('template') | |
temp.innerHTML = stringHTML | |
return temp.content | |
} | |
let createNumberLabel = (content) => fragmentFromString(` | |
<span |
/** | |
* hookInto | |
* | |
* This will hook into a function of an object so we can check the arguments | |
* used when it is called any time and do some calculations on those arguments. | |
* | |
* @param {object} targetObject Object where the function you want to target is | |
* @param {string} functionName The name of the function you want to target | |
* @param {function} handler The hook function that will handle the arguments | |
* @returns {undefined} |
/** | |
* awaitFor | |
* | |
* given a selector this function promises to return a valid element when it finds it. | |
* you can manage the timeout and the step interval if needed. | |
* | |
* @param selector - the selector for the element you want | |
* @param options - configuration for the promise | |
* @param options.intervalStep - time between checking in seconds | |
* @param options.timeout - time in seconds to stop checking the element |
/** | |
* Debounce | |
* This will create a function that can be called multiple times and only be | |
* executed once, within a threshold you speficy | |
* @param {function} callback Callback function to be executed | |
* @param {number} threshold Time to wait before executing the callback | |
* @return {function} The function that can be triggered multiple time | |
*/ | |
function debounce(callback, threshold = 1000) { | |
// input validation |
import { Hono } from 'hono' | |
import { jsxRenderer } from 'hono/jsx-renderer' | |
import { Suspense } from 'hono/jsx/streaming' | |
const app = new Hono() | |
const Component = async () => { | |
const res = await fetch('https://ramen-api.dev/shops/yoshimuraya') | |
await new Promise((r) => setTimeout(r, 8000)) // <-- delay here | |
const data = await res.json<{ shop: { name: string } }>() |