CLICK ME
yes, even hidden code blocks!
print("hello world!")| export class WrappedError<ErrKind = any> extends Error implements Iterable<WrappedError | ErrKind> { | |
| previous: ErrKind | null = null; | |
| guid: Guid; | |
| constructor(message: string, previous?: ErrKind) { | |
| super(message); | |
| // We update the error's name to distinguish it from the base Error. | |
| this.name = this.constructor.name; | |
| this.guid = `<${this.name}:empty>`; | |
| // We add our reference to the original error value (if provided). |
| export class Bits { | |
| static get Nil() { | |
| return 0; | |
| } | |
| static get All() { | |
| // Flip the sign bit out of all bits engaged. | |
| return ~0 ^ (1 << 31); | |
| } |
| /** | |
| * Step 1: | |
| * Create a string enum. This can be done with a TS enum type, | |
| * or a sum type (union of strings). | |
| */ | |
| // enum style | |
| enum TokenType { | |
| Text = "Text", | |
| UserMention = "UserMention", |
| " Specify a directory for plugins | |
| " - For Neovim: ~/.local/share/nvim/plugged | |
| " - Avoid using standard Vim directory names like 'plugin' | |
| call plug#begin('~/.vim/plugged') | |
| Plug 'sheerun/vim-polyglot' | |
| Plug 'itchyny/lightline.vim' | |
| Plug 'joshdick/onedark.vim' | |
| call plug#end() |
| /** | |
| * RegExpURL matches URLs containing a query string. | |
| * - [0] full match | |
| * - [1] base url | |
| * - [2] query string | |
| * - [3] hash (without #) | |
| */ | |
| const RegExpURL = /^(.*)\?([^#]*)(?:#(.*))?$/ | |
| /** | |
| * RegExpListKey matches a URL key/value pair that uses array syntax (`key[]=value`). |
| const tolerance = 200; // swipe distance in pixels | |
| const swipeLeft$ = Rx.Observable.fromEvent(document, "touchstart") | |
| // Switch to listen to touchmove to determine position | |
| .switchMap(startEvent => | |
| Rx.Observable.fromEvent(document, "touchmove") | |
| // Listen until "touchend" is fired | |
| .takeUntil(Rx.Observable.fromEvent(document, "touchend")) | |
| // Output the pageX location | |
| .map(event => event.touches[0].pageX) | |
| // Accumulate the pageX difference from the start of the touch |
| #!/bin/bash | |
| # Run as root | |
| set -e | |
| apt-get update | |
| apt-get install -y build-essential | |
| apt-get install -y libncurses5-dev | |
| useradd mysql |
| function promisify(func, ...args) { | |
| if (arguments.length === 1) { | |
| // Curry with the decremented arity | |
| return promisify.bind(null, func) | |
| } | |
| return new Promise((resolve, reject) => { | |
| func(...args, (error, ...cbArgs) => { | |
| if (error) { | |
| return reject(error) |