Skip to content

Instantly share code, notes, and snippets.

View leongersing's full-sized avatar

Leon Gersing leongersing

  • South Florida
View GitHub Profile
def one_hundred_twenty_eight_spaces
" " * 128
end
class Numeric
def spaces
" " * self
end
end
p 128.spaces
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{
var person = {name:"", email:"", age:0};
var man = {sex:"male"};
var woman = {sex:"female"}
woman.__proto__ = man.__proto__ = person; //inheritance.
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
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;
function Person(){
this.name = arguments[0] || "name";
this.email = arguments[1] || "foo@foo.com";
}
function Man(){
this.sex = "male";
}
Man.prototype = new Person();
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());
<html>
<title>this little event model</title>
<body>
<button id="clickr">hello</button>
</body>
</html>
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"