<?xml version="1.0" encoding="UTF-8"?>
<codes type="array">
  <code>
    <code>gem install i18n tzinfo builder memcache-client rack rack-test rack-mount erubis mail text-format thor bundler

gem install rails --pre</code>
    <created-at type="datetime">2010-02-20T16:31:50Z</created-at>
    <description></description>
    <id type="integer">211</id>
    <language-id type="integer">42</language-id>
    <privated type="boolean">false</privated>
    <title>rails 3 two lines install </title>
    <updated-at type="datetime">2010-02-20T16:31:50Z</updated-at>
    <user-id type="integer">7</user-id>
  </code>
  <code>
    <code>$('a.popup').live('click', function(){
	newwindow=window.open($(this).attr('href'),'','height=200,width=150');
	if (window.focus) {newwindow.focus()}
	return false;
});</code>
    <created-at type="datetime">2009-12-16T00:12:50Z</created-at>
    <description></description>
    <id type="integer">210</id>
    <language-id type="integer">19</language-id>
    <privated type="boolean">false</privated>
    <title>clean way to open a popup window</title>
    <updated-at type="datetime">2009-12-16T00:12:50Z</updated-at>
    <user-id type="integer">7</user-id>
  </code>
  <code>
    <code>$('h1') // elementos h1
$('#meuID') // elementos com id &quot;meuID&quot;
$('.minhaClasse') // elementos definidos com a classe &quot;minhaClasse&quot;
$('[width]') // elementos que possuem o atributo width definido
$('[width=500]') // elementos que possuem o atributo width definido como 500
$('img[width=300]') // imagens que possuem largura = 300
$('img[src$=png]') // imagens com final png
$('a[href^=http://localhost]') // links que comecem com http://localhost
$('a[href$=pdf]') // links com final pdf
$('a[href*=www]') // links que cont&#233;m www
$(':empty') // elementos vazio
$('div:empty') // elementos div vazios
$(':has(p)') // todos elementos que tenham um par&#225;grafo
$('div:has(a)'); // elementos div que possuem link
$(&quot;p:contains('dinei')&quot;) // par&#225;grafos que cont&#233;m a palavra &quot;dinei&quot;
$(&quot;p:eq(0)&quot;) // seleciona o primeiro elemento p</code>
    <created-at type="datetime">2009-11-25T22:45:07Z</created-at>
    <description>http://docs.jQuery.com/DOM/Traversing/Selectors</description>
    <id type="integer">207</id>
    <language-id type="integer">19</language-id>
    <privated type="boolean">false</privated>
    <title>seletores do jquery</title>
    <updated-at type="datetime">2009-11-25T22:45:07Z</updated-at>
    <user-id type="integer">7</user-id>
  </code>
  <code>
    <code>module ActionView 
  module Helpers 
    class InstanceTag 
      def to_label_tag_with_i18n(text = nil, options = {}) 
        text ||= object.class.human_attribute_name(method_name) if object.class.respond_to?(:human_attribute_name) 
 
        to_label_tag_without_i18n(text, options) 
      end 
 
      alias_method_chain :to_label_tag, :i18n 
    end 
  end 
end</code>
    <created-at type="datetime">2009-11-22T19:42:31Z</created-at>
    <description>rails 2.3.4 doen't have i18n support in labels  
http://lawrencesong.net/2009/04/i18n-label-in-rails-monkey-patch/</description>
    <id type="integer">206</id>
    <language-id type="integer">39</language-id>
    <privated type="boolean">false</privated>
    <title>i18n in labels</title>
    <updated-at type="datetime">2009-11-22T19:42:31Z</updated-at>
    <user-id type="integer">7</user-id>
  </code>
  <code>
    <code>rake paperclip:refresh class=MyClass</code>
    <created-at type="datetime">2009-10-26T14:50:39Z</created-at>
    <description>run this task</description>
    <id type="integer">205</id>
    <language-id type="integer">42</language-id>
    <privated type="boolean">false</privated>
    <title>paperclip refresh all images</title>
    <updated-at type="datetime">2009-10-26T14:50:39Z</updated-at>
    <user-id type="integer">7</user-id>
  </code>
  <code>
    <code>class MyModel &lt; ActiveRecord::Base
  default_scope :order =&gt; 'created_at desc'
end</code>
    <created-at type="datetime">2009-10-04T16:55:05Z</created-at>
    <description></description>
    <id type="integer">204</id>
    <language-id type="integer">39</language-id>
    <privated type="boolean">false</privated>
    <title>use default_scope to set up default find conditions such as order</title>
    <updated-at type="datetime">2009-10-04T16:55:05Z</updated-at>
    <user-id type="integer">7</user-id>
  </code>
  <code>
    <code>class User &lt; ActiveRecord::Base

  HUMANIZED_ATTRIBUTES = {
    :email =&gt; &quot;E-mail address&quot;
  }

  def self.human_attribute_name(attr)
    HUMANIZED_ATTRIBUTES[attr.to_sym] || super
  end

end</code>
    <created-at type="datetime">2009-08-22T17:00:45Z</created-at>
    <description></description>
    <id type="integer">202</id>
    <language-id type="integer">39</language-id>
    <privated type="boolean">false</privated>
    <title>humanized attributes</title>
    <updated-at type="datetime">2009-08-22T17:00:45Z</updated-at>
    <user-id type="integer">7</user-id>
  </code>
  <code>
    <code>function copyToClipBoard(id) {
    Copied = document.getElementById('id').innerText.createTextRange();
    Copied.execCommand(&quot;Copy&quot;);
}</code>
    <created-at type="datetime">2009-08-22T15:59:21Z</created-at>
    <description></description>
    <id type="integer">201</id>
    <language-id type="integer">19</language-id>
    <privated type="boolean">false</privated>
    <title>copy to clipboard</title>
    <updated-at type="datetime">2009-08-22T15:59:21Z</updated-at>
    <user-id type="integer">7</user-id>
  </code>
  <code>
    <code>&lt;a href=&quot;#top&quot; onclick=&quot;$('html, body').animate({scrollTop:0}, 'slow'); return false;&quot;&gt;top&lt;/a&gt;</code>
    <created-at type="datetime">2009-08-22T15:57:58Z</created-at>
    <description></description>
    <id type="integer">200</id>
    <language-id type="integer">16</language-id>
    <privated type="boolean">false</privated>
    <title>back to top</title>
    <updated-at type="datetime">2009-08-22T15:57:58Z</updated-at>
    <user-id type="integer">7</user-id>
  </code>
  <code>
    <code>   function popup(url) {
        newWindow = window.open(url, 'name', 'height=400,width=335,scrollbars=yes');
        if (window.focus) { newWindow.focus() }
            return false;
    }

// &lt;a href=&quot;link.html&quot; onclick=&quot;popup('link.html');&quot;&gt;Link&lt;/a&gt;</code>
    <created-at type="datetime">2009-08-22T15:40:47Z</created-at>
    <description>http://www.quirksmode.org/js/popup.html</description>
    <id type="integer">199</id>
    <language-id type="integer">19</language-id>
    <privated type="boolean">false</privated>
    <title>unobstrusive popup</title>
    <updated-at type="datetime">2009-08-22T15:40:47Z</updated-at>
    <user-id type="integer">7</user-id>
  </code>
</codes>
