Skip to content

Instantly share code, notes, and snippets.


Damon Zhao se77en

View GitHub Profile
View livecaption.go
// Copyright 2016 Google Inc. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
// Command caption reads an audio file and outputs the transcript for it.
package main
import (
View zhHans.conf.ini
# 你可以从该 URL 下载这个配置文件:
# 用编辑器编辑后,再通过 iTunes, URL, AirDrop 或者 iCloud Drive 复制回 iOS 设备
# Version 2.0
# 日志等级: warning, notify, info, verbose (默认值: notify)
loglevel = notify
# 跳过某个域名或者 IP 段,这些目标主机将不会由 Surge Proxy 处理。(在 macOS
# 版本中,如果启用了 Set as System Proxy, 那么这些值会被写入到系统网络代理
# 设置中.)
Mudpuppy12 / gist:db9f2a2b4ab62babd72a1edddd4b5273
Last active May 4, 2017
Example Iris Session / Basic Auth
View gist:db9f2a2b4ab62babd72a1edddd4b5273
// main.go
package main
import (
turtlemonvh / Gin.WrapHH.go
Last active Jun 27, 2019
A pattern for wrapping functions that accept an http handler in gin
View Gin.WrapHH.go
// 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:
type WrappedResponseWriter struct {
writer http.ResponseWriter
func (w *WrappedResponseWriter) Write(data []byte) (int, error) {
return w.writer.Write(data)
mrkaspa / ifx.exs
Last active Jan 8, 2016
If else built in elixir using macros
View ifx.exs
defmodule My do
defmacro ifx(conds, [do: code1, else: code2]) do
quote do
case unquote conds do
true -> unquote code1
_ -> unquote code2
aggrolite /
Last active Aug 13, 2019
Writing a reddit bot with Go and OAuth2
ebuildy / docker-compose-sentry.yml
Created Nov 24, 2015
A simple docker-compose YML to run Sentry.
View docker-compose-sentry.yml
image: redis
image: postgres:9.4
- /var/data/sentry/postgre:/var/lib/postgresql/data:rw
svett / context.go
Created Nov 20, 2015
An example that illustrates how to work with
View context.go
package main
import (
wintercn / yc.js
Last active Apr 3, 2019
ycombinator in es2015
View yc.js
//yc here
var y = g =>
self =>
g( (...args)=>self(self)(...args) )
//use yc
var f = y(self =>
n => n < 0 ? 0 : n + self(n-1))
ericlagergren / index.gohtml
Last active Nov 16, 2020
Hot-reloading / hot-swapping live template files in Go
View index.gohtml
My name is {{.Name}} and I'm {{.Age}} years old!!
You can’t perform that action at this time.