This project has moved to https://github.com/jonhoo/drwmutex so it can be imported into Go applications.
This file contains hidden or 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/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"))) | |
# |
... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev
This file contains hidden or 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
" 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 |
This file contains hidden or 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
import os | |
import sys | |
import threading | |
import zmq | |
def worker(identity, wurl): | |
ctx = zmq.Context.instance() | |
s = ctx.socket(zmq.REP) | |
s.identity = identity |
This file contains hidden or 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
func worker(die chan bool) { | |
for { | |
select { | |
// ... do stuff cases | |
case <- die: | |
return | |
} | |
} | |
} |
This file contains hidden or 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 ( | |
"log" | |
"net/http" | |
"net/http/httputil" | |
"net/url" | |
) | |
func main() { |
This file contains hidden or 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
""" | |
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 |
This file contains hidden or 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 ( | |
"log" | |
"io" | |
"os" | |
"crypto/tls" | |
"strings" | |
"net" | |
"flag" |
NewerOlder