Implementation varies between platforms, see below.
cecho "Hello world" yellow
This script assumes your terminal has a black background, to use with white terminals replace ;40m
with ;47m
for each color. (There are more colors, try them out!)
<?php | |
// @see http://stackoverflow.com/a/13331948/1640765 | |
function slugify($str) { | |
$str = transliterator_transliterate("Any-Latin; NFD; [:Nonspacing Mark:] Remove; NFC; [:Punctuation:] Remove; Lower();", $str); | |
$str = preg_replace('/\s+/', '-', $str); | |
return trim($str, '-'); | |
} |
const ordinal = (n) => { | |
const s = ['th', 'st', 'nd', 'rd']; | |
const m = n % 100; | |
return n + (s[(m - 20) % 10] || s[m] || s[0]); | |
}; |
package debug | |
import ( | |
"fmt" | |
"runtime" | |
"strings" | |
) | |
func Debug(data interface{}) { | |
_, file, line, ok := runtime.Caller(1) |