Skip to content

Instantly share code, notes, and snippets.

@tcha-tcho
Created August 30, 2010 06:36
Show Gist options
  • Save tcha-tcho/557098 to your computer and use it in GitHub Desktop.
Save tcha-tcho/557098 to your computer and use it in GitHub Desktop.
# get path do ... end
snippet get
get '/${1:path}'${2:, options} do
${3:# ...}
end
# post path do ... end
snippet post
post '/${1:path}'${2:, options} do
${3:# ...}
end
# put path do ... end
snippet put
put '/${1:path}'${2:, options} do
${3:# ...}
end
# delete path do ... end
snippet del
delete '/${1:path}'${2:, options} do
${3:# ...}
end
# head ... end
snippet head
head '/${1:path}'${2:, options} do
${3:# ...}
end
snippet rest
get '/${1:path}' do
${2}
end
post '/${1}' do
${3}
end
put '/${1}' do
${4}
end
delete '/${1}' do
${5}
end
snippet gp
get '/${1:path}' do
${2}
end
post '/${1}' do
${3}
end
snippet err
error ${1:ErrorName} do
stop ${2:number}, ${3:'<h1>Error!</h1>'}
end
snippet be
before do
${1}
end
snippet conf
configure :${1:stage} do
${2}
end
snippet lay
__END__
@@ ${1:layout}
${2:= yield}
${3}
snippet @
@@ ${1:page}
snippet erb
erb :${1:name_of_view}
snippet haml
haml :${1:name_of_view}
snippet nf
not_found do
${1:'<h1>Four Oh Four!</h1>'}
end
snippet sass
haml :${1:name_of_stylesheet}
# helpers inclass
snippet helc
helpers ${1:inclass}
# helpers do def helper end ... end
snippet held
helpers do
${1:helper}
end
@hallison
Copy link

Muito bom ... vou incluir esse Snippet no Vim-Ruby/Sinatra ... obrigado!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment