This file contains 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
__END__ | |
@@ layout | |
!!! 5 | |
%html{:lang => 'en'} | |
%head | |
%meta{:charset => 'utf-8'} | |
%meta{:name => 'viewport', :content => 'width=device-width, initial-scale=1'} | |
%meta{:name => 'format-detection', :content => 'telephone=no'} | |
%title PillTracker |
This file contains 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 '/' do | |
@events = Event.all(:order => :time.desc) | |
haml :index | |
end | |
get '/new/?' do | |
haml :new | |
end | |
post '/new/?' do |
This file contains 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
DataMapper::setup(:default,"sqlite3:pilltracker.db") | |
DataMapper.finalize.auto_upgrade! |
This file contains 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 Event | |
include DataMapper::Resource | |
property :id, Serial | |
property :time, DateTime | |
property :type, String | |
property :description, String | |
end |
This file contains 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 | |
%w(sinatra sqlite3 dm-sqlite-adapter data_mapper haml time).each{|g| require g} |
This file contains 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 'socket' | |
server = TCPServer.new('',1234) | |
loop do | |
socket = server.accept | |
while line = socket.gets | |
puts line | |
end | |
end |
This file contains 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 'ruboto/activity' | |
require 'ruboto/widget' | |
require 'ruboto/util/toast' | |
require 'socket' | |
ruboto_import_widgets :Button, :LinearLayout, :EditText | |
$activity.start_ruboto_activity "$sample_activity" do | |
setTitle 'Funky TestApp' |