Skip to content

Instantly share code, notes, and snippets.

View tammersaleh's full-sized avatar
🚀
Orbiting?

Tammer Saleh tammersaleh

🚀
Orbiting?
View GitHub Profile
context "on get to /users" do
setup { get :index }
should "call the finder", :before => lambda {User.expects(:finder).returns(@users)} do
assert_equal @users, assigns(:users)
end
end
[tsaleh@tardis-2:~/.vim/plugin] \ls
AlignMaps.vim endwise.vim pastie.vim supertab.vim
AlignPlugin.vim feraltogglecommentify.vim project.vim surround.vim
DrawItPlugin.vim getscriptPlugin.vim rails.vim tComment.vim
cecutil.vim matchit.vim scmdiff.vim taglist.vim
dbext.vim multvals.vim shoulda.vim
" # mac
" let g:gist_clip_command = 'pbcopy'
"
" # linux
" let g:gist_clip_command = 'xclip -selection clipboard'
"
" # others(cygwin?)
" let g:gist_clip_command = 'putclip'
"
" GetLatestVimScripts: 2423 1 :AutoInstall: gist.vim
let g:gist_clip_command = 'pbcopy'
" disable paren matching
let loaded_matchparen = 1
" disable matchit
let loaded_matchit = 1
set backspace=indent,eol,start
let g:gist_clip_command = 'pbcopy'
" disable paren matching
let loaded_matchparen = 1
" disable matchit
let loaded_matchit = 1
set backspace=indent,eol,start
system('open '.res)
endfunction
function! Gist(line1, line2, ...)
if !exists('g:github_user')
let g:github_user = substitute(system('git config --global github.user'), "\n", '', '')
endif
if !exists('g:github_token')
let g:github_token = substitute(system('git config --global github.token'), "\n", '', '')
endif
echon " Posting it to gist... "
let quote = &shellxquote == '"' ? "'" : '"'
let url = 'http://gist.github.com/gists'
let res = system('curl -i -d @'.quote.file.quote.' '.url)
call delete(file)
let res = matchstr(split(res, "\n"), '^Location: ')
let res = substitute(res, '^.*: ', '', '')
echo 'done: '.res
endfunction
<ul>
<li>
stuff
</li>
</ul>
def ensure_ssl_connection
if ENFORCE_SSL and not request.ssl?
Rails.logger.info(request.headers.to_yaml)
flash.keep
redirect_to params.merge(:protocol => "https://")
end
end