Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
#Emacs ansi-term directory tracking | |
# track directory, username, and cwd for remote logons | |
if [ "$TERM" = "eterm-color" ]; then | |
function eterm-set-cwd { | |
$@ | |
echo -e "\033AnSiTc" $(pwd) | |
} | |
# set hostname, user, and cwd | |
function eterm-reset { |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
#!/bin/sh | |
parse_yaml() { | |
local prefix=$2 | |
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034') | |
sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \ | |
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 | | |
awk -F$fs '{ | |
indent = length($1)/2; | |
vname[indent] = $2; | |
for (i in vname) {if (i > indent) {delete vname[i]}} |
array=(foo, bar, baz) | |
echo ${array[@]} # => foo, bar, baz | |
array=("${array[@]:1}") | |
echo ${array[@]} # => bar, baz | |
array=("${array[@]:1}") | |
echo ${array[@]} # => baz |
purgecss is a tool for removing unused css classes from source files. It's particularly useful for functional css frameworks like tachyons, where it's normal to only use a tiny fraction of available classes. This gist contains example code you could use to add purgecss to a shadow-cljs build.
yarn add purgecss
first(hooks/purge-css {:css-source __ :js-globs __ :out-dir __})
:css-source
is the path to the original, bloated CSS file (from project root). This is ideally in a source directory, or node_modules
as in this example. This cannot be the public path where the css is ultimately read.:js-globs
is a string / vector of strings, indicating which files to read as input. These should be all of your compiled javascript bundles which contain your views. purgecss
does a brute-force parse of all these files, extracting all the strings to figure out which clas