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
| <html> | |
| <head> | |
| <title>Checkbox</title> | |
| <style> | |
| input[type=checkbox] { | |
| display:none; | |
| } | |
| input[type=checkbox] + label | |
| { |
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
| Models = require("./def"); | |
| sys = require("sys"); | |
| sys.println = function(string){ | |
| sys.print(string + "\n"); | |
| } | |
| NodeMapper = {}; | |
| NodeMapper.Resource = {}; | |
| Models.def ("Person")({ |
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
| $$('a[href="<%=request.path_info%>"]').each(function(s){s.addClassName("selected")}); |
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 Table | |
| # Checks if the table is available for a given time range. | |
| # | |
| # @param [Hash(Symbol => DateTime)] params | |
| # | |
| def available_at?(params) | |
| if (params[:at].class != DateTime); raise ArgumentError, "Provide a DateTime for :at";end; | |
| if (params[:ending].class != DateTime); raise ArgumentError, "Provide a DateTime for :ending";end; | |
| return false if |
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
| #!/usr/bin/env ruby -Ku | |
| # encoding: utf-8 | |
| require 'rubygems' | |
| require 'dm-core' | |
| require 'dm-types' | |
| DataMapper::Logger.new($stdout, :debug) | |
| DataMapper.setup(:default, "sqlite3:///#{Dir.pwd}/examine.db") |
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 Table | |
| include DataMapper::Resource | |
| property :id, Serial | |
| property :name, String | |
| # Relationship to the join table. | |
| has n, :tableBookings | |
| # Defines that Table has bookings in :tableBookings on the :booking named relationship. (a) |
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
| #!/usr/bin/env ruby -Ku | |
| # encoding: utf-8 | |
| require 'rubygems' | |
| require 'dm-core' | |
| require 'dm-types' | |
| DataMapper::Logger.new($stdout, :debug) |
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
| #!/usr/bin/env ruby -Ku | |
| # encoding: utf-8 | |
| require 'rubygems' | |
| require 'dm-core' | |
| DataMapper::Logger.new($stdout, :debug) | |
| DataMapper.setup(:default, 'sqlite3::memory:') |
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
| #!/usr/bin/env ruby | |
| # | |
| # A one file test to show ... | |
| require 'rubygems' | |
| require 'dm-core' | |
| # setup the logger | |
| DataMapper::Logger.new(STDOUT, :debug) |