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
| {{#each Editor.elements}} | |
| {{#view Editor.CanvasView elementBinding="this" tagName="div" }} | |
| {{element.content}} | |
| {{/view}} | |
| {{/each}} |
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('lib/setup') | |
| Spine = require('spine') | |
| class App extends Spine.Controller | |
| constructor: -> | |
| super | |
| @log 'lol' | |
| @routes | |
| '/galleries/:id': (params) -> |
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
| post :add do | |
| if (file = params[:file]) | |
| image = Image.create( | |
| :name => 'abc', | |
| :gallery_id => 1 | |
| ) | |
| image.upload(file) | |
| 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
| class User | |
| include DataMapper::Resource | |
| # property <name>, <type> | |
| property :id, Serial | |
| property :username, String, :unique => true | |
| property :email, String, :unique => true | |
| def find_by_id(id) | |
| get(id) |
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 Rack | |
| class JSON | |
| def initialize app | |
| @app = app | |
| end | |
| def call env | |
| @status, @headers, @body = @app.call env | |
| @body = @body.to_json | |
| 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
| require 'sinatra/base' | |
| require 'data_mapper' | |
| require 'json' | |
| DataMapper::Logger.new($stdout, :debug) | |
| # A Sqlite3 connection to a persistent database | |
| DataMapper.setup(:default, 'sqlite:///Users/adam/Programming/Web/ruby/sinatra/photos/photos.db') | |
| class User | |
| include DataMapper::Resource |
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
| /* Cross browserify a radial gradient | |
| =radial_gradient_f($params) | |
| background-image: -webkit-radial-gradient($params) | |
| background-image: -moz-radial-gradient($params) | |
| background-image: -ms-radial-gradient($params) | |
| background-image: -o-radial-gradient($params) | |
| background-image: radial-gradient($params) | |
| /* Cross browserify a linear gradient | |
| =linear_gradient_f($params) |
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
| /* Horizontal and vertical rules */ | |
| .rule | |
| $transparent: rgba(000,000,000,0.0) | |
| $line_in : rgba(000,000,000,0.2) | |
| $radial_in : rgba(000,000,000,0.3) | |
| $grad_params : $transparent, $line_in 25%, $line_in 75%, $transparent | |
| div | |
| position: absolute | |
| &.h |
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
| =linear_gradient($from, $to) | |
| /* fallback/image non-cover color */ | |
| background-color: $from | |
| /* Firefox 3.6+ */ | |
| background-image: -moz-linear-gradient($from, $to) | |
| /* Safari 4+, Chrome 1+ */ | |
| background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from($from), to($to)) | |
| /* Safari 5.1+, Chrome 10+ */ | |
| background-image: -webkit-linear-gradient($from, $to) | |
| /* Opera 11.10+ */ |
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
| # Defaults | |
| grid = [10,10] | |
| container = "#container" | |
| # Button types | |
| window.buttons = | |
| text : | |
| html : '<div> | |
| <div class="content"> |