A collection of links to the excellent"Composing Software" series of medium stories by Eric Elliott.
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
<div class="calendar"> | |
<div class="calendar-navs"> | |
<div class="month-nav"> | |
<button (click)="prevMonth()"><</button> | |
<span class="p4">{{ currentDate.format('MMMM') }}</span> | |
<button (click)="nextMonth()">></button> | |
</div> | |
<div class="year-nav"> | |
<button (click)="prevYear()"><</button> | |
<span>{{ currentDate.format('YYYY') }}</span> |
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
Parameters: | |
PrerenderToken: | |
Type: String | |
S3BucketName: | |
Type: String | |
Resources: | |
WebBucket: | |
Type: "AWS::S3::Bucket" | |
Properties: | |
BucketName: |
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
function Timer(callback, interval){ | |
let timerId; | |
function executeAndStartTimer(){ | |
callback().then(function makeNewCall(){ | |
timerId = setTimeout(executeAndStartTimer, interval); | |
}); | |
} | |
function stop(){ | |
if(timerId){ | |
clearTimeout(timerId); |
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 lang="en"> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
<title>OpenTok API Sample — Basic Tutorial</title> | |
<link href="samples.css" type="text/css" rel="stylesheet" > | |
<script src="http://staging.tokbox.com/v0.91/js/TB.min.js" type="text/javascript" charset="utf-8"></script> | |
</head> | |
<body> | |
<script type="text/javascript" charset="utf-8"> |
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 { | |
Input, Directive, ViewContainerRef, | |
OnInit, TemplateRef, DoCheck, | |
IterableDiffers, IterableDiffer | |
} from '@angular/core'; | |
@Directive({ | |
selector: '[lazyFor]' | |
}) | |
export class LazyForDirective implements DoCheck, OnInit { |
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
/*! | |
* VERSION: 0.2.0 | |
* DATE: 2015-09-30 | |
* UPDATES AND DOCS AT: http://greensock.com | |
* | |
* @license Copyright (c) 2008-2015, GreenSock. All rights reserved. | |
* MorphSVGPlugin is a Club GreenSock membership benefit; You must have a valid membership to use | |
* this code without violating the terms of use. Visit http://greensock.com/club/ to sign up or get more details. | |
* This work is subject to the software agreement that was issued with your membership. | |
* |
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
// Minimum eight characters, at least one letter and one number: | |
"^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,}$" | |
// Minimum eight characters, at least one letter, one number and one special character: | |
"^(?=.*[A-Za-z])(?=.*\d)(?=.*[$@$!%*#?&])[A-Za-z\d$@$!%*#?&]{8,}$" | |
// Minimum eight characters, at least one uppercase letter, one lowercase letter and one number: | |
"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{8,}$" | |
// Minimum eight characters, at least one uppercase letter, one lowercase letter, one number and one special character: |
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
@Effect() | |
multiple$ = this.actions.pipe( | |
ofType(fromActions.UPLOAD_BILL), | |
withLatestFrom(this.store.select(fromStrpGeneralSelectors.selectBuildingId)), | |
map(([action, buildingId]): any => { | |
return {action, buildingId}; | |
}), | |
mergeMap(({action, buildingId}) => { | |
const {files, category} = action.payload; |
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
// debounce | |
// The debounce function can be a game-changer when it comes to event-fueled performance. | |
// If you aren't using a debouncing function with a scroll, resize, key* event, you're probably doing it wrong. | |
// Here's a debounce function to keep your code efficient: | |
// Returns a function, that, as long as it continues to be invoked, will not | |
// be triggered. The function will be called after it stops being called for | |
// N milliseconds. If `immediate` is passed, trigger the function on the | |
// leading edge, instead of the trailing. | |
function debounce(func, wait, immediate) { |
NewerOlder