Skip to content

Instantly share code, notes, and snippets.

View steventsao's full-sized avatar

Steven Tsao steventsao

View GitHub Profile
@steventsao
steventsao / lm-gc
Last active January 29, 2025 17:21
#!/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';
}
@steventsao
steventsao / kill-port.md
Last active August 18, 2020 21:06
killport
@steventsao
steventsao / backtracking.md
Created June 25, 2018 19:48
Notes on backtracking

Problem

I've had many troubles writing backtracking solutions from scratch. There are several conditions to remember about backtracking.

Wrapper Function

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) {