Skip to content

Instantly share code, notes, and snippets.

View findstr's full-sized avatar
🎯
Focusing

重归混沌 findstr

🎯
Focusing
View GitHub Profile
@findstr
findstr / a.lua
Last active July 21, 2018 04:28
GC RACE
local LINK = require "link"
local buffer = setmetatable({
link = nil
}, {__gc = function(tbl)
LINK.free(tbl.link)
end})
buffer.link = LINK.new()
LINK.push(buffer.link)
LINK.push(buffer.link)
buffer = nil
@findstr
findstr / Decal.cs
Created June 17, 2018 01:40
Decal(Mesh Projector)
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEditor;
class MeshBuilder {
private readonly List<Vector3> vertices = new List<Vector3>();
private readonly List<Vector3> normals = new List<Vector3>();
@findstr
findstr / linklist.c
Created August 25, 2017 06:24
linklist
@findstr
findstr / Template.shader
Created June 13, 2017 13:27
unity shader include specular and diffuse light
Shader "Template" {
Properties {
_Color("Color", Color) = (1, 1, 1, 1)
_Specular("Specular Color", Color) = (1, 1, 1, 1)
_Gloss("Gloss", Range(8.0, 256.0)) = 20
}
SubShader {
Tags { "RenderType"="Opaque" "Queue"="Geometry"}
Pass {
Tags { "LightMode"="ForwardBase" }
@findstr
findstr / proxyc
Last active September 6, 2017 14:27
revert-proxy
daemon = 0
bootstrap = "test/testhttp.lua"
lualib_path = "test/?.lua;lualib/?.lua"
lualib_cpath = "test/?.so;luaclib/?.so"
ctrl="192.168.2.1@8002"
tunnel="192.168.2.1@8003"
@findstr
findstr / check.lua
Created August 12, 2016 08:29
memleak check
local f = io.open("a.txt", "r")
local malloc = {}
for line in f:lines() do
local typ, ptr, src = string.match(line, "([^:]+):([^:]+):(.*)")
if typ == "malloc" then
malloc[ptr] = src
end
if typ == "free" then
malloc[ptr] = nil