Skip to content

Instantly share code, notes, and snippets.

John Villavicencio jjvillavicencio

Block or report user

Report or block jjvillavicencio

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View phone.validator.ts
import { AbstractControl, ValidatorFn } from '@angular/forms';
import libphonenumber from 'google-libphonenumber';
export class PhoneValidator {
// Inspired on: https://github.com/yuyang041060120/ng2-validation/blob/master/src/equal-to/validator.ts
static validCountryPhone = (countryControl: AbstractControl): ValidatorFn => {
let subscribe: boolean = false;
return (phoneControl: AbstractControl): {[key: string]: boolean} => {
@jjvillavicencio
jjvillavicencio / phone.validator.ts
Created Apr 23, 2019 — forked from djabif/phone.validator.ts
Angular Phone + Country Validator
View phone.validator.ts
//Complete example for Ionic Framework in: https://ionicthemes.com/tutorials/about/forms-and-validation-in-ionic
//Complete example for Angular 5 in: https://angular-templates.io/tutorials/about/angular-forms-and-validations
import { AbstractControl, ValidatorFn } from '@angular/forms';
import * as libphonenumber from 'google-libphonenumber';
export class PhoneValidator {
// Inspired on: https://github.com/yuyang041060120/ng2-validation/blob/master/src/equal-to/validator.ts
static validCountryPhone = (countryControl: AbstractControl): ValidatorFn => {
@jjvillavicencio
jjvillavicencio / password.validator.ts
Created Apr 23, 2019 — forked from djabif/password.validator.ts
Password Validator for ionic apps
View password.validator.ts
import { FormControl, FormGroup } from '@angular/forms';
export class PasswordValidator {
static areEqual(formGroup: FormGroup) {
let val;
let valid = true;
for (let key in formGroup.controls) {
if (formGroup.controls.hasOwnProperty(key)) {
let control: FormControl = <FormControl>formGroup.controls[key];
@jjvillavicencio
jjvillavicencio / form.ts
Created Apr 23, 2019 — forked from djabif/form.ts
Ionic Password validator
View form.ts
import { PasswordValidator } from '../../validators/password.validator';
this.matching_passwords_group = new FormGroup({
password: new FormControl('', Validators.compose([
Validators.minLength(5),
Validators.required,
Validators.pattern('^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])[a-zA-Z0-9]+$') //this is for the letters (both uppercase and lowercase) and numbers validation
])),
confirm_password: new FormControl('', Validators.required)
}, (formGroup: FormGroup) => {
return PasswordValidator.areEqual(formGroup);
@jjvillavicencio
jjvillavicencio / README-Template.md
Created Apr 18, 2019 — forked from PurpleBooth/README-Template.md
A template to make good README.md
View README-Template.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

View saludo.js
var fecha = new Date();
var horaActual = fecha.getHours();
var saludo;
if (horaActual > 18) {
saludo = 'Buenas noches, '
} else if (horaActual > 12) {
saludo = 'Buenas tardes, '
} else if (horaActual > 0) {
saludo = 'Buen día, '
@jjvillavicencio
jjvillavicencio / mysql_backup_cron.sh
Created Dec 10, 2018 — forked from jabranr/mysql_backup_cron.sh
Automatic MySQL dump and backup to Git repo cron job
View mysql_backup_cron.sh
#!/bin/sh
#
# @author: Jabran Rafique <hello@jabran.me>
# @link: http://jabran.me/articles/automatic-database-backup-using-git-hosting/
# Set variables
FULLDATE = $(date +"%Y-%d-%m %H:%M")
NOW = $(date +"%Y-%m-%d-%H-%M")
MYSQL_DUMP = `which mysqldump`
GIT = `which git`
@jjvillavicencio
jjvillavicencio / setup.sh
Last active Jun 11, 2019
Install Android SDK on Windows Bash (WSL)
View setup.sh
cd /home/<user>/
sudo apt-get install unzip
wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
unzip sdk-tools-linux-4333796.zip -d Android
rm sdk-tools-linux-4333796.zip
sudo apt-get install -y lib32z1 openjdk-8-jdk
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH=$PATH:$JAVA_HOME/bin
printf "\n\nexport JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64\nexport PATH=\$PATH:\$JAVA_HOME/bin" >> ~/.bashrc
cd Android/tools/bin
View starUml3.md

Recientemente StarUML se actualizó de 2.0 a 3.0. El método de crack original, la forma de modificar la función de verificación de licencia no se puede usar. La ubicación de instalación ha cambiado y se ha encontrado el archivo LicenseManagerDomain.js. ¿Qué debería hacer? El viejo conductor les dijo a todos que resolvieran el problema.

StarUML está escrito en nodejs. Específicamente, está escrito en el marco frontal de Electron. Todo el código fuente de starUML en la nueva versión viene empaquetado por la herramienta asar.

Ingresar al directorio (Windows)

C:\Program Files\StarUML\resources

View formulario.component.ts
import { Component, OnInit } from '@angular/core';
import { FormGroup, FormControl } from '@angular/forms';
import { FileHolder } from 'angular2-image-upload';
@Component({
selector: 'app-add-conductor',
templateUrl: './add-conductor.component.html',
styleUrls: ['./add-conductor.component.css']
})
export class AddConductorComponent implements OnInit {
You can’t perform that action at this time.