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
def one_hundred_twenty_eight_spaces | |
" " * 128 | |
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
class Numeric | |
def spaces | |
" " * self | |
end | |
end | |
p 128.spaces |
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
C# version of a class and it's instances (objects) | |
public class Person{ | |
public string Name{get;set;} | |
public string Email{get;set;} | |
public int Age{get;set;} | |
public string Sex{get;set;} | |
} | |
public class Man : Person{ |
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 person = {name:"", email:"", age:0}; | |
var man = {sex:"male"}; | |
var woman = {sex:"female"} | |
woman.__proto__ = man.__proto__ = person; //inheritance. |
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 person(name, email, age){ | |
this.name = name; | |
this.email = email; | |
this.age = age; | |
} | |
leon = new person("Leon", "foo@foo.com", 32); | |
leon.email // foo@foo.com |
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 person = {name:"", email:"", age:0, changeSexTo:function(sex){ | |
this.sex = sex; | |
}}; | |
var man = {sex:"male"}; | |
var woman = {sex:"female"} | |
woman.__proto__ = man.__proto__ = person; |
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 Person(){ | |
this.name = arguments[0] || "name"; | |
this.email = arguments[1] || "foo@foo.com"; | |
} | |
function Man(){ | |
this.sex = "male"; | |
} | |
Man.prototype = new Person(); |
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 Person() { | |
this.name = arguments[0] || "I don't have a name." | |
} | |
Person.prototype.getName = function() { | |
return this.name; | |
} | |
var person = new Person("Sophia"); | |
document.write(person.getName()); |
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
source :gemcutter | |
gem 'rails', '~> 2.3.5', :require => nil | |
gem "rack", "1.0.0" | |
gem "authlogic" | |
gem "jrails" | |
gem "easy_roles" | |
gem "acts-as-taggable-on" | |
gem "rakismet" | |
gem "haml", "2.2.17" |
OlderNewer