This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install dependencies | |
sudo apt install \ | |
build-essential gettext autoconf automake libproxy-dev \ | |
libxml2-dev libtool vpnc-scripts pkg-config zlib1g-dev \ | |
libp11-kit-dev libp11-dev libssl-dev | |
# Build | |
cd openconnect | |
./autogen.sh | |
./configure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Reference: http://www.ecma-international.org/ecma-262/10.0/index.html#prod-NumericLiteral | |
(function () { | |
const regexp = /^[+-]?(?:0b[01]+|0o[0-7]+|0x[0-9a-f]+|(?:(?:(?:0|[1-9]\d*)\.\d*|\.\d+|(?:0|[1-9]\d*))(?:e[+-]?\d+)?))$/i; | |
// RegExp below also supports number spearator: https://github.com/tc39/proposal-numeric-separator | |
// const regexp = /^[+-]?(?:0b[01](_?[01])*|0o[0-7](_?[0-7])*|0x[0-9a-f](_?[0-9a-f])*|(?:(?:(?:0|[1-9](_?\d(_?\d)*)?)\.(\d(_?\d)*)?|\.\d(_?\d)*|(?:0|[1-9](_?\d(_?\d)*)?))(?:e[+-]?\d(_?\d)*)?))$/i; | |
const testCases = [ | |
'0.', '0.E1', '0.e-1','0.e0', '0.1', '0.12', '0.12e2', '0.12e-2','0.12E0','0.0e1', '0.0e-1', '0.0E0', | |
'1.', '1.E1', '1.e-1','1.e0', '1.1', '1.12', '1.12e2', '1.12e-2','1.12E0','1.0e1', '1.0e-1', '1.0E0', | |
'1_0.', '1_0_0.', '1_0.0_1_2', '1_0_0', '100_000', '1e1_2', '1e+12_0', '.1_2_3', '.000_111', '10_1.1_2_3', '0.000_111', '0e0', '1_2e10', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var through = require('through2'); | |
var postcss = require('postcss'); | |
function postcssTransform(filename, options) { | |
if (!/\.css$/.test(filename)) { | |
return through(); | |
} | |
if (typeof options === 'undefined' || options === null) { | |
options = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://help.ubuntu.com/12.04/serverguide/httpd.html#http-directory-permissions | |
sudo chgrp -R webmasters /var/www | |
sudo find /var/www -type d -exec chmod g=rwxs "{}" \; | |
sudo find /var/www -type f -exec chmod g=rws "{}" \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var reg = /[\u4e00-\u9fa5]/; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<meta name="format-detection" content="telephone=no"> | |
<meta name="format-detection" content="date=no"> | |
<meta name="format-detection" content="address=no"> | |
<meta name="format-detection" content="email=no"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* use the postcss-mixins plugin | |
* | |
* Usage: | |
* .item { | |
* position: relative; | |
* } | |
* .item:before { | |
* content: ''; | |
* @mixin 1px top, #ddd; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 参考维基百科 - 中国内地移动终端通讯号码 http://t.cn/Ryr1Emc | |
var reg = /^(13[0-9]|15[0-35-9]|18[0-9]|17[06-8]|14[57])\d{8}$/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 依赖 JS 的 MD5 库 https://blueimp.github.io/JavaScript-MD5/js/md5.js | |
// 按照 CC 文档中描述的 THQS 加密算法对提交的数据进行加密处理 | |
// 具体的加密算法在 http://t.cn/Ry3Hs7W 的附录部分 | |
function encrypt(data) { | |
// 1. 将键值对按照 key 的升序排序 | |
var qs = data.sort(function (a, b) { | |
return a.name > b.name; | |
}).map(function (item) { | |
return item.name + '=' + encodeURIComponent(item.value); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// reference: http://llllll.li/randomColor/ | |
function randomColor() { | |
return '#' + Math.floor(Math.random()*16777215).toString(16); | |
} |
NewerOlder