This file contains hidden or 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
/** | |
* Render template string. | |
* | |
* @example | |
* renderTemplate( | |
* 'Hello {{name}}. The \\{{name}} will be replaced.', | |
* { name: 'Joe' } | |
* ) | |
* // Output: | |
* // Hello Joe. The {{name}} will be replaced. |
This file contains hidden or 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
root = true | |
[*] | |
charset = utf-8 | |
end_of_line = lf | |
indent_size = 2 | |
indent_style = space | |
insert_final_newline = true | |
max_line_length = 0 | |
trim_trailing_whitespace = true |
This file contains hidden or 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
package main | |
import ( | |
"crypto/hmac" | |
"crypto/sha256" | |
"encoding/base64" | |
"encoding/hex" | |
"fmt" | |
) |
This file contains hidden or 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
#!/bin/bash | |
readonly CMD="${@:1}" | |
if [ "$CMD" == "" ] | |
then | |
echo "usage: $0 <command>" | |
exit 1 | |
fi |
This file contains hidden or 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
package main | |
import ( | |
"errors" | |
"fmt" | |
"time" | |
"github.com/golang-jwt/jwt/v5" | |
) |
This file contains hidden or 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
package main | |
import ( | |
"bytes" | |
"crypto/aes" | |
"crypto/cipher" | |
"crypto/rand" | |
"encoding/hex" | |
"fmt" | |
"io" |
This file contains hidden or 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
#!/bin/sh | |
readonly SERVER_PORT="8388" | |
readonly SERVER_PASS="your_password" | |
sudo yum install git | |
sudo yum install python-setuptools && easy_install pip | |
sudo pip install git+https://github.com/shadowsocks/shadowsocks.git@master | |
firewall-cmd --permanent --zone=public --add-port=${SERVER_PORT}/tcp |
This file contains hidden or 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
/** | |
* Parse the property path string. | |
* | |
* @param {string} path The property path. | |
* @returns {string[]} Returns the array of path. | |
*/ | |
function parseObjectPath(path) { | |
var i = 0; | |
var l = path.length; | |
var ch; |
This file contains hidden or 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
/** | |
* 格式化价格数字 | |
* | |
* @example | |
* // 123,456.00 | |
* formatPrice(123456); | |
* | |
* @param {number} price 价格数字 | |
* @param {string} [separator] 可选的分隔符号,默认为英文逗号 `,`。 | |
* @returns {string} 返回格式化后的价格字符串。 |
This file contains hidden or 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
/** | |
* 获取指定月份日历视图中的 42 个日期对象。 | |
* | |
* @param {number} year 完整的年份数字,如 `2019` 即代表 2019 年。 | |
* @param {number} month 月份数字,如 `11` 即代表 11 月。 | |
* @param {number} [startWeekDay=0] 可选的参数,默认为 `0`(星期日),表示日历中的第一列为星期几(一般为星期日或者星期一)。其中 `0` 表 | |
* 示星期日,`1` 表示星期一,后面以此类推。 | |
* @returns {Date[]} 返回一个数组,包含 42 个 `Date` 对象。 | |
*/ | |
function getCalendarDateList(year, month, startWeekDay) { |
NewerOlder