- Download the perforce visual tool suite from here: http://www.perforce.com/perforce/downloads/index.html
- Copy only the p4merge.app file into your /Applications/ directory
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 { FormControl, FormGroup } from '@angular/forms'; | |
export class PasswordValidator { | |
// If our validation fails, we return an object with a key for the error name and a value of true. | |
// Otherwise, if the validation passes, we simply return null because there is no error. | |
static areNotEqual(formGroup: FormGroup) { | |
let firstControlValue: any; | |
let valid = true; |
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 {Injectable} from '@angular/core'; | |
import {BehaviorSubject, Observable} from "rxjs"; | |
import {AngularFirestore} from "@angular/fire/firestore"; | |
import {map, mergeMap, scan, tap, throttleTime} from "rxjs/operators"; | |
import {ChangeEvent} from "ngx-virtual-scroller"; | |
/** | |
* Enables infinite scrolling with ngx-virtual-scroller and Firestore. Most of the hard work goes to | |
* https://angularfirebase.com/lessons/infinite-virtual-scroll-angular-cdk. | |
* |
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
//Complete example for Ionic Framework in: https://ionicthemes.com/tutorials/about/forms-and-validation-in-ionic | |
//Complete example for Angular 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 => { |
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 { 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); |
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 { Pipe, PipeTransform } from '@angular/core'; | |
@Pipe({name: 'slugify'}) | |
export class SlugifyPipe implements PipeTransform { | |
transform(input: string): string { | |
return input.toString().toLowerCase() | |
.replace(/\s+/g, '-') // Replace spaces with - | |
.replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
.replace(/\-\-+/g, '-') // Replace multiple - with single - | |
.replace(/^-+/, '') // Trim - from start of 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
angular.module('sfViewCtrlDirective', []) | |
.directive('open', OpenDirective); | |
function OpenDirective() { | |
return { | |
restrict: 'A', | |
link: function($scope, $element, $attr) { | |
console.log('device is ready'); | |
$element.on('click', function() { |
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
<!-- | |
This disables app transport security and allows non-HTTPS requests. | |
Note: it is not recommended to use non-HTTPS requests for sensitive data. A better | |
approach is to fix the non-secure resources. However, this patch will work in a pinch. | |
To apply the fix in your Ionic/Cordova app, edit the file located here: | |
platforms/ios/MyApp/MyApp-Info.plist | |
And add this XML right before the end of the file inside of the last </dict> entry: |
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
values = [ | |
13.626332 | |
47.989636 | |
9.596008 | |
28.788024 | |
] | |
# Round these percentage values into integers, ensuring that they equal 100% at the end. | |
roundedValues = getLargestRemainder values, 100 | |
# [14, 48, 9, 29] |
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
-- Remove the history from | |
rm -rf .git | |
-- recreate the repos from the current content only | |
git init | |
git add . | |
git commit -m "Initial commit" | |
-- push to the github remote repos ensuring you overwrite history | |
git remote add origin [email protected]:<YOUR ACCOUNT>/<YOUR REPOS>.git |
NewerOlder