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
| get '/riddle/:id' do | |
| @riddle = Riddle.get(params[:id]) | |
| slim :show | |
| end | |
| post '/riddle' do | |
| riddle = Riddle.create(params[:riddle]) | |
| redirect to("/riddle/#{riddle.id}") | |
| 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
| class Riddle | |
| include DataMapper::Resource | |
| property :id, Serial | |
| property :title, String | |
| property :html, Text | |
| property :css, Text | |
| property :js, Text | |
| def title=(value) | |
| super(value.empty? ? "Yet another untitled Riddle" : value) |
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 'sinatra' | |
| require 'dm-core' | |
| require 'dm-migrations' | |
| require 'sass' | |
| require 'slim' | |
| configure do | |
| DataMapper.setup(:default, ENV['DATABASE_URL'] || File.join("sqlite3://",settings.root, "development.db")) | |
| 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 'sinatra' | |
| require 'sass' | |
| require 'slim' | |
| get '/css/styles.css' { scss :styles } | |
| get '/' do | |
| slim :index | |
| 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
| class TeamOfHVACProfessionals | |
| include IceWater | |
| extend CoolGlassOfLemonade | |
| validates :pool, | |
| :presence => true | |
| belongs_to :the_arctic | |
| has_one :temperature_setting, :in => [:cold] |
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
| switch (food) { | |
| case "fish": | |
| cook(bake); | |
| break; | |
| case "steak": | |
| cook(grill); | |
| break; | |
| case "french fries": |
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
| {"steps": { | |
| "portrait" : { | |
| "robot" : "/file/filter", | |
| "use" : ":original", | |
| "accepts" : [ | |
| ["${file.meta.height}", ">", "${file.width}"] | |
| ], | |
| "error_on_decline" : false | |
| }, | |
| "landscape" : { |
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
| var teenager; | |
| teenager = (12 > age && age < 20); |
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
| teenager = 12 > age < 20 |
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
| switch (food) { | |
| case "fish": | |
| cook(bake); | |
| break; | |
| case "steak": | |
| cook(grill); | |
| break; | |
| case "french fries": |