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
# sinatra01.rb | |
require 'sinatra' | |
get '/' do | |
"Welcome from RubyLearning!" | |
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
# sinatragplus.rb | |
require 'sinatra' | |
get '/' do | |
"Coming soon..." | |
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
get '/' do | |
erb :index | |
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
<html> | |
<head>..</head> | |
<body> | |
<%= yield %> | |
</body> | |
</html> |
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
<div> | |
<h1>A Sinatra app to access Google+</h1> | |
<p>I'm sorry but the "The Sinatra app to access Google+" Web Service is not accessible from the folder you typed in.</p> | |
<p>The correct URL is: <a href="http://sinatragplus.heroku.com/">http://sinatragplus.heroku.com/</a></p> | |
<p><a href="/">Back</a></p> | |
</div> | |
<div id="footer"> | |
<p><b>A Fun Sinatra App for Google+ by RubyLearning 20 Sept. 2011</b>.</p> | |
</div> |
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
body | |
{ | |
line-height: 1.6em; | |
} | |
h1 { | |
color: #2A1959; | |
border-bottom: 2px solid #2A1959; | |
} |
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 GradeService | |
def initialize(url) | |
@url = url | |
end | |
def submit(answer) | |
# do web request here | |
end | |
def status |
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 Display < MotorCycle | |
def dispAttr | |
'Color of MotorCycle is ' + @color | |
'Make of MotorCycle is ' + @make | |
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
# encoding: utf-8 | |
# λ is the Greek character Lambda here | |
puts "λ".length # => 1 | |
puts "λ".bytesize # => 2 | |
puts "λ".encoding # => UTF-8 | |
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
package java.blah; | |
import java.blah.blahdy.BlahBlah; | |
/** | |
* Class description goes here. | |
* | |
* @version 1.10 27 Sept 2011 | |
* @author Firstname Lastname | |
*/ |
OlderNewer