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
/* Random Boolean */ | |
var randomNumber = Math.random() >= 0.5; | |
console.log(randomNumber); |
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
/** | |
* ================== angular-ios9-uiwebview.patch.js v1.1.0 ================== | |
* | |
* This patch works around iOS9 UIWebView regression that causes infinite digest | |
* errors in Angular. | |
* | |
* The patch can be applied to Angular 1.2.0 – 1.4.5. Newer versions of Angular | |
* have the workaround baked in. | |
* | |
* To apply this patch load/bundle this file with your application and add a |
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
files: | |
"/etc/nginx/conf.d/01_websockets.conf": | |
mode: "000644" | |
owner: root | |
group: root | |
content: | | |
upstream nodejs { | |
server 127.0.0.1:8081; | |
keepalive 256; | |
} |
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
Show hidden characters
{ | |
"extends": "tslint:latest", | |
"rules": { | |
"arrow-parens": false, | |
"class-name": false, | |
"no-empty": false, | |
"no-trailing-whitespace": false, | |
"object-literal-sort-keys": false, | |
"interface-name": true, | |
"no-consecutive-blank-lines": false, |
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
// Implementation | |
// --------------- | |
interface Cases<V> { | |
[value: string]: Resolver<V>; | |
default: Resolver<V>; | |
} | |
type Resolver<V> = () => V; | |
const switchcase = <V extends any>(value: string | number, cases: Cases<V>): V => | |
cases[value in cases ? value : 'default'](); |
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
/** | |
* @example | |
* ```ts | |
* const [selectedItems, nonSelectedItems] = partition(array, item => item.selected); | |
* const [ | |
* numsLessThan5, | |
* numsLessThan10, | |
* numsLessThan30, | |
* numsGreaterEquals30 | |
* ] = partition( |