Skip to content

Instantly share code, notes, and snippets.

@Solomko2
Solomko2 / calendar.component.html
Created June 4, 2019 21:43 — forked from bentedder/calendar.component.html
calendar component angular 4
<div class="calendar">
<div class="calendar-navs">
<div class="month-nav">
<button (click)="prevMonth()">&lt;</button>
<span class="p4">{{ currentDate.format('MMMM') }}</span>
<button (click)="nextMonth()">&gt;</button>
</div>
<div class="year-nav">
<button (click)="prevYear()">&lt;</button>
<span>{{ currentDate.format('YYYY') }}</span>
@Solomko2
Solomko2 / prerender-cloudfront.yml
Created May 16, 2019 09:10 — forked from amits97/prerender-cloudfront.yml
CloudFormation config for redirecting crawlers to Prerender.io
Parameters:
PrerenderToken:
Type: String
S3BucketName:
Type: String
Resources:
WebBucket:
Type: "AWS::S3::Bucket"
Properties:
BucketName:
@Solomko2
Solomko2 / timer.js
Created January 11, 2019 09:42
timer.js
function Timer(callback, interval){
let timerId;
function executeAndStartTimer(){
callback().then(function makeNewCall(){
timerId = setTimeout(executeAndStartTimer, interval);
});
}
function stop(){
if(timerId){
clearTimeout(timerId);
@Solomko2
Solomko2 / composing-software.md
Created December 26, 2018 12:01 — forked from Geoff-Ford/composing-software.md
Eric Elliott's Composing Software Series
@Solomko2
Solomko2 / opentok_multiple_sessions.html
Created October 18, 2018 09:05 — forked from doomhz/opentok_multiple_sessions.html
OpenTok Multiple sessions and one publisher example
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>OpenTok API Sample &#8212; 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">
@Solomko2
Solomko2 / lazyFor.directive.ts
Created May 13, 2018 17:23
lazy loading for
import {
Input, Directive, ViewContainerRef,
OnInit, TemplateRef, DoCheck,
IterableDiffers, IterableDiffer
} from '@angular/core';
@Directive({
selector: '[lazyFor]'
})
export class LazyForDirective implements DoCheck, OnInit {
/*!
* 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.
*
@Solomko2
Solomko2 / password-regex.js
Created April 24, 2018 09:21
Minimum eight characters, at least one letter and one number
// 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:
@Solomko2
Solomko2 / multippleupload.ts
Created March 20, 2018 14:20
angular ngrx forkJoin upload multiple
@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;
@Solomko2
Solomko2 / 7_function.js
Created October 25, 2017 08:11
7 Essential JavaScript Function
// 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) {