Skip to content

Instantly share code, notes, and snippets.

View leonlee's full-sized avatar
🎯
Focusing

Leon Lee leonlee

🎯
Focusing
  • ACAR
  • Beijing
View GitHub Profile
%%%-------------------------------------------------------------------
%%% @author Fernando Benavides <fernando.benavides@inakanetworks.com>
%%% @copyright (C) 2011 Inaka Networks S.R.L.
%%% @doc It listens and just repeats...
%%% @end
%%%-------------------------------------------------------------------
-module(gen_event_repeater).
-author('Fernando Benavides <fernando.benavides@inakanetworks.com>').
-behaviour(gen_event).
%%% @author Sergey Prokhorov <me@seriyps.ru>
%%% @copyright (C) 2013, Sergey Prokhorov
%%% @doc
%%% Walker alias method - efficient random selection with defined probabilities.
%%% <http://en.wikipedia.org/wiki/Alias_method>
%%%
%%% > ProbabilityValueList = [{10, a}, {20, b}, {30, c}, {40, d}],
%%% > WalkerVectors = walker_alias:build(ProbabilityValueList),
%%% > RandomValue = walker_alias:choice(WalkerVectors).
%%%
# Screen Options ##
shell bash # Tell screen your default shell
startup_message off # Turn off start message
defscrollback = 5000
shelltitle '$ |bash' # Dynamic window titled for running program
msgwait 1 # Set messages timeout to one second
nethack on # Turn on nethack error messages
backtick 0 0 0 whoami # Set "%0`" to equal the output of "whoami"
escape ^Oo
"20091020
let mapleader=";"
" " " 映射
" " 页面操作
" 一次移动5行
noremap j 5j
noremap k 5k
" 上下滚动

Spark project AS3 library list

Graphics/Color (AS3)

@leonlee
leonlee / gist:176f565d560df09988ad
Created November 2, 2015 10:51 — forked from fernandoaleman/gist:5083680
How to update VirtualBox Guest Additions with vagrant
# Start the old vagrant
$ vagrant init centos-6.3
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
# this machine, please update the guest additions and repackage the
# box.
@leonlee
leonlee / dkcleanup.sh
Created November 18, 2015 06:00 — forked from brianclements/dkcleanup.sh
Bash script helper to remove Docker images and containers.
#!/bin/bash
# options:
# remove stopped containers and untagged images
# $ dkcleanup
# remove all stopped|running containers and untagged images
# $ dkcleanup --reset
# remove containers|images|tags matching {repository|image|repository\image|tag|image:tag}
# pattern and untagged images
# $ dkcleanup --purge {image}
local redis_c = require "resty.redis"
local ok, new_tab = pcall(require, "table.new")
if not ok or type(new_tab) ~= "function" then
new_tab = function (narr, nrec) return {} end
end
local _M = new_tab(0, 155)
@leonlee
leonlee / vim.markdown
Created March 7, 2016 11:57 — forked from socketwiz/vim.markdown
Vim cheat sheet

##motions

motion description
h Count characters left
l Count characters right
^ To the first character of the line
$ To the last character of the line
f<char> To the counth character occurrence to the right. F<char> to the counth character occurrence to the left
t<char> To 1 character just before the counth character occurrence to the right
T<char> To 1 character just before the counth character occurrence to the left