This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Contex | |
| constructor: (locals) -> | |
| class SpecificView extends locals | |
| doStuff: () -> | |
| "stuff" | |
| @view: new SpecificView |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ∴ dicks | figlet -f cosmic | |
| .::::. :::::::-. | |
| `;. ,;' ;;, `';, | |
| [nn[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,`[[ [[ | |
| $" $c"""" """" """" """" """" """" $$, $$ | |
| Yb,_,8Poooo oooo oooo oooo oooo oooo 888_,o8P' | |
| "YMP" """" """" """" """" """" """" MMMMP"` | |
| .::::. :::::::-. | |
| `;. ,;' ;;, `';, | |
| [nn[,,,,,,`[[ [[ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module MMixer | |
| def m | |
| puts "Mixing In M" | |
| self.class.class_eval do | |
| include M | |
| end | |
| m | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <% json = {:html => render(:partial => 'foo/bar.html')} %> | |
| <%= json.to_json.html_safe %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |