This file contains 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
#!/bin/bash | |
# -------------------------------- | |
<< 'user-option-prompting' | |
while getopts "s:e:w:" option; do | |
case "${option}" in | |
w) WS=${OPTARG};; | |
s) SUBSCRIPTION=${OPTARG};; | |
e) EXCLUDE=${OPTARG};; |
This file contains 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
import * as fs from 'fs'; | |
import * as zlib from 'zlib'; | |
const file = process.argv[2]; // node index.mjs <file> | |
fs.createReadStream(file) | |
.pipe(zlib.createGzip()) | |
.on('data', () => process.stdout.write('.')) | |
.pipe(fs.createWriteStream('fileZipped.gz')) | |
.on('finish', () => console.log('done')); |
This file contains 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
import { Transform } from 'stream'; | |
const upperCaseTransform = new Transform({ | |
transform(chunk, encoding, next) { | |
this.push(chunk.toString().toUpperCase()); | |
next(); | |
} | |
}); | |
process.stdin.pipe(upperCaseTransform).pipe(process.stdout); |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js"></script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
<script src="https://frontendmasters.com/assets/resources/functionaljs/pointfree.browser.js"></script> | |
<script src="https://frontendmasters.com/assets/resources/functionaljs/data.maybe.umd.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/ramda/0.8.0/ramda.min.js"></script> | |
</head> |
This file contains 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
{ | |
"compileOnSave": false, | |
"compilerOptions": { | |
"baseUrl": "./", | |
"outDir": "./dist/out-tsc", | |
"sourceMap": true, | |
"declaration": false, | |
"downlevelIteration": true, | |
"experimentalDecorators": true, | |
"module": "esnext", |
This file contains 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 appDiv: HTMLElement = document.getElementById('app'); | |
function* autoIncrement(){ | |
let num = 0; | |
while (num < 11) { | |
yield num++; | |
} | |
} |
This file contains 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
import * as React from "react"; | |
import { render } from "react-dom"; | |
import * as PropTypes from "prop-types"; | |
const userPropTypes = { | |
name: PropTypes.string.isRequired, | |
className: PropTypes.string | |
}; | |
const userDefaultProps = { |
This file contains 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
import { | |
debounceTime, | |
distinctUntilChanged, filter, | |
map, | |
switchMap | |
} from 'rxjs/operators'; | |
//... | |
this.searchResult$ = this.queries$.pipe( | |
map((query: string) => query ? query.trim() : ''), |
This file contains 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
import { Component, OnInit, QueryList, ViewChildren, ElementRef} from '@angular/core'; | |
@Component({ | |
selector: 'my-app', | |
templateUrl: './app.component.html', | |
styleUrls: [ './app.component.css' ] | |
}) | |
export class AppComponent { | |
name = 'Angular'; | |
@ViewChildren('foo') list: QueryList<ElementRef>; |
This file contains 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 uranus = {}; | |
const trace = label => value => { | |
console.log(`${ label }: $ { value }`); | |
return value; | |
} | |
Object.defineProperty(uranus, 'compose', { | |
value: (...fns) => value => fns.reduceRight((g,f) => f(g), value), | |
configurable: false |