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
/^((\+|\+\(|\(\+)?[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 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 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 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 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 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 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 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 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:dart_date/dart_date.dart'; | |
import 'dart:convert'; | |
class LastActivities { | |
Date all; | |
MoviesActivities movies; | |
EpisodesActivities episodes; | |
ShowsActivities shows; | |
SeasonsActivities seasons; | |
CommentsActivities comments; | |
ListsActivities lists; |
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 { NgModule } from '@angular/core'; | |
import { MatDialogModule } from '@angular/material'; | |
import { NoopAnimationsModule } from '@angular/platform-browser/animations'; | |
import { OverlayContainer } from '@angular/cdk/overlay'; | |
export const TEST_DIRECTIVES = [ | |
Components, Pipes | |
]; | |
@NgModule({ |