Skip to content

Instantly share code, notes, and snippets.

Avatar
🪐

Fatih Arslan fatih

🪐
View GitHub Profile
@danp
danp / goimports
Last active Sep 10, 2015
godep-aware goimports and more
View goimports
#!/bin/sh
# for use with emacs/vim/etc as goimports and goflymake
#
# I use it with config like:
#
# (setenv "GOPATH" (expand-file-name "~/Projects/go"))
# (setenv "PATH" "~/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:~/Projects/go/bin:/usr/local/go/bin")
# (setq exec-path (append exec-path (list (expand-file-name "~/Projects/go/bin") "/usr/local/go/bin")))
#
@jonhoo
jonhoo / README.md
Last active Oct 22, 2018
Distributed RWMutex in Go
View README.md
@kachayev
kachayev / concurrency-in-go.md
Last active Apr 18, 2021
Channels Are Not Enough or Why Pipelining Is Not That Easy
View concurrency-in-go.md
@guelfey
guelfey / cover.vim
Created Aug 16, 2013
Vim plugin for Go test coverage profiles
View cover.vim
" cover.vim - Vim plugin for Go test coverage profiles
" install in ftplugin/go
"
" ":Cover coverprofile" will open the current file in a new read-only window,
" highlighting the code regarding to whether it is covered by tests or not.
" You can change the colors by highlighting goTestCovered and goTestNotCovered
" from your vimrc.
if exists("b:did_ftplugin_go_cover")
finish
View rr.py
import os
import sys
import threading
import zmq
def worker(identity, wurl):
ctx = zmq.Context.instance()
s = ctx.socket(zmq.REP)
s.identity = identity
View slide10.go
func worker(die chan bool) {
for {
select {
// ... do stuff cases
case <- die:
return
}
}
}
@michaelglass
michaelglass / Coffeescript ctags
Last active Dec 15, 2015 — forked from Gonzih/Coffeescript ctags
allow for default assignment in constructor
View Coffeescript ctags
--langdef=coffee
--langmap=coffee:.coffee
--regex-coffee=/(^|=[ \t])*class ([A-Za-z]+\.)*([A-Za-z]+)( extends [A-Za-z_.]+)?$/\3/c,class/
--regex-coffee=/^[ \t]*(module\.)?(exports\.)?@?([A-Za-z_.]+):.*[-=]>.*$/\3/m,method/
--regex-coffee=/^[ \t]*(module\.)?(exports\.)?([A-Za-z_.]+)[ \t]+=.*[-=]>.*$/\3/f,function/
--regex-coffee=/^[ \t]*([A-Za-z_.]+)[ \t]+=[^->\n]*$/\1/v,variable/
--regex-coffee=/^[ \t]*@([A-Za-z_.]+)[ \t]+=[^->\n]*$/\1/f,field/
--regex-coffee=/^[ \t]*@([A-Za-z_.]+):[^->\n]*$/\1/f,static field/
--regex-coffee=/^[ \t]*([A-Za-z_.]+):[^->\n]*$/\1/f,field/
@anandkunal
anandkunal / simple_reverse_proxy.go
Created Sep 4, 2012
Simple reverse proxy in Go.
View simple_reverse_proxy.go
package main
import (
"log"
"net/http"
"net/http/httputil"
"net/url"
)
func main() {
@dreamiurg
dreamiurg / fabfile.py
Created Jul 25, 2011
fabfile.py for webfaction and vagrant
View fabfile.py
"""
This fabric file makes setting up and deploying a django application much
easier to webfaction servers or your dedicated server, but it does make a
few assumptions. Namely that you're using Git, Apache and mod_wsgi. Also
you should have SSH installed on both the local machine and any servers you
want to deploy to.
Thanks to:
http://github.com/ryanmark/django-project-templates
@elazarl
elazarl / redcon.go
Created Jun 6, 2011
redirect network stream
View redcon.go
package main
import (
"log"
"io"
"os"
"crypto/tls"
"strings"
"net"
"flag"