/**
* @param {String} s Input string.
* @param {Object} options Options.
* @param {Object.<string,any>} options.vars Variables: `{varname:format}`.
* @param {Array} options.args Arguments: `%0, %1, %2...`.
* @param {CallableFunction} options.fmt Format `function(varname,format)`.
*/
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
| /* | |
| AutoHotkey script - Windows Explorer | |
| Author: https://github.com/flipeador | |
| AutoHotkey: https://www.autohotkey.com | |
| */ | |
| #Requires AutoHotkey v2.0 | |
| #SingleInstance Force | |
| #UseHook |
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 str = encode('→<Hello.World/>←'); | |
| console.log('encoded:', `_${str}_ (${str.length})`); | |
| console.log('decoded:', decode(str)); | |
| function encode(str, off='', on='', sep='') { | |
| return [...(new TextEncoder()).encode(str)].map(byte => ( | |
| byte.toString(2).split('').map(bit => (bit === '0' ? off : on)) | |
| ).join('')).join(sep); | |
| } |
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
| /** | |
| * Language-sensitive relative time formatting. | |
| * @see https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat | |
| * @example | |
| * // now | |
| * console.log(formatRelativeTime( | |
| * '2000/01/01 00:00:00', | |
| * '2000/01/01 00:00:00' | |
| * )); | |
| * |
A character is an overloaded term that can mean many things. This gist will briefly touch on the differences between Code Point, Code Unit, Grapheme and Glyph, with a particular focus on emojis.
Tip
Use [Full Emoji Support For All Websites][emoji] to ensure correct rendering of all emoji graphemes on any website.
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 $REF = Symbol(); | |
| const $DEL = Symbol(); | |
| /** | |
| * Set a cleanup callback for the specified object. | |
| * @param {object} target | |
| * The target value to register. | |
| * @param {Function} callback | |
| * Function called when the target is garbage-collected. | |
| * @returns {Function} |
Synchrony implies that the execution of multiple tasks occurs sequentially one after the other. Tasks are like steps that are executed in order, each operation blocks the others until completion.
Task #1 ├───────────┤............................
Task #2 .............├────────────┤..............
OlderNewer