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
const fibonacci = (num: number): number => { | |
if (num === 1 || num === 2) { | |
return 1; | |
} | |
return fibonacci(num - 1) + fibonacci(num - 2); | |
}; |
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
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 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 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 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 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 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 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 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 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
image: node:6.9.4 | |
pipelines: | |
branches: | |
master: | |
- step: | |
script: | |
- apt-get update; apt-get install -y gettext-base; | |
- echo 'deb http://dl.google.com/linux/chrome/deb/ stable main' > /etc/apt/sources.list.d/chrome.list | |
- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - | |
- set -x && apt-get update && apt-get install -y xvfb google-chrome-stable |