Skip to content

Instantly share code, notes, and snippets.

vim control
# basic
:q exit
:w save
:x save & exit
# move
h left
j down
@calorie
calorie / gist:3304515
Created August 9, 2012 14:12
vichrome
vichrome
j: 下へスクロール
k: 上へスクロール
h: 左へスクロール
l: 右へスクロール
gg: ページトップへ
G: ページ最下部へ
t: 新しいタブ
@calorie
calorie / vichrome.conf
Last active October 11, 2015 17:48
vichrome key map
### Sample Settings
# aliases
# in this example you can open extensions page by the command ':ext'
# and Chrome's option page by the command ':option'
alias ext TabOpenNew chrome://extensions/
alias op TabOpenNew chrome://settings/browser
alias dl TabOpenNew chrome://downloads
alias hist TabOpenNew chrome://history
alias clear TabOpenNew chrome://chrome/settings/clearBrowserData
@calorie
calorie / eclipse key bind
Created November 13, 2012 06:20
eclipse key bind
実行 : F5
次のエディタ : <C-w>
前のエディタ : <C-W>
パッケージエクスプローラ : <C-t>
宣言を開く : <C-j>
進む : <C-f>
戻る : <C-b>
リフレッシュ : <C-F5>
@calorie
calorie / fizzbuzz.rb
Created February 18, 2013 14:42
fizzbuzz
def fizzbuzz(i)
puts i % 15 == 0 ? 'FizzBuzz' :
i % 3 == 0 ? 'Fizz' :
i % 5 == 0 ? 'Buzz' :
i
fizzbuzz(i+1) unless i == ARGV[1].to_i
end
fizzbuzz ARGV[0].to_i
@calorie
calorie / vvm
Created April 20, 2013 06:45
vim configure
vvm rebuild vimorg--v7-3-905 --enable-multibyte --with-features=huge --enable-fontset --disable-selinux --enable-perlinterp --enable-pythoninterp --enable-rubyinterp --enable-xim --enable-python3interp --enable-luainterp
@calorie
calorie / vimium.conf
Created April 30, 2013 11:37
vimium key mapping
unmapAll
map s Vomnibar.activate
map S Vomnibar.activateInNewTab
map / enterFindMode
map b Vomnibar.activateBookmarks
map B Vomnibar.activateBookmarksInNewTab
@calorie
calorie / c
Last active December 18, 2015 13:59
cspec improved
describe(fabs, "double fabs( double arg )")
it( "returns the same number if the input number is positive" )
should_equal( fabs(1.0), 1.0)
should_equal( fabs(0.0), 0.0)
should_equal( fabs(6.7), 6.7)
end
it( "returns the opposite number if the number is negative" )
should_equal( fabs(-1.0, 1.0)
@calorie
calorie / gist:6405356
Last active December 22, 2015 02:48
ruby_global_values
ruby global values
$! $ERROR_INFO
$@ $ERROR_POSITION
$; $FIELD_SEPARATOR
$, $OUTPUT_FIELD_SEPARATOR
$/ $INPUT_RECORD_SEPARATOR
$\ $OUTPUT_RECORD_SEPARATOR
$. $INPUT_LINE_NUMBER
$_ $LAST_READ_LINE
$> $DEFAULT_OUTPUT
@calorie
calorie / gist:6433580
Last active December 22, 2015 06:49
latest
sudo add-apt-repository -y ppa:rwky/redis
sudo apt-get update
sudo apt-get -y install redis-server
sudo add-apt-repository -y ppa:ondrej/mysql
sudo apt-get update
sudo apt-get -y install mysql-client mysql-server
sudo sh -c 'echo deb http://www.apache.org/dist/cassandra/debian 11x main >> /etc/apt/sources.list.d/cassandra-stable.list'
sudo sh -c 'echo deb-src http://www.apache.org/dist/cassandra/debian 11x main >> /etc/apt/sources.list.d/cassandra-stable.list'