Skip to content

Instantly share code, notes, and snippets.

@gonzedge
gonzedge / _orders.html.erb
Created November 10, 2011 16:08
Rails 3.1 - will_paginate and ajax
<ul>
<% @orders.each do |order| %>
<li>
<!-- Show order stuff -->
</li>
<% end %>
</ul>
<%= will_paginate @orders %>
@gonzedge
gonzedge / install.sh
Created November 10, 2011 16:36
Unit testing the jQuery Rambling Slider – Part 2 – The DOM, jQuery and node.js
npm install -g jsdom
npm install -g jquery
@gonzedge
gonzedge / array_extensions.coffee
Created November 10, 2011 18:54
Unit testing the jQuery Rambling Slider – CoffeeScript, Jasmine and node.js
Array::contains = (value) ->
length = @length
for i in [0...length]
return true if value is @[i]
false
@gonzedge
gonzedge / install.sh
Created November 10, 2011 19:22
Installing the capybara-webkit gem
apt-get install libqt4-dev
gem install capybara-webkit
@gonzedge
gonzedge / es.yml
Created November 10, 2011 19:30
Rails 3.1 – Translating routes
es:
resources:
users: 'usuarios'
resource:
contact: 'contacto'
named_routes:
about-us: 'quienes-somos'
routes:
jobs:
as: 'trabajos'
@gonzedge
gonzedge / install.sh
Created November 10, 2011 20:03
The nokogiri gem and the “libxslt is missing” error
apt-get install libxslt1.1 libxslt1-dev libxslt-ruby
@gonzedge
gonzedge / clone.sh
Created November 10, 2011 21:33
Refinery CMS, rails 3.1.1 and the Operation not permitted error Errno::EPERM
git clone git://github.com/resolve/refinerycms.git ~/refinerycms-edge
@gonzedge
gonzedge / install.sh
Created November 11, 2011 01:17
Rails 3.1 “rails console” fails with “no such file to load — readline”
apt-get install libreadline-dev
rvm pkg install readline
rvm remove 1.9.2
rvm install 1.9.2
rvm --default 1.9.2
rvm use 1.9.2
@gonzedge
gonzedge / application_after.rb
Created November 11, 2011 01:32
Rails 3.1 smtp gmail Errno::ECONNREFUSED Connection refused
Demo::Application.configure do
# ...
config.action_mailer.delivery_method :smtp
config.action_mailer.smtp_settings = {
enable_starttls_auto: true,
address: 'smtp.gmail.com',
port: 587,
authentication: 'plain',
user_name: '<email@yourdomain.com>',
password: '<password>'
@gonzedge
gonzedge / content.js.erb
Created November 11, 2011 01:48
Rails 3.1 and the assert_select_jquery
if($('#container').is(':not(:visible)')) $('#container').show('blind', 1000);
$('#container').html('<%= render @content %>');