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
| protocol Pop { | |
| func moveBackToParentViewController(currentViewController: UIViewController) | |
| } | |
| extension Pop { | |
| func moveBackToParentViewController(currentViewController: UIViewController) { | |
| let transition = CATransition() | |
| transition.duration = 0.5 | |
| transition.type = kCATransitionMoveIn |
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
| /** | |
| * Modify the parts you need to get it working. | |
| */ | |
| var should = require('should'); | |
| var request = require('../node_modules/request'); | |
| var io = require('socket.io-client'); | |
| var serverUrl = 'http://localhost'; |
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
| /** | |
| * Sort array of objects based on another array | |
| */ | |
| function mapOrder (array, order, key) { | |
| array.sort( function (a, b) { | |
| var A = a[key], B = b[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
| ### DigitalOcean Ubuntu 18.04 x64 + Rails 5 + Nginx + Unicorn + PostgreSQL9.6 + Capistrano 3 | |
| SSH into Root | |
| $ ssh root@123.123.123.123 | |
| Change Root Password | |
| $ passwd |
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
| # linux | |
| UNISON_VERSION=2.48.4 | |
| sudo apt-get -y install inotify-tools ocaml-nox build-essential | |
| curl -L https://github.com/bcpierce00/unison/archive/${UNISON_VERSION}.tar.gz | tar zxv -C /tmp | |
| cd /tmp/unison-${UNISON_VERSION} | |
| sed -i -e 's/GLIBC_SUPPORT_INOTIFY 0/GLIBC_SUPPORT_INOTIFY 1/' src/fsmonitor/linux/inotify_stubs.c | |
| make UISTYLE=text NATIVE=true STATIC=true | |
| cp src/unison src/unison-fsmonitor ~/bin | |
| # You should modify your path to include ~/bin |
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
| sudo yum update | |
| # Installing ZSH | |
| sudo yum -y install zsh | |
| # Check ZSH has been installed | |
| zsh --version | |
| # Install "util-linux-user" because "chsh" is not available by default | |
| # See https://superuser.com/a/1389273/599050 |
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 pino from "pino"; | |
| import { env } from "@/config"; | |
| import path from "path"; | |
| // Get the number of parent folders to show from environment or default to showing all | |
| const LOG_PATH_DEPTH = env.LOG_PATH_DEPTH ? parseInt(env.LOG_PATH_DEPTH) : 1; // 0 means show all | |
| // Get the caller file name | |
| const getCallerFile = () => { | |
| const err = new Error(); |
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
| 36.68.153.46:8080 | |
| 159.65.158.77:45279 | |
| 110.77.232.108:4145 | |
| 220.243.154.49:11267 | |
| 84.242.183.146:4153 | |
| 188.114.97.170:80 | |
| 43.135.177.135:13001 | |
| 103.178.94.107:80 | |
| 116.254.99.120:8080 | |
| 47.252.20.42:1081 |
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
| # Process management | |
| k() { | |
| if [ -z "$1" ]; then | |
| echo "Usage: k <port> # Kill single port" | |
| echo " k <port1,port2> # Kill multiple ports" | |
| echo " k <start-end> # Kill port range" | |
| echo "Examples:" | |
| echo " k 3000 # Kill port 3000" | |
| echo " k 3000,3001 # Kill ports 3000 and 3001" | |
| echo " k 3000-3005 # Kill ports 3000 through 3005" |