Skip to content

Instantly share code, notes, and snippets.

@liutianpeng
liutianpeng / record.js
Last active September 19, 2022 13:34
保存/回放/分析消息
if (!!!backlog){
backlog = console
}
function space(n){
let str = ""
for (let index = 0; index < n; index++) {
str = str+" "
}
return str
@liutianpeng
liutianpeng / dump_parse.js
Created May 25, 2022 10:54
Dump/Parse 浏览器内存
//用obj对象生成JSON
let Dump = function(obj) {
let __A__=[]
let __N__ = 0
console.log(">>>>>>>>>>>")
//把Function转换成Object便于生成JSON
{
let _CONVERT_ = {}
let convFunc = (obj)=>{
@liutianpeng
liutianpeng / GLSL-Noise.md
Created September 18, 2019 06:53 — forked from patriciogonzalezvivo/GLSL-Noise.md
GLSL Noise Algorithms

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
	return mix(rand(fl), rand(fl + 1.0), fc);
}
@liutianpeng
liutianpeng / balance_test.go
Last active September 4, 2020 11:51
消息队列高手课 Mutex,CAS&FAA作业程序
package balance
import (
"runtime"
"sync"
"sync/atomic"
"testing"
)
const MaxCount = 10000
@liutianpeng
liutianpeng / daye2.go
Last active August 26, 2019 03:57
消息队列高手课 - 13节 - 大爷聊天2版
package hutong
import (
"encoding/binary"
"fmt"
"io"
"net"
"sync"
"sync/atomic"
)
@liutianpeng
liutianpeng / hutong.go
Last active August 10, 2023 02:15
消息队列高手课 - 13节 - 大爷聊天初版
package main
import (
"fmt"
jsoniter "github.com/json-iterator/go"
"io"
"net"
"sync"
)