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
| Easy to use Maintenance page as a Cloudflare Worker. Once set up, you can enable it for unlimited pages in your CF account. Get rid of greedy subscriptions that charge you per domain. | |
| How to: | |
| 1. Go to Cloudflare Workers and create a new Worker (url is https://dash.cloudflare.com/<your-id>/workers/new) | |
| 2. paste the Code from above | |
| 3. Set an AUTH_KEY and AUTH_VALUE and the maintenancePageHtml (optionally) | |
| 4. deploy the worker | |
| 5. goto Cloudflare and choose a domain, click on the Workers section (url is https://dash.cloudflare.com/<your-id>/<domain>/workers) | |
| 6. click on "Add Route" and set the Route you want to enable the maintenance page for (typically <domain>/*) | |
| 7. choose your previously created worker from the dropdown |
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
| import { Inject, LOCALE_ID, Pipe, PipeTransform } from '@angular/core'; | |
| /* | |
| *ngFor="let o of someArry | sortArray:'desc'" | |
| */ | |
| @Pipe({ | |
| name: 'sortArray', | |
| }) | |
| export class SortArrayPipe implements PipeTransform { | |
| collator: Intl.Collator; |
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
| import { Pipe, PipeTransform } from '@angular/core'; | |
| import { DomSanitizer, SafeHtml, SafeStyle, SafeScript, SafeUrl, SafeResourceUrl } from '@angular/platform-browser'; | |
| @Pipe({ | |
| name: 'safe' | |
| }) | |
| export class SafePipe implements PipeTransform { | |
| constructor(protected sanitizer: DomSanitizer) {} | |
| public transform(value: any, type: string): SafeHtml | SafeStyle | SafeScript | SafeUrl | SafeResourceUrl { |
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
| <Directory "****"> | |
| SetEnvIf Origin "^http(s)?://.+$" AccessControlAllowOrigin=$0 | |
| Header always set Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin | |
| Header always set Access-Control-Allow-Credentials true env=AccessControlAllowOrigin | |
| Header always set Access-Control-Allow-Methods "HEAD, POST, GET, OPTIONS, DELETE, PUT" | |
| Header always set Access-Control-Allow-Headers "x-requested-with, Content-Type, origin, authorization, accept, client-security-token" | |
| </Directory> |
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
| import { Directive, Renderer2, ElementRef, AfterViewInit } from '@angular/core' | |
| @Directive({ | |
| selector: '[inputWrapper]' | |
| }) | |
| export class InputWrapperDirective implements AfterViewInit { | |
| constructor(private _renderer:Renderer2, private _el: ElementRef) { | |
| } |
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
| import { Component, EventEmitter, Input, Output } from '@angular/core'; | |
| import * as iso3166 from 'iso-3166-2/iso3166.min'; | |
| @Component({ | |
| selector: 'app-country-select', | |
| template: ` | |
| <select name="theme" [class]="'form-control' + (size ? ' form-control-' + size : '')" | |
| [ngModel]="countryIsoCode" (ngModelChange)="change($event)"> | |
| <option *ngFor="let country of countries" [ngValue]="country.value">{{country.display}}</option> |
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
| import { ChangeDetectorRef } from '@angular/core'; | |
| /** | |
| * @whatItDoes decorates Component with toggleOrder(property), get list() and get(CSS)Class functions. | |
| * | |
| * @howToUse | |
| * \@Component({ | |
| * template: ` | |
| * <table> | |
| * <tr> |
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
| import { | |
| Component, ElementRef, Input, OnInit, Renderer2 | |
| } from '@angular/core'; | |
| /** | |
| * @whatItDoes Add show hide button to text/password input fields. | |
| * | |
| * @howToUse | |
| * <show-hide-password size="sm|lg"> | |
| * <input type="password" name=... /> |