- Create a new bookmark
- To the link add
data:text/html,
- After
data:text/html,
paste block below - Save bookmark, and open it
First time it may take a while to load the library
let unit = `5" x 5' x 1-3/16"` | |
unit.split('x') | |
.map((v) => v.trim()) | |
.map((v) => ({ value: removeUnit(v), unit: getUnit(v) })) | |
.map(({ unit, value }) => ({ unit, value: value.split('-') })) | |
.map(({ unit, value: [whole, fraction] }) => ({ unit, whole, fraction: splitFraction(fraction) })) | |
.map(({ unit, whole, fraction }) => ({ unit, value: parseInt(whole) + divideTuple(fraction) })) | |
.map(o => convertToInch(o)) | |
.reduce((product, o) => product * o.value, 1) |
import { FunctionalComponent, isVNode, VNode, VNodeNormalizedChildren, createTextVNode, render, createVNode, createCommentVNode } from "vue"; | |
function visit(nodes: VNodeNormalizedChildren, exits: Map<string, VNode>): VNodeNormalizedChildren { | |
if (!Array.isArray(nodes)) return nodes | |
return nodes.map(node => { | |
if (!isVNode(node)) return node | |
if (node.type !== HTMLCommentExit) { | |
node.children = visit(node.children, exits) |
// eslint-disable-next-line react-hooks/rules-of-hooks | |
let _store: ReturnType<typeof useReducer> | |
function useStore() { | |
const store = useRef(useReducer((s: any, a: any) => { | |
return {} | |
}, {})) | |
_store = _store ?? store.current | |
return _store | |
} |
javascript: ((s) => { | |
"use strict"; | |
if (s === atob("JXM=")) s = prompt(); | |
/** | |
* More bookmarklets at | |
* https://gist.github.com/iamandrewluca/61feacf07bc4f2f50e70f986c2e9b2d2 | |
* When used as a browser search engine `s` will be what user typed in address bar | |
*/ | |
const script = document.createElement("script"); |
javascript: void ((function() { | |
/* More bookmarklets at https://gist.github.com/iamandrewluca/61feacf07bc4f2f50e70f986c2e9b2d2 */ | |
// create an empty page data uri | |
// make it content editable | |
// open in new tab | |
})()); |
javascript: void ((function(userName = 'You') { | |
/* More bookmarklets at https://gist.github.com/iamandrewluca/61feacf07bc4f2f50e70f986c2e9b2d2 */ | |
function findUpElementByDataAttribute(element, attr) { | |
if (element) { | |
return element.dataset[attr] ? element : findUpElementByDataAttribute(element.parentElement, attr); | |
} | |
} | |
const usersElements = [...document.querySelectorAll('[data-initial-participant-id] [data-self-name]')]; |
javascript: void ((function(query) { | |
/* More bookmarklets at https://gist.github.com/iamandrewluca/61feacf07bc4f2f50e70f986c2e9b2d2 */ | |
const [packageName, destination = 'g'] = decodeURIComponent(query).split('+').join(' ').split(' '); | |
if (destination === 'ts') { | |
window.location.href = `https://www.typescriptlang.org/dt/search?search=${packageName}`; | |
} else { | |
window.location.href = `https://njt.vercel.app/jump?to=${packageName} ${destination}`; | |
} | |
})('%s')); |