This file contains 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! RubyNewHashSyntax() | |
:%s/:\(\w\+\) =>/\1:/ge | |
endfunction | |
command! RubyNewHashSyntax :call RubyNewHashSyntax() |
This file contains 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
#!/usr/bin/env ruby | |
# -*- coding: utf-8 -*- | |
Dir['**/*.rb'].each do |f| | |
File.open(f, 'r+') do |io| | |
buf = io.readlines | |
unless /coding:/ =~ buf[0] | |
io.rewind | |
buf.unshift "# -*- coding: utf-8 -*-\n\n" | |
io.write buf.join |
This file contains 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 . -name ".svn" -type d -exec rm -rf {} ";" |
This file contains 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> |
This file contains 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 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 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 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 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 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 |
OlderNewer