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="#rooms"> | |
<div id="room_1">Room 1</div> | |
<div id="room_2">Room 2</div> | |
</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
Room.prototype.roomText = function() { | |
return this.element.find("p").text(); | |
}; |
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
Room.count = function() { | |
return $(".room").length; | |
} |
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
// public properties | |
this.element = $("#" + elementId); | |
this.tooltip = this.element.find(".tooltip"); | |
// Any function calls in here will be executed when a room object is instantiated | |
this.initalizeTooltip(); |
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
function Room(elementId) { |
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
var Room = function (elementId) { |
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
Var Room = function (elementId) { | |
// public properties | |
this.element = $("#" + elementId); | |
this.tooltip = this.element.find(".tooltip"); | |
// Any function calls in here will be executed when a room object is instantiated | |
this.initalizeTooltip(); | |
} | |
// Here we are defining a class method that can be called like this: Room.count(); |
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
git clone http://github.com/ry/node.git | |
cd node | |
./configure | |
make | |
sudo make install |
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
var fs = require('fs'); | |
fs.readFile('./readme.txt', function (err, data) { | |
if (err) throw err; | |
console.log(data); | |
}); |
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
if [[ -n "$rvm_environments_path" && -s "$rvm_environments_path/ruby-1.8.7-p302@bugmasher" ]] ; then | |
. "$rvm_environments_path/ruby-1.8.7-p302@bugmasher" | |
else | |
rvm --create use "ruby-1.8.7-p302@bugmasher" | |
fi |