Skip to content

Instantly share code, notes, and snippets.

@vmihailenco
vmihailenco / proxy.go
Created November 20, 2011 15:22
Simple TCP proxy in Golang
package main
import (
"bytes"
"encoding/hex"
"flag"
"fmt"
"io"
"log"
"net"
@vmihailenco
vmihailenco / celery.py
Created January 10, 2012 18:54
Disable celery logging magic
CELERYD_HIJACK_ROOT_LOGGER = False
def setup_task_logger(logger=None, **kwargs):
logger.propagate = 1
from celery import signals
signals.setup_logging.connect(lambda **kwargs: True)
signals.after_setup_task_logger.connect(setup_task_logger)
package main
import (
"bytes"
"io/ioutil"
"testing"
"github.com/klauspost/compress/zstd"
"github.com/valyala/gozstd"
)
package main
import (
"bytes"
"io/ioutil"
"testing"
"github.com/klauspost/compress/zstd"
"github.com/valyala/gozstd"
)
frontend fe_http
bind *:80
capture request header Connection len 32
capture response header Connection len 32
default_backend be_go
package main
import (
"log"
"net/http"
)
func main() {
http.HandleFunc("/upload", func(w http.ResponseWriter, req *http.Request) {
})
package main
import (
"fmt"
// "log"
// "time"
"github.com/go-pg/pg"
"github.com/go-pg/pg/orm"
)
package main
import (
"fmt"
"github.com/go-pg/pg"
"github.com/go-pg/pg/orm"
"github.com/go-pg/sharding"
)
package main
import (
"log"
"strconv"
"time"
redis "gopkg.in/redis.v4"
)
package main
import (
"log"
"math/rand"
"strings"
"gopkg.in/pg.v4"
)