Skip to content

Instantly share code, notes, and snippets.

View leetking's full-sized avatar
🍀
On vacation

αlpha 0x00 leetking

🍀
On vacation
View GitHub Profile
@leetking
leetking / lua-module-by-C.md
Last active December 29, 2018 10:13
用C编写lua模块

用C写lua模块

lua与c交互都是用过lua_State*类型的变量,并且是基于的。

Hello-Lua

文件: hello.c

#include <lua.h>
#include <lxlib.h>
@leetking
leetking / hello-spring.md
Created March 5, 2017 05:17
Spring学习

学习Spring

@leetking
leetking / Makefile
Last active November 16, 2019 06:09
the template file for C/C++
APP := <App Name>
VER := <Version>
# 不立即展开 $(APP) 和 $(VER)
PKG = $(APP)-$(VER)
DEBUG := True
CC := gcc
RM := rm -rf
CP := cp -r
@leetking
leetking / comment.c
Last active August 4, 2017 02:36
C小技巧
/*
* 注释嵌套测试
*/
#include <stdio.h>
int main(int argc, char **argv)
{
int i;
i = /*/*/0*/**/1;
@leetking
leetking / pass-all.js
Created January 21, 2018 09:10
微课学习一键通过(http://wb.mycourse.cn
(function() {
var userid = getQueryString("userid");
var course = [["48507", "http://wkzy.mycourse.cn/course/A09023/index.html"],
["48506", "http://wkzy.mycourse.cn/course/A09022/index.html"],
["48503", "http://wkzy.mycourse.cn/course/A09019/index.html"],
["48505", "http://wkzy.mycourse.cn/course/A09021/index.html"],
["48504", "http://wkzy.mycourse.cn/course/A09020/index.html"],
["48502", "http://wkzy.mycourse.cn/course/A09018/index.html"],
["48501", "http://wkzy.mycourse.cn/course/A09017/index.html"],
["48500", "http://wkzy.mycourse.cn/course/A09016/index.html"],
@leetking
leetking / README.rst
Created March 8, 2018 13:51 — forked from dupuy/README.rst
Common markup for Markdown and reStructuredText

Markdown and reStructuredText

GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as things like automatic generation of tables of contents.

http://download.huzheng.org/dict.org/stardict-dictd_www.dict.org_gcide-2.4.2.tar.bz2
http://download.huzheng.org/dict.org/stardict-dictd_www.dict.org_wn-2.4.2.tar.bz2
http://download.huzheng.org/dict.org/stardict-dictd-moby-thesaurus-2.4.2.tar.bz2
http://download.huzheng.org/dict.org/stardict-dictd-web1913-2.4.2.tar.bz2
http://download.huzheng.org/dict.org/stardict-dictd_www.dict.org_elements-2.4.2.tar.bz2
http://download.huzheng.org/dict.org/stardict-dictd-vera-2.4.2.tar.bz2
http://download.huzheng.org/dict.org/stardict-dictd-jargon-2.4.2.tar.bz2
http://download.huzheng.org/dict.org/stardict-dictd_www.dict.org_foldoc-2.4.2.tar.bz2
http://download.huzheng.org/dict.org/stardict-dictd-easton-2.4.2.tar.bz2
http://download.huzheng.org/dict.org/stardict-dictd_www.dict.org_hitchcock-2.4.2.tar.bz2
@leetking
leetking / syntax.lua
Created February 12, 2019 09:40
try implement the macro in Lua
-- try to implement a naive macro in Lua
-- TODO complete it
function syntax(name)
assert(type(name) == "string")
local name, args = name:match("([%w_]+)%(?([%w_,]+)%)?")
return function(body)
assert(type(body) == "string")
end
end
:: 使用 ssh 连接到虚拟机内的 ArchLinux 系统
@echo off
: archlinux 是 .ssh/config 里为虚拟机设置的别名
set vm=ArchLinux
if "%1" == "stop" (
echo Save state of %vm% ...
VBoxManage controlvm %vm% savestate
@leetking
leetking / cdmetro.py
Created August 3, 2019 13:49
a little python script to scrape chengdu metro infomation
#!/usr/bin/env python
import hashlib
import sqlite3
import os
from functools import reduce
import requests
class DbCache: