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
Element.prototype.getDirectDesc = function () { | |
const descendants = Array.from(this.querySelectorAll("*")); | |
const directDescendants = descendants.filter( | |
(ele) => | |
ele.parentElement === this && | |
!["script", "iframe"].includes(ele.nodeName.toLowerCase()) | |
); | |
return directDescendants; | |
}; |
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
var columns = Array.from(document.querySelectorAll('.ghx-column-title')).map( | |
(title) => `${title.textContent}\n${'*'.repeat(title.textContent.length + 5)}` | |
); | |
document.querySelectorAll('.ghx-columns').forEach((col) => { | |
const cols = col.querySelectorAll('.ghx-column'); | |
cols.forEach((col, i) => { | |
col.querySelectorAll('.ghx-issue-fields').forEach((ele) => { | |
const mev = ele.querySelector('.ghx-key').textContent; | |
const txt = ele.querySelector('.ghx-inner').textContent; | |
columns[i] += `\n${mev}: ${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
// deno run --allow-net mousse.ts | |
import { Mousse } from 'https://github.com/Tyrenn/mousse/raw/main/mod.ts'; | |
let mousse = new Mousse({ port: 8080 }); | |
async function handleRequest(c: any) { | |
const _body = { | |
...c.params, | |
}; | |
const body = JSON.stringify(_body); |
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
/* | |
Get Browser feature implementation state | |
- fetches data from caniuse.com | |
- checks each browser for support of known features | |
- generates a HTML table as seen here: https://codepen.io/netsi1964/pen/PoGWoWP | |
RUN: deno run --allow-net caniuse.ts | |
Created by Sten Hougaard @netsi1964 12/12-2020 | |
*/ | |
interface SupportStatus { | |
supported: number; |
This file has been truncated, but you can view the full file.
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
{ | |
"eras": { | |
"e-83": "83 versions back", | |
"e-82": "82 versions back", | |
"e-81": "81 versions back", | |
"e-80": "80 versions back", | |
"e-79": "79 versions back", | |
"e-78": "78 versions back", | |
"e-77": "77 versions back", | |
"e-76": "76 versions back", |
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
const byCode = { | |
"1": { | |
"country": "United States Virgin Islands", | |
"code": "1", | |
"intPrefix": "011", | |
"natPrefix": "1", | |
"natNumber": "(340)+7 digits", | |
"utsDst": "-4", | |
"note": " " | |
}, |
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
/** | |
* webserver.ts | |
*/ | |
import { serve } from "https://deno.land/[email protected]/http/server.ts"; | |
const server = serve({ hostname: "0.0.0.0", port: 8080 }); | |
console.log(`HTTP webserver running. Access it at: http://localhost:8080/`); | |
for await (const request of server) { | |
let bodyContent = "Your user-agent is:\n\n"; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
København | 623404 | 632340 | 1.4 | |
---|---|---|---|---|
Aarhus | 277086 | 280534 | 1.2 | |
Odense | 179601 | 180302 | 0.4 | |
Aalborg | 115908 | 117351 | 1.2 | |
Frederiksberg | 103960 | 104305 | 0.3 | |
Gentofte | 75176 | 74830 | -0.5 | |
Esbjerg | 72168 | 72037 | -0.2 | |
Gladsaxe | 69512 | 69112 | -0.6 | |
Randers | 62586 | 62482 | -0.2 | |
Kolding | 60854 | 61121 | 0.4 |
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
Object.prototype.rad = (deg) => Math.PI/180 * deg; | |
Object.prototype.deg = (rad) => 180/Math.PI * rad; | |
Object.prototype.getAngle = (point1, point2) => Math.atan2(point1.y - point2.y, point1.x - point2.x); | |
Object.prototype.getDistance = (point1, point2) => Math.sqrt(Math.pow(point1.x-point2.x, 2) + Math.pow(point1.y-point2.y, 2)); |