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
#define _CRT_SECURE_NO_WARNINGS | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <limits.h> | |
#define SHIFT (sizeof(unsigned)*CHAR_BIT) | |
#define RANGE_MAX (~0u) | |
#define CHAR_MASK ((1u<<CHAR_BIT)-1) |
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
[submodule "holiday-cn"] | |
path = holiday-cn | |
url = https://github.com/NateScarlet/holiday-cn |
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
#define LUA_LIB | |
#include <lua.h> | |
#include <lauxlib.h> | |
#include "fastlz.h" | |
#include "fastlz.c" | |
#include <stdlib.h> | |
static int Lcompress(lua_State *L) { |
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
Froum: http://www.colm.net/pipermail/ragel-users/2017-April/003473.html | |
I don't use Windows machines much also nowadays but I have a simple | |
solution that one without a Windows can also build ragel windows binary: | |
1. Login into https://gist.github.com/ (is GitHub pastebin service which | |
also provides Git repos at the same time) and type something and create an | |
empty gist. | |
2. Login into https://ci.appveyor.com (is a Windows CI service) with your |
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
#define _CRT_SECURE_NO_WARNINGS | |
#include <assert.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <limits.h> | |
#include <errno.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
#define LUA_LIB | |
#include <lua.h> | |
#include <lauxlib.h> | |
#include <lualib.h> | |
#include <assert.h> | |
#include <string.h> | |
#define LL_STATE_TYPE "lua.State" |
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
#include <assert.h> | |
#include <stdlib.h> | |
#include <limits.h> | |
typedef struct rb_Node rb_Node; | |
struct rb_Node { | |
rb_Node *parent, *k[2]; | |
unsigned size : sizeof(unsigned)*CHAR_BIT-1; | |
unsigned color : 1; |
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
# vim: nu et fdc=2 fdm=marker fmr={,} | |
# General { | |
# set prefix | |
set -g prefix "`" | |
unbind C-b | |
bind C-a last-window | |
bind "`" last-window |
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
local function meta(name, parent) | |
t = {} | |
t.__name = name | |
t.__index = t | |
return setmetatable(t, parent) | |
end | |
local function approx(a, b) | |
if a > b then return a - b < 1e-6 end |
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
#ifdef _MSC_VER | |
# define _CRT_SECURE_NO_WARNINGS | |
#endif /* _MSC_VER */ | |
#define LUA_LIB | |
#include <lua.h> | |
#include <lauxlib.h> | |
#if LUA_VERSION_NUM < 503 | |
static int lua53_rawgeti(lua_State *L, int idx, lua_Integer n) | |
{ lua_rawgeti(L,idx,n); return lua_type(L,-1); } |