This file contains 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
#!/bin/bash | |
function get_new_names() { | |
local input_names=$1 | |
sed 's/[ \t]\+/:/g' $input_names | |
} | |
function gen_subst_func() { | |
local from=$1 | |
local to=$2 |
This file contains 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
class SwitchSign(Exception): | |
pass | |
class BreakOut(Exception): | |
pass | |
def inner(): | |
coef = 1 |
This file contains 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
#!/bin/sh | |
function eject() { | |
local msg=$1 | |
echo "$msg" 1>&2 | |
exit 1 | |
} | |
npm init || eject "'npm init' failed" |
This file contains 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
(in-package :stumpwm) | |
(define-key *root-map* (kbd "C-c") "exec gnome-terminal") | |
(define-key *root-map* (kbd "c") "exec gnome-terminal") | |
(define-key *root-map* (kbd "C-e") "exec gvim") | |
(define-key *root-map* (kbd "C-h") "move-focus left") | |
(define-key *root-map* (kbd "C-j") "move-focus down") | |
(define-key *root-map* (kbd "C-k") "move-focus up") | |
(define-key *root-map* (kbd "C-l") "move-focus right") |
This file contains 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
#!/bin/bash | |
# get_src_url([url]) | |
get_src_url() | |
{ | |
local url=$1 | |
if [ "$url" == "" ]; then | |
local merged_path=`svn propget svn:mergeinfo | head -n 1 | cut -d':' -f1` | |
local root=`svn info | sed -n '/^Repository Root: / { s/Repository Root: //g; p; }'` |
This file contains 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
# $Id: vim-keys.conf,v 1.2 2010-09-18 09:36:15 nicm Exp $ | |
# | |
# vim-keys.conf, v1.2 2010/09/12 | |
# | |
# By Daniel Thau. Public domain. | |
# | |
# This configuration file binds many vi- and vim-like bindings to the | |
# appropriate tmux key bindings. Note that for many key bindings there is no | |
# tmux analogue. This is intended for tmux 1.3, which handles pane selection | |
# differently from the previous versions |
This file contains 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
%% | |
%% 一个支持多键值记录的库 | |
%% | |
%% 底层其实是1个gb_tree() + N个dict(),N是键值的数量。 | |
%% 由于最初做世界聊天记录的时候要求按时间排序,所以用了gb_tree(), | |
%% 所以插入和删除会慢一点(大概几十微秒),但是查找会比较快(几微秒) | |
%% | |
%% 如果不在意顺序,完全可以把gb_tree()和dict()换成ets,插入/删除应该能快很~多倍 | |
%% | |
%% 用法: |
This file contains 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
-ifndef(__GEN_CALLBACK_SERVER_HRL__). | |
-define(__GEN_CALLBACK_SERVER_HRL__, 1). | |
-type process_ref() :: pid() | {atom(), node()}. | |
-type server_ref() :: pid() | {{local, atom()} | {global, term()} | {via, module(), term()}, node()}. | |
-define(RECEIVE_CB, (fun gen_callback_server:receive_cb/2)). | |
-define(REPLY_CB, (fun gen_callback_server:reply_cb/1)). | |
-define(CLIENT_REPLY_CB, (fun gen_callback_server:client_reply_cb/1)). | |
-define(MIXED_REPLY_CB, (fun gen_callback_server:mixed_reply_cb/1)). |
This file contains 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
-module(gen_callback_server). | |
-behaviour(gen_server). | |
-include("gen_callback_server.hrl"). | |
-export([behaviour_info/1]). | |
-export([ | |
start_link/4, |
This file contains 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
" Setting up Vundle | |
set nocp | |
filetype off | |
set rtp+=~/.vim/bundle/vundle/ | |
call vundle#rc() | |
" Let Vundle manage Vundle | |
" Required by Vundle doc. | |
Bundle "gmarik/vundle" |