Skip to content

Instantly share code, notes, and snippets.

View superscott's full-sized avatar
👺
щ(ಠ益ಠщ) (✖╭╮✖) ᕦ(ò_óˇ)ᕤ

superscott superscott

👺
щ(ಠ益ಠщ) (✖╭╮✖) ᕦ(ò_óˇ)ᕤ
View GitHub Profile
@cache ||= begin
return true if condition1 && condition2
return true if condition3
return true if condition4
long_code1
long_code2
long_code3
result2
end
<div id="error_page" class="box">
<h1>Ops, 404</h1>
<p>
似乎没有这个页面哦!大哥,去看看别的吧。
</p>
</div>
<!--因为不排除连rails 都无法运行的情况 所以添加 'public/STATUS.htm' 还是很有必要的-->
<!--more>
Finally, the default exceptions application used by Rails that simply renders a page in `public/STATUS.html` is available here: [action_dispatch/middleware/public_exceptions.rb](https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/middleware/public_exceptions.rb)
Remember that whatever you do in the errors controller, it should not be anything “fancy”. Keep it simple because something already went wrong with your application!

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation