A simple SVG-based radar or spider chart for mithril without any external dependencies, based on the source code found here.
This file contains 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 const capitalize = (s: string) => s.charAt(0).toUpperCase() + s.slice(1); | |
/** Capitalize first names that are derived from an email, like anne_merel or jan_willem. */ | |
export const capitalizeName = (s: string) => | |
/^ij/i.test(s) // names like IJsbrand | |
? s.replace(/^ij/i, 'IJ') | |
: /_/.test(s) // names like jan_willem | |
? s.split('_').map(capitalize).join('-') | |
: capitalize(s); // other names |
This file contains 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 interface IObject { | |
[key: string]: any; | |
} | |
/* | |
This work is licensed under Creative Commons GNU LGPL License. | |
License: http://creativecommons.org/licenses/LGPL/2.1/ | |
Version: 0.9 | |
Author: Stefan Goessner/2006, | |
Conversion: Erik Vullings/2021 converted to TypeScript |
Error: listen EADDRINUSE: address already in use :::1234
When node.js complains that an address is in use, this may happen because the service did not end properly. In order to kill the hanging process, do the following in an Admin PowerShell window:
netstat -ano|findstr "PID :1234"
You can use a commandline field in your profile configuration to initiate an SSH connection on tab creation.
Step-by-step guide:
- Open Settings (Ctrl+,)
- Find the "list" array in the "profiles" object
- Duplicate a Command Prompt profile ("commandline": "cmd.exe")
- Change the commandline value to:
ssh me@my-server -p 22 -i ~/.ssh/id_rsa
(use your own connection command).
This file contains 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
/* A list of useful functions snippets */ | |
/** | |
* Create a GUID | |
* @see https://stackoverflow.com/a/2117523/319711 | |
* | |
* @returns RFC4122 version 4 compliant GUID | |
*/ | |
export const uuid4 = () => { | |
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => { |
This file contains 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
/** | |
* Use IndexedDB for local storage. | |
* Based on https://github.com/DVLP/localStorageDB, but converted to TypeScript and using async instead of callbacks. | |
* @source: https://github.com/DVLP/localStorageDB/blob/master/localdata.js | |
* | |
* Usage example | |
* | |
* | |
```ts | |
const test = async () => { |
This file contains 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 url = "https://www.lancasterguardian.co.uk/read-this/womens-world-cup-2023-groups-england-to-face-denmark-and-china-see-the-full-draw-3890113"; | |
const url1 = "https://www.tudelft.nl"; | |
const url2 = "https://whatsnew2day.com/world-cup-2023-draw-uswnt-face-vietnam-netherlands-playoff-winner-new-zealand-htmlns_mchannelrssns_campaign1490ito1490/"; | |
const url3 = "https://www.news4jax.com/news/politics/2022/10/22/weapons-shortages-could-mean-hard-calls-for-ukraines-allies/"; | |
const extractAgency = (url = '') => { | |
if (url.startsWith('https://t.me/')) return 'TELEGRAM'; | |
let hostname: string; | |
try { | |
const u = new URL(url); |