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
| export const konsole = { | |
| LOG_LEVEL: 'log', | |
| LOG_LEVELS: | |
| { all: 0, debug: 1, log: 2, info: 3, warn: 4, error: 5, none: 6 }, | |
| debug: function() { konsole.write('debug', arguments) }, | |
| info: function() { konsole.write('info', arguments) }, | |
| log: function() { konsole.write('log', arguments) }, | |
| warn: function() { konsole.write('warn', arguments) }, | |
| error: function() { konsole.write('error', arguments) }, |
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, HostListener, forwardRef, AfterViewInit } from '@angular/core'; | |
| import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; | |
| @Component({ | |
| selector: '[text-editable]', | |
| template: '<ng-content></ng-content>', | |
| providers: [ { | |
| provide: NG_VALUE_ACCESSOR, | |
| useExisting: forwardRef(() => TextEditableComponent), multi: true |
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
| function fireDOMChange(el, options={attributes: false, childList: true, subtree: true}) { | |
| const observer = new MutationObserver(list => el.dispatchEvent(new CustomEvent('dom-change', {detail: list}))); | |
| observer.observe(el, options); | |
| } | |
| function waitForIdle(el, options) { | |
| options = Object.assign({ | |
| wait: 100, attributes: false, childList: true, subtree: true | |
| }, options); | |
| return new Promise(resolve => { |
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
| #!/usr/bin/env node | |
| console.log(`************************************************************************* | |
| * This script will | |
| * 1. Clean up local branches after merge and deleted (git remote prune origin) | |
| * 2. Ask you to delete remote your stale branches that are | |
| * - more than 3 months old | |
| * - and, created by you | |
| * To delete all users' stale branches, add --all at the end | |
| ************************************************************************`); | |
| const execSync = require('child_process').execSync; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| export class XTouchSwipe { | |
| constructor(el) { | |
| this.touchStaX; | |
| this.toucnendX; // touch position | |
| this.touchSta; | |
| this.touchEnd; // touch time | |
| el = el || document.body; | |
| if (el.getAttribute('x-swipe') === null) { |
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
| [ | |
| { | |
| "flag": "https://restcountries.eu/data/afg.svg", | |
| "name": "Afghanistan", | |
| "alpha2Code": "AF", | |
| "alpha3Code": "AFG", | |
| "capital": "Kabul", | |
| "subregion": "Southern Asia", | |
| "population": 27657145 | |
| }, |
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
| export class Color { | |
| constructor(color) { | |
| this.r = this.g = this.b = 0; // red, green, blue | |
| this.h = this.s = this.l = 0; // hue, saturation, lightness | |
| this.set(color); | |
| }; | |
| set(color) { // 'rgb(255,255,255)', 'hsl(145, 50%, 50%)', '#FFFFFF' | |
| const hex = color.match(/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i); |
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
| // tslint:disable | |
| import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | |
| import { Pipe, PipeTransform, Injectable, CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA, Directive, Input, Output } from '@angular/core'; | |
| import { isPlatformBrowser } from '@angular/common'; | |
| import { FormsModule, ReactiveFormsModule } from '@angular/forms'; | |
| import { By } from '@angular/platform-browser'; | |
| import { Observable, of as observableOf, throwError } from 'rxjs'; | |
| import { Component, PLATFORM_ID } from '@angular/core'; | |
| import { ExampleComponent } from './example.component'; |
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, ViewEncapsulation, ElementRef, AfterViewInit, HostBinding } from '@angular/core'; | |
| @Component({ | |
| selector: '[oneview-checkbox]', | |
| template: `<ng-content></ng-content>`, | |
| styles: [` | |
| input[oneview-checkbox][type="checkbox"] { | |
| -webkit-appearance: unset; | |
| position: relative; | |
| width: 24px; |