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
| # Mongoid 3 uses Moped as MongoDB driver, not mongo-ruby-driver. | |
| # Thus we should replace some codes. | |
| # Change your spec/spec_helper.rb like this code below: | |
| RSpec.configure do |config| | |
| config.before(:each) do | |
| Mongoid.session(:default).collections.each do |collection| | |
| # Each Moped::Collection instance is picked up, | |
| # and drop the collection. | |
| collection.drop |
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
| # Notifiers | |
| case RUBY_PLATFORM | |
| when /linux/i | |
| gem 'libnotify' | |
| when /darwin/i | |
| gem 'growl' | |
| when /mswin(?!ce)|mingw|cygwin|bccwin/i | |
| gem 'rb-notifu' | |
| 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
| syntax on | |
| set number | |
| set nocompatible | |
| set nosmartcase | |
| set expandtab | |
| set ts=2 st=2 sts=2 | |
| set shiftwidth=2 | |
| set cursorline |
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
| birth = Time.parse('1986/06/08') | |
| (Time.now.strftime("%Y%m%d").to_i - birth.strftime("%Y%m%d").to_i) / 10000 |
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! CakePHPHelpers() | |
| :%s/\$this->Form/\$form/ge | |
| :%s/\$this->Html/\$html/ge | |
| endfunction | |
| command! CakePHPHelpers :call CakePHPHelpers() |
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! PHPAbbreviation() | |
| :%s/<?\(\s\+\|php\s\+\)echo\s\+\(.*\)\s*;\s*?>/<?= \2; ?>/ge | |
| endfunction | |
| command! PHPAbbreviation :call PHPAbbreviation() |
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
| #!/bin/sh | |
| find . -type f | grep -v "\/\." | xargs grep $1 |
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! MagicComment() | |
| return "# -*- coding: utf-8 -*-\<CR>" | |
| endfunction | |
| inoreabbrev <buffer> ## <C-R>=MagicComment()<CR> |
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
| nnoremap j gj | |
| nnoremap k gk | |
| nnoremap <Down> gj | |
| nnoremap <Up> gk |
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
| nmap <ESC><ESC> :nohlsearch<CR><ESC> |