killport() { lsof -i tcp:$1 | awk 'NR!=1 {print $2}' | xargs kill }
[ ] Add to bash profile
[ ] killport 8000 to kill all instances on said port
Originally from https://stackoverflow.com/a/5043907/5460541
| #!/bin/bash | |
| # Get the directory where the script is actually stored (not where it's called from) | |
| SCRIPT_DIR="$(cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" && pwd)" | |
| # Source the .env file from the original location | |
| if [ -f "$SCRIPT_DIR/.env" ]; then | |
| export $(cat "$SCRIPT_DIR/.env" | xargs) | |
| fi |
| import Controller from '@ember/controller'; | |
| export default class ApplicationController extends Controller { | |
| appName = 'Ember Twiddle'; | |
| } |
killport() { lsof -i tcp:$1 | awk 'NR!=1 {print $2}' | xargs kill }
[ ] Add to bash profile
[ ] killport 8000 to kill all instances on said port
Originally from https://stackoverflow.com/a/5043907/5460541
I've had many troubles writing backtracking solutions from scratch. There are several conditions to remember about backtracking.
This function wraps the backtrack function call. It defines the starting conditions for backtracking. It passes the reference to the result that the wrapper will return.
let combine = function(n, k) {