Add these files!
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
importScripts( | |
"https://unpkg.com/babel-polyfill@6.26.0/dist/polyfill.min.js", | |
"https://unpkg.com/rxjs@6.3.3/bundles/rxjs.umd.min.js", | |
"https://unpkg.com/zone.js@0.8.26/dist/zone.min.js", | |
"https://unpkg.com/@angular/core@7.0.3/bundles/core.umd.min.js", | |
"https://unpkg.com/@angular/common@7.0.3/bundles/common.umd.min.js", | |
"https://unpkg.com/@angular/compiler@7.0.3/bundles/compiler.umd.min.js", | |
"https://unpkg.com/@angular/platform-browser@7.0.3/bundles/platform-browser.umd.min.js", | |
"https://unpkg.com/@angular/platform-webworker@7.0.3/bundles/platform-webworker.umd.min.js", | |
"https://unpkg.com/@angular/platform-browser-dynamic@7.0.3/bundles/platform-browser-dynamic.umd.min.js", |
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
<h1>{{ title }}</h1> | |
<button (click)="updateMessage()"> | |
Click me! | |
</button> | |
<p *ngFor="let line of message"> | |
{{ line }} | |
</p> |
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 { AbstractControl, FormArray, FormControl, FormGroup } from '@angular/forms'; | |
/** | |
* Creates a nested FormGroup, FormArray, or FormControl with validators | |
* from a given object | |
*/ | |
export const createFormObject = (initial: any): AbstractControl => { | |
if (Array.isArray(initial)) { | |
// detemine if array contains ValidatorFn or ValidatorFn[] | |
// eg: use same syntax as formBuilder |
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> | |
<title>Simple Map</title> | |
<meta name="viewport" content="initial-scale=1.0"> | |
<meta charset="utf-8"> | |
<style> | |
#map { | |
height: 100%; | |
} |
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
// Takes a URL, param name, and data string | |
// Sends to the server.. The server can respond with binary data to download | |
jQuery.download = function(url, key, data) { | |
$('<form/>') | |
.attr('action', url) | |
.attr('method', 'post') | |
.append($('<input/>') | |
.attr('type', 'hidden') | |
.attr('name', key) |
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
<?php | |
/** | |
* A simple class that wraps a PHP array in a functional way. | |
* | |
* Example Usage: | |
* | |
* $val = (new FunctionalArray(range(1, 10))) | |
* ->map (function($value) { return $value * 1; }) | |
* ->filter (function($value) { return $value > 5; }) |
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> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"/> | |
<style> | |
html, body, #map { | |
width: 100%; | |
height: 100%; | |
margin: 0; | |
padding: 0; |
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> | |
<body> | |
<span id="counter"></span> | |
<button id="inc">+</button> | |
<button id="dec">-</button> | |
</body> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/redux/3.7.2/redux.min.js"></script> | |
<script> | |
const reducer = (state, action) => ({ |
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> | |
window.state = {counter: 0}; | |
const listeners = []; | |
const reducer = (state, action) => ({ | |
INC: {...state, counter: state.counter + 1}, |