分类: 未分类

64 篇文章

Hugo common pitfalls and cheat sheet
Why language specific params defined in "[lanuage]" missing some information defined outside "[lanuage]" [params] [params.home] var1 ="1" var2 ="2" [langua…
Web programming pitfalls
How to send jquery datatables data via Ajax A: Use: dataTable_instanc().rows().data().toArray() How to send json data via Ajax A: It need use JSON.stringtify(Array) to make th…
Hugo list all the pages under sub directories
(1) Background Normally, we feel intuitive to put files under different nested sub directory, each directory could represents as file's category it belongs to or with specific…
Pass additional argument to httprouter handle func
As we known, standard httprouter func has 3 parameters like below: func ViewIndex(w http.ResponseWriter, r *http.Request, ps httprouter.Params){} Sometimes, we need pass addit…
Docker Cheatsheet
Delete all images $ for i in `docker images | awk 'NR>1{print $1":"$2}'`;do docker rmi $i;done Aliyun docker accelerator(/etc/docker/daemon.json) {"registry-mirrors": ["ht…
kubernetes cheatsheet
Obtain node join token$ kubeadm token list | awk 'NR==2{print $1}' Get master hostname$ kubectl get nodes -l node-role.kubernetes.io/master -o jsonpath="{.items[*].metadata.na…
Autoreload uWSGI when any changes made in Django project
There is a monitor.py can be used in Apache + mod_wsgi deployment, which can be used to auto reload wsgi processes when there is any change under Django project directory. I s…
Hugo where “contains” operator implementation
(1) Background To fix following issue: Add "contains" operator in where function to support list pages in nested subdir I implemented a new contains operator in Hugo…