This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {networkInterfaces} from 'os' | |
import {isIP, BlockList} from 'net' | |
export function * iter_subnet_matches(ip_query) { | |
let family = isIP(ip_query) | |
let ipv = 'ipv'+family | |
for (let [if_name, if_addrs] of Object.entries(networkInterfaces())) { | |
for (let each of if_addrs) { | |
if (family != each.family) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* from Kevin Powell's [3 useful CSS tricks](https://www.youtube.com/watch?v=HOM47v73yG8) | |
* for <div class=box></div> | |
* useful for iframes, videos, pictures, etc. | |
*/ | |
.box { | |
width: 25rem; | |
aspect-ratio: 1 / 1; | |
position: fixed; | |
inset: 0rem; /* sets top/bottom/left/right to same value */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// See https://web.dev/text-fragments/ | |
// location.hash = searchFragment('text to find in page') | |
export const searchFragment = txt => `#:~:text=${encodeURI(txt)}` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default (e,a,...z)=> | |
z.reduce((e,c)=>(e.append(c),e) | |
,Object.assign(e.nodeType ? e : document.createElement(e), a)) |
OlderNewer