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 Foundation | |
| extension Data { | |
| var prettyPrintedJSONString: NSString? { /// NSString gives us a nice sanitized debugDescription | |
| guard let object = try? JSONSerialization.jsonObject(with: self, options: []), | |
| let data = try? JSONSerialization.data(withJSONObject: object, options: [.prettyPrinted]), | |
| let prettyPrintedString = NSString(data: data, encoding: String.Encoding.utf8.rawValue) else { return nil } | |
| return prettyPrintedString | |
| } |
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
| # source machine | |
| docker exec -t containername bash -c 'pg_dump -U postgres -O dbname' > dbname.sql | |
| # target machine | |
| psql -U postgres -d dbname -f dbname.sql | |
| # if you need use password make this transient change | |
| # open file to edit: | |
| sudo vim /etc/postgresql/POSTGRES_VERSION/main/pg_hba.conf |
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
| # How to uninstall Razer Synapse 2 ( https://www.razerzone.com/synapse-2 ) | |
| # on OS X (10.11-10.13) (El Capitan, Sierra, High Sierra) | |
| # without using Razer's official uninstall tool. | |
| # Tested on OS X 10.11.5 in July 2016. | |
| # Edited with additional steps for later OS X versions, | |
| # contributed by commenters on this gist. | |
| # Step 1: In your terminal: stop and remove launch agents | |
| launchctl remove com.razer.rzupdater |
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
| #!/usr/bin/env bash | |
| # Usage: bash uninstall_vmware.bash | |
| remove() { | |
| entry="$1" | |
| echo -ne "Removing $entry [" | |
| sudo rm -rf "$entry" | |
| if [[ ! -e "$entry" ]]; then | |
| echo -ne "OK" |
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
| rm -rf /Applications/Tuxera\ Disk\ Manager.app | |
| rm -rf /Library/Application\ Support/Tuxera\ NTFS | |
| rm -rf /Library/Filesystems/fusefs_txantfs.fs | |
| rm -rf /Library/Filesystems/tuxera_ntfs.fs |
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 { Directive, ElementRef, HostListener } from '@angular/core'; | |
| @Directive({ | |
| selector: 'ion-searchbar[select-all],ion-input[select-all]' | |
| }) | |
| export class SelectAll { | |
| constructor(private el: ElementRef) { | |
| } |
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
| I found two answers that worked for me, without having to uninstall JDK 10 (or 9). | |
| Both JDK 9 and 10 are incompatible with android-sdk! | |
| DEFAULT_JVM_OPTS='"-Dcom.android.sdklib.toolsdir=$APP_HOME"' | |
| with: | |
| DEFAULT_JVM_OPTS='"-Dcom.android.sdklib.toolsdir=$APP_HOME" -XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee' | |
| Source: | |
| https://stackoverflow.com/questions/46402772/failed-to-install-android-sdk-java-lang-noclassdeffounderror-javax-xml-bind-a |
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 all | |
| import Rx from "rxjs/Rx"; | |
| Rx.Observable | |
| .interval(200) | |
| .take(9) | |
| .map(x => x + "!!!") | |
| .bufferCount(2) | |
| .subscribe(::console.log); |
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
| # see the current limits | |
| $ sysctl -a | grep maxproc | |
| # increase it | |
| $ sudo sysctl -w kern.maxproc=xxxx | |
| $ sudo sysctl -w kern.maxprocperuid=xxx | |
| # run at startup | |
| $ sudo vim /etc/sysctl.conf |
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
| # Backup | |
| docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
| # Restore | |
| cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
NewerOlder