Contents:
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
#!/bin/bash | |
# Scroll direction: natural | |
defaults write 'Apple Global Domain' com.apple.swipescrolldirection -bool FALSE | |
# Set the timezone | |
sudo systemsetup -settimezone "Europe/Paris" > /dev/null | |
# Require password immediately after sleep or screen saver begins | |
#defaults write com.apple.screensaver askForPasswordDelay -int 0 |
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 { 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]; |
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
//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 => { |
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 { Observable, throwError } from 'rxjs' | |
import { catchError } from 'rxjs/operators' | |
import { HttpErrorResponse } from '@angular/common/http' | |
export const throwForCodes = (codeErrors: Array<[number, () => Error]>) => { | |
const mappedCodeErrors = new Map(codeErrors) | |
return <T>(source: Observable<T>) => | |
source.pipe(catchError(error => { | |
if (error instanceof HttpErrorResponse) { | |
const mappedErrorFn = mappedCodeErrors.get(error.status) |
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
.css3-radios label { | |
display: inline-block; | |
vertical-align: middle; | |
} | |
.css3-radios input[type="radio"] + span { | |
display: inline-block; | |
vertical-align: middle; | |
} | |
.css3-radios input[type="radio"] + span::before { | |
display: inline-block; |
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
'use strict'; | |
//npm install gulp gulp-minify-css gulp-uglify gulp-clean gulp-cleanhtml gulp-jshint gulp-strip-debug gulp-zip --save-dev | |
var gulp = require('gulp'), | |
clean = require('gulp-clean'), | |
cleanhtml = require('gulp-cleanhtml'), | |
minifycss = require('gulp-minify-css'), | |
jshint = require('gulp-jshint'), | |
stripdebug = require('gulp-strip-debug'), |
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
<script type="text/javascript"> | |
(function () { | |
"use strict"; | |
// once cached, the css file is stored on the client forever unless | |
// the URL below is changed. Any change will invalidate the cache | |
var css_href = './index_files/web-fonts.css'; | |
// a simple event handler wrapper | |
function on(el, ev, callback) { | |
if (el.addEventListener) { | |
el.addEventListener(ev, callback, false); |