Skip to content

Instantly share code, notes, and snippets.

View zliang-min's full-sized avatar

Gimi Liang zliang-min

View GitHub Profile

Keybase proof

I hereby claim:

  • I am Gimi on github.
  • I am gimi (https://keybase.io/gimi) on keybase.
  • I have a public key whose fingerprint is CEE0 4921 9D22 B667 BA0D 88B4 2E88 203B 8E03 1F35

To claim this, I am signing this object:

@zliang-min
zliang-min / .tmux.conf
Created December 8, 2015 07:10
My configs.
set -g prefix C-x
unbind C-b
set -sg escape-time 1
setw -g mode-keys vi
set -g base-index 1
setw -g pane-base-index 1
if
[ -f "$rvm_path/scripts/rvm" ]
then
__env="$( "$rvm_path/bin/rvm" . do env --path )"
if
[ -n "$__env" ] &&
[ -s "$__env" ]
then
source "$__env"
fi
@zliang-min
zliang-min / molokai.vim
Created July 27, 2012 06:08
The vim colorscheme of molokai (from github.com/tomasr/molokai).
" Vim color file
"
" Author: Tomas Restrepo <[email protected]>
"
" Note: Based on the monokai theme for textmate
" by Wimer Hazenberg and its darker variant
" by Hamish Stuart Macpherson
"
hi clear
@zliang-min
zliang-min / parse-json.rb
Created December 21, 2011 17:23 — forked from mislav/stupid-json.rb
Stupid simple JSON parser
require 'strscan'
require 'forwardable'
# Stupid JSON parser. Only handles well-formed JSON.
# Otherwise, it may go into an endless loop.
class Parser
WSP = /\s+/
OBJ = /[{\[]/
NUM = /-?\d+(\.\d+)?([eE][+-]?\d+)?/
BOL = /(?:true|false)\b/
@zliang-min
zliang-min / example.rb
Created November 10, 2011 18:30
You don't need a library for everything. For example, git.io :)
Git.io.generate 'https://gist.github.com/gists/1355677'
Git.io.generate 'https://github.com/gimi', 'gimi'
Git.io.recognize 'http://git.io/gimi'
@zliang-min
zliang-min / README.markdown
Created November 7, 2011 09:57 — forked from weakish/README.markdown
#Solarized themes (dark and light) for #roxterm.

Roxterm solarized theme

Description

Solarized themes (dark and light) for roxterm.

@zliang-min
zliang-min / fiber_race.rb
Created November 3, 2011 02:56 — forked from raggi/fiber_race.rb
An example race condition using fibers
# Author:: Mohammad A. Ali (mailto:[email protected])
# Copyright:: Copyright (c) 2008 eSpace, Inc.
# License:: Distributes under the same terms as Ruby
require 'fiber'
class Fiber
#Attribute Reference--Returns the value of a fiber-local variable, using
#either a symbol or a string name. If the specified variable does not exist,
require 'dl'
require 'fiddle'
module FFI
module Library
def ffi_lib *libs
libs.each { |lib| DL.dlopen lib }
end
def attach_function name, arg_types, return_type
@zliang-min
zliang-min / high_function.scala
Created August 10, 2011 09:49
Use scala high functions in JRuby!
object HighFunction {
def foo(num : Int)(f : Int => Int) = f(num)
}