#参考资料
###下载单个文件,默认将输出打印到标准输出中(STDOUT)中
curl http://www.centos.org
<html> | |
<body> | |
<h4>websocket</h4> | |
<h5>Group: <span id="group">darwin</span></h5> | |
<!-- a hardoced group name --> | |
<button onclick="bjoin();">join group</button><br /> | |
<input id="text" type="text" /> | |
<span id="out"></span> | |
<script> | |
var group = document.getElementById("group").textContent; |
FILES=*.rst | |
for f in $FILES | |
do | |
filename="${f%.*}" | |
echo "Converting $f to $filename.md" | |
`pandoc $f -f rst -t markdown -o $filename.md` | |
done |
git config --global https.proxy http://127.0.0.1:1080 | |
git config --global https.proxy https://127.0.0.1:1080 | |
git config --global --unset http.proxy | |
git config --global --unset https.proxy | |
npm config delete proxy |
server { | |
server_name yoursite.com; | |
root /usr/share/html; | |
index index.html; | |
location / { | |
try_files $uri $uri/ /index.html; | |
} | |
} |
registry="https://registry.npmmirror.com" | |
disturl="https://npmmirror.com/dist" | |
nvm_nodejs_org_mirror="https://npmmirror.com/mirrors/node" | |
nodejs_org_mirror="https://npmmirror.com/mirrors/node" | |
sass_binary_site="https://npmmirror.com/mirrors/node-sass" | |
electron_mirror="https://npmmirror.com/mirrors/electron/" | |
SQLITE3_BINARY_SITE="https://npmmirror.com/mirrors/sqlite3" | |
profiler_binary_host_mirror="https://npmmirror.com/mirrors/node-inspector/" | |
node_inspector_cdnurl="https://npmmirror.com/mirrors/node-inspector" | |
selenium_cdnurl="https://npmmirror.com/mirrors/selenium" |
var mongoObjectId = function () { | |
var timestamp = (new Date().getTime() / 1000 | 0).toString(16); | |
return timestamp + 'xxxxxxxxxxxxxxxx'.replace(/[x]/g, function() { | |
return (Math.random() * 16 | 0).toString(16); | |
}).toLowerCase(); | |
}; |
/* | |
# Usage in html template: | |
"xxx | nl2br" | |
<div ng-bind-html=" YourString | nl2br "></div> | |
or: |
#参考资料
###下载单个文件,默认将输出打印到标准输出中(STDOUT)中
curl http://www.centos.org
function encrypt(text,key){ | |
var cipher = crypto.createCipher('aes-256-cbc',key) | |
var crypted = cipher.update(text,'utf8','hex') | |
crypted += cipher.final('hex'); | |
return crypted; | |
} | |
function decrypt(text,key){ | |
var decipher = crypto.createDecipher('aes-256-cbc',key) | |
var dec = decipher.update(text,'hex','utf8') |