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 | |
| git branch -D gh-pages | |
| git push origin --delete gh-pages | |
| git checkout -b gh-pages | |
| ionic build --prod | |
| find . -type d ! -path './www*' ! -path './.git*' ! -path '.' | xargs rm -rf | |
| rm -r *.* | |
| mv www/* . | |
| rm -rf www | |
| git add . |
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 { Geolocation } from '@ionic-native/geolocation'; | |
| ... | |
| constructor(private geolocation: Geolocation) {} | |
| ... | |
| let watch = this.geolocation.watchPosition(); | |
| watch.subscribe((data) => { |
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
| apt-get update | |
| apt-get install graphviz | |
| pip install pygraphviz | |
| pip install pyparsing==1.5.7 | |
| pip install pydot | |
| python manage.py graph_models --pydot -a -g -o {{project}}-dbmodel.png |
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 { PageTopTransition } from './core/transitions/page-top.trasnsition'; | |
| import { Component } from '@angular/core'; | |
| import { Platform } from 'ionic-angular'; | |
| import { StatusBar } from '@ionic-native/status-bar'; | |
| import { SplashScreen } from '@ionic-native/splash-screen'; | |
| @Component({ | |
| templateUrl: 'app.html' | |
| }) |
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
| node_modules/.bin/knex migrate:make migrate_name | |
| node_modules/.bin/knex seed:make seed_name |
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
| vim ~/.ssh/config | |
| Host name | |
| HostName xxxx | |
| Port 22 | |
| User root | |
| IdentityFile ~/.ssh/your_key | |
| ssh name |
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
| docker service create -d \ | |
| -e CLEAN_PERIOD=900 \ | |
| -e DELAY_TIME=600 \ | |
| --log-driver json-file \ | |
| --log-opt max-size=1m \ | |
| --log-opt max-file=2 \ | |
| --name=cleanup \ | |
| --mode global \ | |
| --mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \ | |
| meltwater/docker-cleanup |
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
| export class GeneratorService { | |
| generate(labels: string[], numRange: [number, number], width: number): EmployeeData[] { | |
| const result: EmployeeData[] = []; | |
| for (let i = 0; i < width; i += 1) { | |
| result.push(this.generateNode(labels, numRange)); | |
| } | |
| return result; | |
| } |
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
| const fibonacci = (num: number): number => { | |
| if (num === 1 || num === 2) { | |
| return 1; | |
| } | |
| return fibonacci(num - 1) + fibonacci(num - 2); | |
| }; |
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
| static passwordMatchValidator(control: AbstractControl) { | |
| const password: string = control.get('password').value; // get password from our password form control | |
| const confirmPassword: string = control.get('confirmPassword').value; // get password from our confirmPassword form control | |
| // compare is the password math | |
| if (password !== confirmPassword) { | |
| // if they don't match, set an error in our confirmPassword form control | |
| control.get('confirmPassword').setErrors({ NoPassswordMatch: true }); | |
| } | |
| } |