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
# 你可以从该 URL 下载这个配置文件: http://surge.run/config-example/ios.conf | |
# 用编辑器编辑后,再通过 iTunes, URL, AirDrop 或者 iCloud Drive 复制回 iOS 设备 | |
# Version 2.0 | |
[General] | |
# 日志等级: warning, notify, info, verbose (默认值: notify) | |
loglevel = notify | |
# 跳过某个域名或者 IP 段,这些目标主机将不会由 Surge Proxy 处理。(在 macOS | |
# 版本中,如果启用了 Set as System Proxy, 那么这些值会被写入到系统网络代理 | |
# 设置中.) |
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
// main.go | |
package main | |
import ( | |
"time" | |
"github.com/kataras/iris" | |
"github.com/kataras/iris/config" | |
"github.com/kataras/iris/middleware/basicauth" | |
"github.com/kataras/iris/middleware/logger" |
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
// A wrapper that turns a http.ResponseWriter into a gin.ResponseWriter, given an existing gin.ResponseWriter | |
// Needed if the middleware you are using modifies the writer it passes downstream | |
// FIXME: Wrap more methods: https://golang.org/pkg/net/http/#ResponseWriter | |
type WrappedResponseWriter struct { | |
gin.ResponseWriter | |
writer http.ResponseWriter | |
} | |
func (w *WrappedResponseWriter) Write(data []byte) (int, error) { | |
return w.writer.Write(data) |
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
defmodule My do | |
defmacro ifx(conds, [do: code1, else: code2]) do | |
quote do | |
case unquote conds do | |
true -> unquote code1 | |
_ -> unquote code2 | |
end | |
end | |
end | |
end |
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
redis: | |
image: redis | |
postgres: | |
image: postgres:9.4 | |
environment: | |
- POSTGRES_USER:sentry | |
- POSTGRES_PASSWORD:sentry | |
volumes: | |
- /var/data/sentry/postgre:/var/lib/postgresql/data:rw |
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
package main | |
import ( | |
"bufio" | |
"fmt" | |
"os" | |
"strings" | |
"time" | |
"golang.org/x/net/context" |
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
//yc here | |
var y = g => | |
(f=>f(f))( | |
self => | |
g( (...args)=>self(self)(...args) ) | |
) | |
//use yc | |
var f = y(self => | |
n => n < 0 ? 0 : n + self(n-1)) |
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
My name is {{.Name}} and I'm {{.Age}} years old!! |
NewerOlder