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
| onEdit($event: Event) { | |
| if( $event instanceof KeyboardEvent ) { | |
| let key = ($event.keyCode || $event.charCode); | |
| let maxLength = ($event.target as HTMLInputElement).maxLength; | |
| let valueLength = ($event.target as HTMLInputElement).value.length; | |
| if(maxLength === valueLength) { | |
| let index = this.inputs.map(e => e.nativeElement) | |
| .findIndex(e => e === $event.target); | |
| let next = (index + 1) > (this.inputs.length - 1) ? (this.inputs.length - 1) : (index + 1); | |
| (this.inputs[next].nativeElement as HTMLInputElement).focus(); |
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
| public only($event: KeyboardEvent) { | |
| console.log("press"); | |
| let regex: RegExp = new RegExp(/^[0-9a-zA-Z]{1,}$/g); | |
| let specialKeys: Array<string> = ['Backspace', 'Tab', 'End', 'Home', 'ArrowRight','ArrowLeft']; | |
| if (specialKeys.indexOf($event.key) !== -1) { | |
| return; | |
| } else { | |
| if (regex.test($event.key)) { | |
| return true; | |
| } else { |
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 'package:flutter/cupertino.dart'; // importa todas las funciones sin prefix | |
| // import 'package:flutter/cupertino.dart' as cupertino; // go-style use cupertino.runApp(... | |
| void main(){ | |
| runApp( | |
| Center( | |
| child: Text( | |
| 'Hello World', | |
| ), // Text | |
| ) |
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
| // Select <gh-event> in Elements panel then in | |
| // Console paste: | |
| var eventForm = ng.probe($0).componentInstance.eventForm; | |
| var FormArray = eventForm.constructor; | |
| var FormGroup = eventForm.controls[0].constructor; | |
| var findInvalidControlsRecursive = function findInvalidControlsRecursive(formToInvestigate) { | |
| var invalidControls = []; | |
| var recursiveFunc = function (form) { | |
| Object.keys(form.controls).forEach(function (field) { | |
| var control = form.get(field); |
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
| (async () => { | |
| const { ajax: ajaxp, operators, from } = rxjs; | |
| const { ajax } = ajaxp; | |
| const { getJSON } = ajax; | |
| const { map, flatMap, toArray } = operators; | |
| const promise = | |
| getJSON( | |
| "https://pokeapi.co/api/v2/pokemon/" | |
| ) | |
| .pipe( |
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
| xattr -cr /Applications/<app>.app |
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
| @echo off | |
| :: | |
| :: RefreshEnv.cmd | |
| :: | |
| :: Batch file to read environment variables from registry and | |
| :: set session variables to these values. | |
| :: | |
| :: With this batch file, there should be no need to reload command | |
| :: environment every time you want environment changes to propagate |
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
| /^((\+|\+\(|\(\+)?[0-9]+\)?)?([0-9]+| |-|\.)+(((extension|ext|ext\.|extension\.|ex|ex\.|e|e\.)? ?)[0-9]+)?$/igm | |
| ^((\+|\+\(|\(\+)?[0-9]+\)?)?([0-9]+| |-|\.)+(((extension|ext|ext\.|extension\.|ex|ex\.|e|e\.)? ?)[0-9]+)?$ |
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
| $x48: 48em; | |
| $x64: 64em; | |
| $x75: 75em; | |
| @mixin media($medias){ | |
| @each $media in $medias { | |
| @if $media == xs { | |
| @media only screen and (max-width: $x48) { @content; } | |
| } | |
| @else if $media == sm { |
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
| /** | |
| * Returns value of specified URL parameter. | |
| * @param {String} name Query parameter to return value of. | |
| * @return {String} String of query parameter or null / 0. | |
| */ | |
| getUrlParameter = function(name){ | |
| var results = new RegExp('[\\?&]' + name + '=([^&#?]*)').exec(window.location.href); | |
| if (results==null){ return undefined; } | |
| else { return results[1] || 0; } | |
| } |