Skip to content

Instantly share code, notes, and snippets.

View gwind's full-sized avatar
🎯
Focusing

好风 gwind

🎯
Focusing
View GitHub Profile
@gwind
gwind / go-netlink-socket-monitor.go
Created December 2, 2016 02:30
[go-netlink-socket-monitor] like ss -t. inetdiag.go is copy from https://github.com/eleme/netlink/blob/master/inetdiag.go , but fix some issues.
#!/usr/bin/env python
# coding: utf-8
import os
import time
import random
from hashlib import sha1
char_alphabet = "abcdefghijklmnopqrstuvwxyz"
char_digit = "0123456789"
@gwind
gwind / goroutine_update_data.go
Created March 8, 2016 14:39
演示两个 goroutine 修改同一块数据结构
// 演示两个 goroutine 修改同一块数据结构
// TODO: 加上锁
package main
import "fmt"
func updateData(a *[]int, quit chan int) {
for i := 20; i < 30; i++ {
*a = append(*a, i)
@gwind
gwind / web_benchmark.go
Last active February 25, 2016 08:47
golang web benchmark (by: HaoLiang Zhang)
package main
import (
"flag"
"fmt"
"io/ioutil"
"math/rand"
"net"
"net/http"
"time"
@gwind
gwind / index_just_relay.js
Created January 25, 2016 06:47
Example: react relay confused
let React = require('react');
let ReactDOM = require('react-dom');
let Relay = require('react-relay');
class Item extends React.Component {
render() {
let { group } = this.props.store
return <p><b>{group.id}</b>: {group.name}</p>
}
};