Prereq:
apt-get install zsh
apt-get install git-coreInstall oh-my-zsh.
| // Types for the result object with discriminated union | |
| type Success<T> = [T, null] | |
| type Failure<E> = [null, E] | |
| type Result<T, E = Error> = Success<T> | Failure<E>; | |
| // Main wrapper function | |
| export async function tryCatch<T, E = Error>( | |
| promise: Promise<T>, | |
| ): Promise<Result<T, E>> { | |
| try { |
Prereq:
apt-get install zsh
apt-get install git-coreInstall oh-my-zsh.
| app.filter( 'bytes', function bytesFilter () { | |
| 'use strict'; | |
| return function bytesReturn ( bytes, precision ) { | |
| if ( bytes === 0 ) { | |
| return '0 bytes'; | |
| } | |
| if ( isNaN( parseFloat( bytes ) ) || !isFinite( bytes ) ) { | |
| return '-'; |
| [ | |
| { "keys": ["ctrl+shift+x"], "command": "tidy_xml" }, | |
| { "keys": ["ctrl+shift+j"], "command": "prettify_json" } | |
| ] |