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
require 'haml' | |
get '/' do | |
haml :index | |
end |
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 User < ActiveRecord::Base | |
end |
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
get '/' do | |
@users = User.all | |
erb :index | |
end |
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
<ul> | |
<% for user in @users %> | |
<li><%= user.id.to_s + ': ' + user.name + ' <'+ user.email + '>' %></li> | |
<% end %> | |
</ul> |
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
function point() { | |
var p = {}; | |
p.position = 0; | |
p.move = function (pixels) { | |
p.position += pixels; | |
}; | |
p.up = function () { p.move(10); }; | |
p.down = function () { p.move(-10); }; | |
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
function point() { | |
var a = {}; | |
return a.position = 0, a.move = function(b) { | |
a.position += b; | |
}, a.up = function() { | |
a.move(10); | |
}, a.down = function() { | |
a.move(-10); | |
}, 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
function point() { | |
var p = {}; | |
p.position = 0; | |
function move (pixels) { | |
p.position += pixels; | |
}; | |
p.up = function () { p.move(10); }; | |
p.down = function () { p.move(-10); }; | |
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
function point() { | |
function b(b) { | |
a.position += b; | |
} | |
var a = {}; | |
return a.position = 0, a.up = function() { | |
a.move(10); | |
}, a.down = function() { | |
a.move(-10); | |
}, 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
function logStyles() { | |
var doc_style = document.body.style; | |
console.log(doc_style.border, | |
doc_style.margin, | |
doc_style.padding); | |
} |
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
function logStyles() { | |
var a = document.body.style; | |
console.log(a.border, a.margin, a.padding); | |
}; |