Skip to content

Instantly share code, notes, and snippets.

@reusee
reusee / pingpong.go
Last active September 17, 2016 17:45
ping pong benchmark
package main
import (
"bytes"
"encoding/json"
"fmt"
"net"
"sync"
"sync/atomic"
"time"
package main
import (
"fmt"
"github.com/fsnotify/fsnotify"
"os"
"path/filepath"
"sync"
)
@reusee
reusee / foo.js
Created September 25, 2016 19:38
js
let infos = [
{
"MENU_ID": 1,
"MENU_NAME": "系统管理",
"MENU_URL": "#",
"PARENT_ID": 0,//顶级菜单
"MENU_ORDER": 1//菜单的顺序
},
{
"MENU_ID": 2,
import itertools
def l():
while True:
for e in ['a', 'b', 'c', 'd']:
yield e
print(list(itertools.islice(l(), 7)))
@reusee
reusee / a.py
Created October 22, 2016 15:11
import itertools
def l():
while True:
for e in ['a', 'b', 'c', 'd']:
yield e
print(list(itertools.islice(l(), 7)))
@reusee
reusee / priority.go
Created October 15, 2017 10:24
priority
package main
import (
"fmt"
"sync"
"time"
)
func main() {
pt := fmt.Printf
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="report.js"></script>
<script src="system-production.js"></script>
<script src="aff.js"></script>
</head>
@reusee
reusee / malformed.go
Last active November 15, 2018 02:39
malformed.go
package main
import (
"encoding/json"
"fmt"
"strings"
)
func main() {
j := `
@reusee
reusee / a.go
Created January 11, 2019 09:03
a.go
var data struct {
Status int
Content string
Data struct {
Seats map[int]struct{
NickName string
Avatar string
UID int
}
}
package main
import (
"fmt"
)
func main() {
run := func(str string, wait chan struct{}, sig chan struct{}) {
for i := 0; i < 10; i++ {
<-wait