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
// first set a env var like SERVER_PORT=8888 | |
var ( | |
Cfg Config | |
) | |
type Config struct { | |
Server Server | |
Clinet Clinet | |
LogLevel string | |
} |
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
#!/bin/bash | |
set -e; | |
# joinBy 将一个数组的内容通过特定字符连接起来 | |
# joinBy join an array element to a string by specific string | |
# 使用方法 joinBy "/" ${array[@]} | |
# usage joinBy "/" ${array[@]} | |
# code from https://stackoverflow.com/questions/1527049/how-can-i-join-elements-of-an-array-in-bash | |
# 代码出处 https://stackoverflow.com/questions/1527049/how-can-i-join-elements-of-an-array-in-bash | |
function joinBy() { |
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依赖是jquery1.10(其他版本未测试) css依赖是bootstrap.css v2 v3都可以 浏览器需要支持数组join方法 | |
// css class default is bootstrap.css (v2 v3 tested) , js function join() support is requied | |
// @author 喻兴 [email protected] | |
// @date 2015-07-20 | |
// @example $('#page').pager(); or $('#page').pager({current:50,pages:600,link:'http://www.baidu.com?a=b'}); | |
(function($) { | |
$.fn.pager = function(options) { | |
var defaults = { | |
page: 1, |