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
import sbt._ | |
import Keys._ | |
import PlayProject._ | |
/* | |
* This contains a data project with models. It also contains a frontend web | |
* app. Finally, there is a backend project. The backend project is just a copy | |
* of the fronend project for demonstration purposes, but in real life may | |
* contain heavy data batch processing jobs or similar. Both projects rely on | |
* the same database and so must both depend on the data project which contains |
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 'turn/autorun' | |
class AnagramTest < MiniTest::Unit::TestCase | |
def test_simple_match | |
assert 'ABBA'.anagram? 'BABA' | |
end | |
def test_non_match | |
refute 'ABBA'.anagram? 'BAB' | |
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
User.delete_all | |
superman = User.create! name: "Superman", password: "superman" | |
superman.fleet "It's ok to be scared" | |
spiderman = User.create! name: "Spiderman", password: "spiderman" | |
spiderman.fleet "Your friendly neighbourhood spiderman" | |
spiderman.fleet "RT @greengoblin : No matter what you do for them, eventually, they will hate you" | |
terminator = User.create! name: "Terminator", password: "terminator" |
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 id="user_header"> | |
<% if current_user %> | |
Logged in as <%= link_to current_user.name, user_path(current_user) %> | |
<%= link_to "Log out", logout_path %> | |
<% else %> | |
<%= link_to "Sign Up", signup_path %> or | |
<%= link_to "Log In", login_path %> | |
<% end %> | |
</div> | |
<br /> |
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
<h1> Log In</h1> | |
<%= form_tag sessions_path do %> | |
<div class="field"> | |
<%= label_tag :name %> <br /> | |
<%= text_field_tag :name, params[:name] %> | |
</div> | |
<div class="field"> | |
<%= label_tag :password %> <br /> | |
<%= password_field_tag :password, params[:password] %> |
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
ROMAN = [ | |
["M" , 1000], | |
["CM" , 900], | |
["D" , 500], | |
["CD" , 400], | |
["C" , 100], | |
["XC" , 90], | |
["L" , 50], | |
["XL" , 40], | |
["X" , 10], |
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> | |
</html> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Flitter</title> | |
<%= stylesheet_link_tag "application", :media => "all" %> | |
<%= javascript_include_tag "application" %> | |
<%= csrf_meta_tags %> | |
</head> |
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
/* | |
* This is a manifest file that'll be compiled into application.css, which will include all the files | |
* listed below. | |
* | |
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, | |
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. | |
* | |
* You're free to add application-wide styles to this file and they'll appear at the top of the | |
* compiled file, but it's generally better to create a new file per style scope. | |
* |
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
1 : I | |
2 : II | |
3 : III | |
4 : IV | |
5 : V | |
6 : VI | |
7 : VII | |
8 : VIII | |
9 : IX | |
10 : X |
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title><%= content_for?(:title) ? yield(:title) : "Myapp" %></title> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<%= stylesheet_link_tag "application", :media => "all" %> | |
<%= javascript_include_tag "application" %> |
NewerOlder