Skip to content

Instantly share code, notes, and snippets.

View notedit's full-sized avatar
🎯
Focusing

leeoxiang notedit

🎯
Focusing
View GitHub Profile
@notedit
notedit / gist:2016729
Created March 11, 2012 15:00
go pg.go
package main
import (
"log"
"database/sql"
_ "github.com/bmizerany/pq.go"
)
func main() {
@notedit
notedit / gist:1808851
Created February 12, 2012 14:34
test_client
package main
import (
"fmt"
"gogobservice"
"net/rpc"
"log"
)
@notedit
notedit / gist:1808849
Created February 12, 2012 14:33
test_server
package main
import (
"gogobservice"
"net/rpc"
"net"
"log"
)
func main() {
@notedit
notedit / gist:1807433
Created February 12, 2012 09:11
testServer.go
package main
import (
"fmt"
"recca/rpc"
)
type Args struct {
A,B int
}
@notedit
notedit / reccarpcserver.go
Created February 12, 2012 09:08
server.go
// Date: 2012-02-08
// Author: notedit <notedit@gmail.com>
// make a go rpc service
package rpc
import (
"fmt"
"log"
"net"
@notedit
notedit / gevent-multiprocess.py
Created August 25, 2011 03:45
gevent-multiprocess
import sys
from gevent import server
from gevent.monkey import patch_all; patch_all()
from multiprocessing import Process, current_process, cpu_count
def note(format, *args):
sys.stderr.write('[%s]\t%s\n' % (current_process().name, format%args))
def echo(socket, address):