##small trick 集 ###sudo.vim 使い方
- 今開いているファイルがreadonly だった...
- :e sudo:%
- 特権ユーザーでファイルを開き直した!
###eregex.vim 使い方
- 置換したい文字列に\を大量にいれなければいけないとき
##small trick 集 ###sudo.vim 使い方
###eregex.vim 使い方
#Slimとは Rail系のテンプレートエンジン(PHPでも使える) Hamlより記号などが省いておりシンプルに作れる
##インストール
gem install slim slim-rails
##Gemファイル記入
##vimからDBを操作する
###インストール vim-scripts/dbext.vim をBundleInstall ###設定 .vimrc に下記のように書き込む。
let dbext_default_profile = ""
let dbext_default_type = "MYSQL"
let dbext_default_user = "root"
#メソッドチェインとは 流れるようなインターフェース
3.weeks.ago
3.weeks.ago.saturday?
Product.whie(:price => 100 )
Product.order(:price).limit(10).offset(0)
(0..9).map{|i| i +1 }
#動的なメソッド定義
def add_method(c, m, &b)
c.class_eval {
define_method(m, &b)
}
end
add_method(String, :greet) { "Hello, " + self }
"world".greet
Locate the section for your github remote in the .git/config
file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.
You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf
using homebrew.