Skip to content

Instantly share code, notes, and snippets.

View lvzixun's full-sized avatar
❄️
Nice

子熏 lvzixun

❄️
Nice
View GitHub Profile
@lvzixun
lvzixun / .vimrc
Last active December 28, 2016 08:06 — forked from xebecnan/.vimrc
"HYDRA : OPEN LR UI RES EDITOR {
nmap <C-k> yiw:silent !call-hydra.sh <C-r>"<CR>
"}
local a = setmetatable({}, {__mode = "kv"})
local c = nil
local b = setmetatable({}, {
__gc = function (self)
print("self:", self)
print("weak value:", a.test_value)
c = self
end
})
@lvzixun
lvzixun / json.lua
Last active November 27, 2023 04:41
-- -*- coding: utf-8 -*-
--
-- Copyright 2010-2012 Jeffrey Friedl
-- http://regex.info/blog/
--
local VERSION = 20111207.5 -- version history at end of file
local OBJDEF = { VERSION = VERSION }
--
-- Simple JSON encoding and decoding in pure Lua.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace TestProtoBufNet
{
class BenchMark
#include <sys/mman.h>
#include <stdio.h>
#include <stdint.h>
#include <assert.h>
#include <string.h>
typedef void(*gen_func)();
typedef void(*call_func)();
#define write_ptr(code, offset, addr) do{*((uintptr_t*)(code + offset)) = (uintptr_t)(addr);}while(0)
@lvzixun
lvzixun / rss
Created September 29, 2014 07:37
<rssversion="2.0">
<channel>
<title> rainbowcoder </title>
<link> http://rainbowcoder.com </link>
<description> a rainbowcoder ;) </description>
<item>
<title> hello world </title>
<link> http://rainbowcoder.com/hello%20world.html </link>
<description> hi </description>
@lvzixun
lvzixun / seek.c
Created November 8, 2012 10:50
seek
#include <stdio.h>
#include <stdlib.h>
typedef unsigned char byte;
#define STEP 8
#define LP 1023
#define NEXT_STEP(t, d) do{path[max_step-step]=(t);_run(_pass_func[path[max_step-step]](number), step-1, (d));}while(0)
#define MASK(v) (((v)-1)>>1)
#define _pass(d, n, t) (map[(d)-1][(n)-1][(t)-1])
static byte path[LP+1] = {0};