Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<script>
function is_ascii(str) {
return /^[\x00-\x7F]*$/.test(str);
}
function is_seperator(c) {
return [" ", ",", "。", ",", ";", ",", "?", ".", "?", ";", "《", "》"].indexOf(c) > -1;
}
<!DOCTYPE html>
<html>
<script>
function is_ascii(str) {
return /^[\x00-\x7F]*$/.test(str);
}
function is_seperator(c) {
return [" ", ",", "。", ",", ";", ",", "?", ".", "?", ";", "《", "》"].indexOf(c) > -1;
}
@zonesan
zonesan / hosts
Last active August 7, 2018 02:59
[OSEv3:children]
masters
nodes
etcd
[OSEv3:vars]
ansible_ssh_user=san
ansible_become=yes
containerized=true
@zonesan
zonesan / gist:5393723e597d2ed3c194cbdc8c8cda23
Created October 8, 2016 06:20 — forked from geirha/gist:887e74e74877c7613920
Bash urlencode and urldecode
urlencode() {
# urlencode <string>
local LC_ALL=C c i n
for (( i = 0, n = ${#1}; i < n; i++ )); do
c=${1:i:1}
case $c in
[[:alnum:].~_-]) printf %s "$c" ;;
*) printf %%%02X "'$c" ;;
esac
done