Skip to content

Instantly share code, notes, and snippets.

sys: require('sys')
Connect: require('connect')
N: require '../../index'
n1: new N()
n2: new N()
# Declare Mount controllers
n1.mount require('./app/posts'), "/posts"
n2.mount require('./app/cookies'), '/cookies'
class Guard < Padrino::Application
register Padrino::Helpers
require 'sass/plugin/rack'
Warden::Manager.serialize_into_session{|user| user.id }
Warden::Manager.serialize_from_session{|id| User.get(id) }
Warden::Manager.before_failure do |env,opts|
# Sinatra is very sensitive to the request method
class Contex
constructor: (locals) ->
class SpecificView extends locals
doStuff: () ->
"stuff"
@view: new SpecificView
∴ dicks | figlet -f cosmic
.::::. :::::::-.
`;. ,;' ;;, `';,
[nn[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,`[[ [[
$" $c"""" """" """" """" """" """" $$, $$
Yb,_,8Poooo oooo oooo oooo oooo oooo 888_,o8P'
"YMP" """" """" """" """" """" """" MMMMP"`
.::::. :::::::-.
`;. ,;' ;;, `';,
[nn[,,,,,,`[[ [[
# What is the best way to get it to put out a, b, c
# without erroring about the superclass. The module
# inclusion order should not matter. In other words,
# I should be able to include A then B or B then A
# and either way all the letters a, b, and c are
# printed out (though not necessarily in that exact order)
module TopLevel
def foo(*args)
# do nothing
module MMixer
def m
puts "Mixing In M"
self.class.class_eval do
include M
end
m
end
end
<% json = {:html => render(:partial => 'foo/bar.html')} %>
<%= json.to_json.html_safe %>
use Warden::Manager do |config|
config.default_strategies :foo, :bar
config.default_strategies :baz, :scope => :baz
config.default_scope_options :baz, :store => false
config.failure_app = FailureApp
end
require 'rubygems'
require 'rake'
task :bundler do
begin
# Require the preresolved locked set of gems.
require File.expand_path('../../.bundle/environment', __FILE__)
rescue LoadError
# Fallback on doing the resolve at runtime.
require "rubygems"
require 'stringex'
module DataMapper
module Types
class Slug < DataMapper::Type
primitive String
length 2000
# Maximum length chosen because URI type is limited to 2000
# characters, and a slug is a component of a URI, so it should