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 set = new Set(); | |
const map = new Map(); | |
const obj = {}; | |
const arr = []; | |
const values = []; | |
const getchar = n => String.fromCharCode(n); | |
const timed = (f) => (...args) => { | |
const start = performance.now(); | |
f(...args); |
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 const partition = <T>(list: T[], callback: (item: T) => boolean): [T[], T[]] => { | |
const passed: T[] = []; | |
const failed: T[] = []; | |
if (!Array.isArray(list) || list.length === 0) { | |
return [passed, failed]; | |
} | |
for (const item of list) { | |
if (!callback(item)) { |
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
class ArrayLike<T> implements Iterable<T> { | |
private _values: Record<number, T> = {}; | |
private _size: number; | |
constructor(...values: T[]) { | |
this._values = {}; | |
this._size = 0; | |
values.forEach(val => this.add(val)); | |
} | |
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 colors = { | |
Reset: '\x1b[0m', | |
Bright: '\x1b[1m', | |
Dim: '\x1b[2m', | |
Underscore: '\x1b[4m', | |
Blink: '\x1b[5m', | |
Reverse: '\x1b[7m', | |
Hidden: '\x1b[8m', | |
FgBlack: '\x1b[30m', |
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
{"lastUpload":"2022-01-23T03:36:45.960Z","extensionVersion":"v3.4.3"} |
- Use setxkbmap to remap the key (does not require a daemon and is independent of your desktop environment or window manager). Don't forget to add the command before the exec gnome-session (or similar) line in your ~/.xinitrc or ~/.xsession:
setxkbmap -option caps:escape
setxkbmap can be found in package extra/xorg-setxkbmap.
dconf-editor → org.gnome.desktop.input-sources.xkb-options → Add caps:escape to the aforementioned field.
gnome-session-settings → Startup Programs → Add → Name=Remap caps lock to escape, command=setxkbmap -option caps:escape
FYI, I obtained the XKB rule by grepping /usr/share/X11/xkb/rules for caps and esc.
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
____ |~~~~~~~~~~~~~| | |
Y_,___|[]| | Ship it! | | |
{|_|_|_|##|==|_____________| | |
//●●---●●=●● OOO OOO |
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
`. ___ | |
__,' __`. _..----....____ | |
__...--.'``;. ,. ;``--..__ .' ,-._ _.-' | |
_..-''-------' `' `' `' O ``-''._ (,;') _,' | |
,'________________ \`-._`-',' | |
`._ ```````````------...___ '-.._'-: | |
```--.._ ,. ````--...__\-. | |
`.--. `-` Ship it! ____ | |` | |
`. `. ,'`````. ; ;` | |
`._`. __________ `. \'__/` |
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
| | | | |
)_) )_) )_) | |
)___))___))___)\ | |
)____)____)_____)\\ | |
_____|____|____|____\\\__ | |
---------\ Ship it! ~~~~~~ /--------- | |
^^^^^ ^^^^^^^^^^^^^^^^^^^^^ | |
^^^^ ^^^^ ^^^ ^^ | |
^^^^ ^^^ |