Skip to content

Instantly share code, notes, and snippets.

.widget
.top
.middle
%h3 Comparte esta pagina
.links
%a.facebook{:href=>"#"}
%a.twitter{:href=>"#"}
%a.email{:href=>"#"}
%p.share
.bottom
module Zerg
class Zergling
def attack(victim)
puts "Zerg attacks: Hsssssss"
victim.die if rand(10) > 6
end
def die
puts "Zerg dies: Hiiiisssssshhh Haaaashhppp"
class Admin::PagesController < InheritedResources::Base
layout "admin"
before_filter :authenticate_admin!
def default_path
admin_pages_path
end
def create
module UnsortedList
def sort_ul(list, level = 0)
html = "<ul>"
list.map do |row|
if row[:nivel] =~ /(.*)\..{#{level+1}}/
captured = $1
sequence = list.select {|row| row[:nivel] =~ /^#{captured}\..*$/ }
list -= sequence
html << sort_ul(sequence,level+1)
require 'fbgraph'
client = FBGraph::Client.new(:client_id => 'client_id',:secret_id =>'secret_id')
photos = client.selection.me.photos.until(Time.now.to_s).since(3.days.ago).limit(10).info
client.selection.post('id').comments.params(:message => 'Hola').publish!
@friends = client.selection.me.friends.info!
#original
{% assign page = pages['hi-there'] %}
{% if page %}
<h2>{{ page.title }} </h2>
{{ page.content }}
{% endif %}
#opcion1
# config/initializers/encodings.rb
Encoding.default_internal, Encoding.default_external = ['utf-8'] * 2
class Refrigeradora
def initialize
@comida = []
end
def comida
@comida
end
class Refrigeradora
def initialize
@comida = []
end
def comida
@comida
end
@xenda
xenda / Ruby 1.9.2 patch
Created March 18, 2011 13:11
Patches Ruby 1.9.2 for better GCing
$ curl https://gist.github.com/raw/856296/patch-1.9.2-gc.patch > ~/192-gc.patch
$ rvm uninstall 1.9.2
$ rvm install 1.9.2 --patch ~/192-gc.patch