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 ( | |
"fmt" | |
"testing" | |
"time" | |
) | |
// WHY: | |
// |
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 ( | |
"fmt" | |
"github.com/google/go-cmp/cmp" | |
) | |
func isSpace(b byte) bool { | |
switch b { |
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 log | |
import ( | |
"bytes" | |
"path" | |
"time" | |
"github.com/gin-gonic/gin" | |
"github.com/lestrrat/go-file-rotatelogs" | |
"github.com/pkg/errors" |
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
#ifndef __AE_H__ | |
#define __AE_H__ | |
#include <time.h> | |
#define AE_OK 0 | |
#define AE_ERR -1 | |
#define AE_NONE 0 /* No events registered. */ | |
#define AE_READABLE 1 /* Fire when descriptor is readable. */ |
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
""" | |
redis proxy | |
用来展示redis协议 | |
""" | |
import asyncio | |
redis_addr = ('127.0.0.1', 6379) | |
proxy_addr = ('127.0.0.1', 6380) | |
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
//http://www.it165.net/os/html/201308/5868.html | |
#include <sys/socket.h> | |
#include <sys/wait.h> | |
#include <netinet/in.h> | |
#include <netinet/tcp.h> | |
#include <sys/epoll.h> | |
#include <sys/sendfile.h> | |
#include <sys/stat.h> | |
#include <unistd.h> | |
#include <stdio.h> |
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 | |
# 版本号类似于 MAJOR.MINOR.PATCH 遵循 Semantic Versioning 2.0.0: | |
# MAJOR: 主版本号,不兼容的修改,如:底层重构、框架层变动 | |
# MINOR:次版本号,向前兼容的修改,如:增加新功能、代码优化 | |
# PATCH: 小版本号,修复bug | |
PREFIX=v | |
DEFAULT_VERSION=0.0.0 | |
# 获取git版本号 |
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
0xA62D03dA4F56043663859c9173E8E6ad9A24C40a |
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 ( | |
"bytes" | |
"fmt" | |
"strconv" | |
) | |
const STEP, NUM = 4, 40 |
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 redis | |
import ( | |
r "github.com/garyburd/redigo/redis" | |
) | |
type Pool struct { | |
r.Pool | |
} |
NewerOlder