marc-an-be marc-an-be

View gist:3295747
1 2 3 4 5 6 7 8 9 10
__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
View gist:3295318
1 2 3 4 5 6 7 8 9 10
get '/' do
@events = Event.all(:order => :time.desc)
haml :index
end
 
get '/new/?' do
haml :new
end
 
post '/new/?' do
View gist:3295312
1 2
DataMapper::setup(:default,"sqlite3:pilltracker.db")
DataMapper.finalize.auto_upgrade!
View gist:3295307
1 2 3 4 5 6 7
class Event
include DataMapper::Resource
property :id, Serial
property :time, DateTime
property :type, String
property :description, String
end
View gist:3295296
1 2
#!/usr/bin/env ruby
%w(sinatra sqlite3 dm-sqlite-adapter data_mapper haml time).each{|g| require g}
View test_server.rb
1 2 3 4 5 6 7 8
require 'socket'
server = TCPServer.new('',1234)
loop do
socket = server.accept
while line = socket.gets
puts line
end
end
View quick_start_activity.rb
1 2 3 4 5 6 7 8 9 10
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'
Something went wrong with that request. Please try again.