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
| curl -OlL "https://github.com/Carthage/Carthage/releases/download/0.9.4/Carthage.pkg" | |
| sudo installer -pkg "Carthage.pkg" -target / | |
| rm "Carthage.pkg" |
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
| tableView.backgroundColor = UIColor.clear() | |
| let blurEffect = UIBlurEffect(style: .light) | |
| let blurEffectView = UIVisualEffectView(effect: blurEffect) | |
| tableView.backgroundView = blurEffectView |
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
| "CEST": "Europe/Paris", | |
| "WEST": "Europe/Lisbon", | |
| "CDT": "America/Chicago", | |
| "EET": "Europe/Istanbul", | |
| "BRST": "America/Sao_Paulo", | |
| "EEST": "Europe/Istanbul", | |
| "CET": "Europe/Paris", | |
| "MSD": "Europe/Moscow", | |
| "MST": "America/Denver", | |
| "KST": "Asia/Seoul", |
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 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
| mr Marathi | |
| bs Bosnian | |
| ee_TG Ewe (Togo) | |
| ms Malay | |
| kam_KE Kamba (Kenya) | |
| mt Maltese | |
| ha Hausa | |
| es_HN Spanish (Honduras) | |
| ml_IN Malayalam (India) | |
| ro_MD Romanian (Moldova) |
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
| #install | |
| brew install postgres | |
| #Create db | |
| initdb /path/to/db | |
| #creates user with same name as logged OS user without password | |
| #create user | |
| createuser --pwprompt username |
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
| extension ObservableType { | |
| func polling(interval: RxTimeInterval, scheduler: SchedulerType = MainScheduler.instance) -> Observable<E> { | |
| return Observable<Int>.interval(interval, scheduler: scheduler) | |
| .flatMapFirst { _ in | |
| return self.asObservable() | |
| } | |
| } | |
| } |
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
| Observable.deferred { | |
| return NotificationCenter.default | |
| .rx | |
| .notification(notifName) | |
| .map { _ ... } | |
| .startWith(IdentityProviderManager.hasFacebookIdentity) | |
| }.distinctUntilChanged()``` |
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
| Run container with specified pgdata path: | |
| docker run --name pgs-test -p 5432:5432 -v /Users/{user}/pgdata:/var/lib/postgresql/data -e POSTGRES_USER=usr -e POSTGRES_PASSWORD=pass1 -e POSTGRES_DB=db -d pgs-test | |
| Backup: | |
| docker exec pgs-test bash -c 'pg_dump -U usr --format=t --file=/pgback/back1.tar todo' | |
| Restore: | |
| docker exec pgs-test bash -c 'pg_restore -Uusr --create --clean --dbname=todo /pgback/back1.tar' | |
| #dump db |
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
| Archive and zip: tar -zcvf test.tar.gz test.txt | |
| Unzip: tar -zxvf test.tar.gz | |
| List ordered by size: ls -lS | |
| Return first field from text file (space delimeted): cut -d" " -f1 somefile.txt (-d delimeter, -f field number) | |
| SSH not send locale: | |
| Remove SendEnv LANG LC_* line in /etc/ssh/ssh_config | |
| SSH not accept locale: |
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
| #Delete docker container by name example | |
| #!/bin/bash | |
| CONTAINERID="$(docker ps | grep $1 | cut -d" " -f1)" | |
| docker rm -f $CONTAINERID 1> /dev/null 2> /dev/null | |
| if [ $? -eq 0 ] | |
| then | |
| echo "Successfully delete container $CONTAINERID" | |
| exit 0 | |
| else | |
| echo "Container not found" >&2 |
OlderNewer