Skip to content

Instantly share code, notes, and snippets.

View bachue's full-sized avatar

Bachue Zhou bachue

View GitHub Profile
@bachue
bachue / actix-web_vs_gin.md
Last active June 14, 2019 03:35
PostgreSQL 设置最大客户端数量为 1000,ulimit -n 为 65536。

Rust by actix-web 1.0

/ping 结果

This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)
const AWS = require('aws-sdk'),
fs = require('fs'),
{
Throttle
} = require('stream-throttle');
const uploadFiles = process.argv.slice(2);
const S3Service = new AWS.S3({
apiVersion: '2006-03-01',
[package]
name = "abc"
version = "0.1.0"
authors = ["root"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
crate-type = ["cdylib"]
#ifndef __ABC____H
#define __ABC____H
/* Generated with cbindgen:0.12.0 */
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
@bachue
bachue / fsnotify-test.go
Last active April 20, 2020 10:09
测试 fsnotify 库
package main
import (
"fmt"
"github.com/fsnotify/fsnotify"
"log"
"os"
"path/filepath"
)
@bachue
bachue / thread_safe_struct.go
Created June 8, 2020 08:52
How to make lock-free go struct thread-safe
package main
import (
"github.com/AlekSi/pointer"
log "github.com/sirupsen/logrus"
"sync"
"sync/atomic"
"unsafe"
)
@bachue
bachue / multi_range_download.go
Last active October 14, 2020 10:12
Qiniu MultiRange Download Example
package main
import (
"bytes"
"errors"
"fmt"
"io"
"mime"
"mime/multipart"
"net/http"