Skip to content

Instantly share code, notes, and snippets.

<div id="footer">
This site is Copyright &copy; 2008 - blah, blah, blah
</div>
$ git commit -am "fixed it"
$ git checkout master
$ git merge some-bug
<a href="somewhere.com" rel="external" title="somewhere.com">
somewhere.com
</a>
<div id="footer"></div>
#!(path-to-python, eg. /usr/bin/python)
import sqlite3
db = sqlite3.connect( "stats.sqlite3" )
db.cursor().execute( "CREATE TABLE IF NOT EXISTS " \
"visits ( page TEXT, timestamp TEXT, ip TEXT )" )
InjectedScript._type = function(obj)
{
// ... some code ...
// ... some conditions ...
// Add our own:
if (obj.__proto__ && obj.__proto__.jquery)
return "array";
// ... leave the fall back ...
namespace :admin do
mount Resque::Server, :at => '/resque'
# ...
end
ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'
it "should etc, etc" do
using_constants( SomeClass, { :CONST_A => stub, :CONST_B => 1 } ) do
# ...
end
end
@rfunduk
rfunduk / example_controller.rb
Created February 17, 2012 13:24 — forked from shime/example_controller.rb
sending errors to Exceptional with rescue_from
class ExampleController < ApplicationController
rescue_from Exception, :with => :render_custom
def render_custom(exception)
if Exceptional::Remote.error(Exceptional::ExceptionData.new(exception, "Test Exception"))
Rails.logger.info "Exceptional: #{exception.class} has been reported to Exceptional"
else
Rails.logger.error "Exceptional: Problem sending exception. Check your API key."
end