This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # RSpec matcher to spec delegations. | |
| # Forked from https://gist.github.com/ssimeonov/5942729 with fixes | |
| # for arity + custom prefix. | |
| # | |
| # Usage: | |
| # | |
| # describe Post do | |
| # it { should delegate(:name).to(:author).with_prefix } # post.author_name | |
| # it { should delegate(:name).to(:author).with_prefix(:any) } # post.any_name | |
| # it { should delegate(:month).to(:created_at) } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mkdir -p /usr/local/macvim/vim | |
| cd /usr/local/macvim/vim | |
| # copy MacVim's mvim script here | |
| # and add /usr/local/macvim/vim to the beginning of /etc/paths | |
| ln -s mvim eview | |
| ln -s mvim evim | |
| ln -s mvim ex | |
| ln -s mvim exim | |
| ln -s mvim gex | |
| ln -s mvim gview |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function! TabOrSpace() | |
| let text = strpart(getline('.'), 0, col('.')-1) | |
| if text =~ '^\t*$' | |
| return "\<C-v>\<Tab>" | |
| else | |
| let l = strdisplaywidth(text) | |
| let n = float2nr(floor(l / &l:softtabstop) + 1) * &l:softtabstop | |
| return repeat(' ', n - l) | |
| endif | |
| endfunction |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| foo | |
| bar | |
| baz | |
| } | |
| ( | |
| foo | |
| bar | |
| baz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| hash = lambda { |h, k| h[k] = Hash.new &hash } | |
| x = Hash.new &hash | |
| x[1][2][3][4][5] = 6 | |
| x #=> {1=>{2=>{3=>{4=>{5=>6}}}}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- irssi-0.8.15.orig/src/fe-text/gui-readline.c | |
| +++ irssi-0.8.15/src/fe-text/gui-readline.c | |
| @@ -392,12 +392,6 @@ | |
| str[g_unichar_to_utf8(key, str)] = '\0'; | |
| } | |
| - if (strcmp(str, "^") == 0) { | |
| - /* change it as ^^ */ | |
| - str[1] = '^'; | |
| - str[2] = '\0'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- tmux-1.6.orig/cmd.c | |
| +++ tmux-1.6/cmd.c | |
| @@ -1235,11 +1235,11 @@ cmd_get_default_path(struct cmd_ctx *ctx | |
| if (*cwd == '\0') { | |
| if (ctx->cmdclient != NULL && ctx->cmdclient->cwd != NULL) | |
| return (ctx->cmdclient->cwd); | |
| - if (ctx->curclient != NULL) { | |
| - wp = s->curw->window->active; | |
| - if ((cwd = osdep_get_cwd(wp->pid)) != NULL) | |
| - return (cwd); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Asset < ActiveRecord::Base | |
| has_many :ownerships | |
| has_many :owners, :through => :ownerships | |
| has_one :current_ownership, :class_name => Ownership.name, :conditions => { :current => true } | |
| has_one :current_owner, :through => :current_ownership, :source => :owner | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function! Test() | |
| try | |
| silent !watch -n 1 date | |
| catch | |
| endtry | |
| redraw! | |
| endfunction |
NewerOlder