Skip to content

Instantly share code, notes, and snippets.

View aar0nTw's full-sized avatar
:electron:
Focusing

Aaron Huang aar0nTw

:electron:
Focusing
View GitHub Profile
\set PROMPT1 '%[%033[1m%]%M %n@%/%R%[%033[0m%]%# '
\set PROMPT2 '[more] %R > '
-- By default, NULL displays as an empty space. Is it actually an empty
-- string, or is it null? This makes that distinction visible.
\pset null '[NULL]'
-- Use table format (with headers across the top) by default, but switch to
-- expanded table format when there's a lot of data, which makes it much
\set PROMPT1 '%[%033[1m%]%M %001%[%033[1;33;40m%]%002%n@%/%R%001%[%033[0m%]%002%# '
\set PROMPT2 '[more] %R > '
-- By default, NULL displays as an empty space. Is it actually an empty
-- string, or is it null? This makes that distinction visible.
\pset null '[NULL]'
-- Use table format (with headers across the top) by default, but switch to
-- expanded table format when there's a lot of data, which makes it much
# use pbcopy and pbpaste
# need preinstall the reattach-to-user-namespace 'brew install reattach-to-user-namespace'
#
set -g default-shell /bin/zsh
set-option -g default-command "reattach-to-user-namespace -l zsh"
bind C-c run "tmux show-buffer | reattach-to-user-namespace pbcopy"
bind C-v run "reattach-to-user-namespace pbpaste | tmux load-buffer - && tmux paste-buffer"
# start window index of 1
set -g base-index 1
length = 32
mid = 2**(length-1)
max_unsigned = 2**length
to_signed = proc {|n| (n>=mid) ? n - max_unsigned : n}
p to_signed["0xFFF54006".to_i(16)]
@aar0nTw
aar0nTw / CJKMatcher.coffee
Created May 21, 2014 08:53
Check the string have cjk char
define (require) ->
##
# Unicode range for CJK words.
# 3000 - 303f: Japanese-style punctuation
# 3040 - 309f: Hiragana
# 30a0 - 30ff: Katakana
# ff00 - ff9f: Full-width Roman characters and half-width Katakana
# 4e00 - 9faf: CJK unified ideographs - Common and uncommon Kanji
# 3400 - 4dbf: CJK unified ideographs Extension A - Rare Kanji
##
### Keybase proof
I hereby claim:
* I am aar0ntw on github.
* I am aar0ntw (https://keybase.io/aar0ntw) on keybase.
* I have a public key whose fingerprint is B57A F8D1 213E 4141 AA7F BA57 3E16 E47D 032F F507
To claim this, I am signing this object:
@aar0nTw
aar0nTw / 0_reuse_code.js
Created June 24, 2014 18:23
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
@aar0nTw
aar0nTw / gist:3747327
Created September 19, 2012 02:37
Use sed to remove js console method
sed -E 's/console.(log|debug|info|...|count)\((.*)\);?//g'
@aar0nTw
aar0nTw / tmux.conf
Created December 12, 2012 17:26
disable tmux auto title
DISABLE_AUTO_TITLE=true
;Reload tmux conf
;:source-file ~/.tmux.conf
@aar0nTw
aar0nTw / mixin.coffee
Created December 12, 2012 17:19
Mixin in CoffeeScript
Object::mixin = (Klasses...) ->
Klasses.forEach (Klass) =>
# assign class properties
for key, value of Klass
@[key] = value
# assign instance properties
for key, value of Klass.prototype
@::[key] = value
@