Skip to content

Instantly share code, notes, and snippets.

View racklin's full-sized avatar

Rack Lin (阿土伯) racklin

View GitHub Profile
#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
function abort {
echo "$1"
exit 1
}
set -e
BOX_NAME=vagrant-build
BASE_DIR="`pwd`/machines"
BOX_DIR="${BASE_DIR}/${BOX_NAME}"
mkdir -p ${BASE_DIR}
VBoxManage createvm --name "${BOX_NAME}" --ostype RedHat_64 --basefolder ${BASE_DIR}
VBoxManage registervm "${BOX_DIR}/${BOX_NAME}.vbox"
mkdir -p tmp
@racklin
racklin / gitfiti.sh
Last active August 29, 2015 14:10
KP gitfiti
KP = [
[0,0,4,0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,0,0,0,0,0,0,4,0,0,0],
[0,0,4,0,0,4,4,4,4,4,4,4,0,0,4,4,4,4,4,4,0,0,4,0,4,0,4,0],
[4,4,4,4,4,0,0,0,0,4,0,0,0,0,4,4,0,0,4,4,0,0,0,4,0,4,0,0],
[0,4,4,4,0,0,4,4,0,4,0,0,0,0,4,4,0,0,4,4,0,0,4,4,0,4,4,0],
[4,0,4,0,4,0,4,4,0,4,0,0,0,0,4,4,4,4,0,0,0,0,0,0,4,0,0,0],
[0,0,4,0,0,0,0,0,4,4,0,0,0,0,4,4,0,0,0,0,0,0,0,0,4,0,0,0],
[0,0,4,0,0,0,0,0,0,4,0,0,0,0,4,4,0,0,0,0,0,0,0,0,4,0,0,0]]
@racklin
racklin / 0_reuse_code.js
Last active August 29, 2015 14:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@racklin
racklin / index.js
Last active August 29, 2015 14:10 — forked from edokeh/index.js
//
// _oo0oo_
// o8888888o
// 88" . "88
// (| -_- |)
// 0\ = /0
// ___/`---'\___
// .' \\| |// '.
// / \\||| : |||// \
// / _||||| -:- |||||- \
/**
* This is a set of utility functions for character set conversions.
*
* @public
* @name GREUtils.Charset
* @namespace GREUtils.Charset
*/
GREUtils.define('GREUtils.Charset');
/**
@racklin
racklin / test.html
Created November 12, 2012 08:29
test
<html>
<body>
<a href="t:dispatch?controller=Main&command=shutdown"><h1>TEST</h1></a>
<body>
</html>
@racklin
racklin / config.m4
Created November 17, 2015 04:05
simple php extension using pcre
PHP_ARG_ENABLE(test1, whether to enable my extension,
[ --enable-test1 Enable my extension])
if test "$PHP_TEST1" = "yes"; then
AC_DEFINE(HAVE_TEST1, 1, [Whether you have my extension])
PHP_NEW_EXTENSION(test1, test1.c, $ext_shared)
PHP_ADD_EXTENSION_DEP(test1, pcre)
fi
@racklin
racklin / zmq_init.cpp
Created March 25, 2013 08:08
zeromq's zmq_init.cpp include fun
#include <string.h>
#include "zmq_init.hpp"
#include "transient_session.hpp"
#include "named_session.hpp"
#include "socket_base.hpp"
#include "zmq_engine.hpp"
#include "io_thread.hpp"
#include "session.hpp"
#include "uuid.hpp"
@racklin
racklin / .ctags
Created August 31, 2013 04:37 — forked from jesstelford/.ctags
--langdef=coffee
--langmap=coffee:.coffee
--regex-coffee=/(^|=[ \t])*class ([A-Za-z_][A-Za-z0-9_]+\.)*([A-Za-z_][A-Za-z0-9_]+)( extends ([A-Za-z][A-Za-z0-9_.]*)+)?$/\3/c,class/
--regex-coffee=/^[ \t]*(module\.)?(exports\.)?@?(([A-Za-z][A-Za-z0-9_.]*)+):.*[-=]>.*$/\3/m,method/
--regex-coffee=/^[ \t]*(module\.)?(exports\.)?(([A-Za-z][A-Za-z0-9_.]*)+)[ \t]*=.*[-=]>.*$/\3/f,function/
--regex-coffee=/^[ \t]*(([A-Za-z][A-Za-z0-9_.]*)+)[ \t]*=[^->\n]*$/\1/v,variable/
--regex-coffee=/^[ \t]*@(([A-Za-z][A-Za-z0-9_.]*)+)[ \t]*=[^->\n]*$/\1/f,field/
--regex-coffee=/^[ \t]*@(([A-Za-z][A-Za-z0-9_.]*)+):[^->\n]*$/\1/f,static field/
--regex-coffee=/^[ \t]*(([A-Za-z][A-Za-z0-9_.]*)+):[^->\n]*$/\1/f,field/
--regex-coffee=/((constructor|initialize):[ \t]*\()@(([A-Za-z][A-Za-z0-9_.]*)+)([ \t]*=[ \t]*[^,)]+)?/\3/f,field/