Skip to content

Instantly share code, notes, and snippets.

View adin234's full-sized avatar
🏠
Working from home

aldrin bautista adin234

🏠
Working from home
View GitHub Profile
@srph
srph / sapi
Last active March 6, 2016 23:23
Shorthand bash script for PHP SAPI (Built-in Web Server)
#!/bin/bash
# Usage: sapi [port]
# Examples: sapi 5k, 5000
PORT=$1
if [ "$PORT" == "" ]; then
PORT=8080
elif [ "${PORT:$((${#PORT} - 1)), -1}" == "k" ]; then
PORT="${PORT%?}000"
fi