View more - Model self-reference using Mongoid ORM
Posted by layonman98 on Sun Dec 05 03:36:35 UTC 2010. Language ruby

class User

  include Mongoid::Document
  identity :type => String
  field :name
  references_many :fans, :stored_as => :array, :class_name => 'User'

end

# Examples
        

View more -
Posted by callo90 on Thu Aug 05 20:34:24 UTC 2010. Language ruby

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
<link href="screen.css" rel="stylesheet" type="text/css" media="screen" />
  </head>
  <body>
    <div id="wrapper">
      <p>
        <span><input type="submit" name="Submit" value="" /></span>
      </p>
        

View more - simple map/reduce concept
Posted by krawek on Thu Mar 25 22:16:46 UTC 2010. Language ruby

[1,2,3,4].reduce { |v, a| a+=v }
        

View more - metodos publicos de un objeto js
Posted by kuadrosxx on Fri Feb 26 18:46:56 UTC 2010. Language ruby

for (property in object) { console.log(property) }