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 Vampire { | |
constructor(name, yearConverted) { | |
this.name = name; | |
this.yearConverted = yearConverted; | |
this.offspring = []; | |
this.creator = null; | |
} | |
/** Simple tree methods **/ |
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
module GameConstants | |
MAX_LIVES = 2 | |
end | |
class Game | |
include GameConstants | |
attr_reader :title, :player1, :player2, :current_player | |
attr_accessor :game_over | |
def initialize(title, player1, player2) |
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 'active_support/all' | |
@candidates = [ | |
{ | |
id: 5, | |
years_of_experience: 4, | |
github_points: 293, | |
languages: ['C', 'Ruby', 'Python', 'Clojure'], | |
date_applied: 5.days.ago.to_date, | |
age: 26 |
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
def benchmark(&block) | |
start_time = Time.now | |
block.call | |
end_time = Time.now | |
return end_time - start_time | |
end | |
long_string = "apple" * 100000000 |