Skip to content
bundle check || bundle install
bundle exec rake db:migrate
bundle exec rails server
View setup.rb
#!/usr/bin/env ruby
require 'pathname'
require 'fileutils'
include FileUtils
# path to your application root.
APP_ROOT = File.expand_path('../../', __FILE__)
chdir APP_ROOT do
# This script is a starting point to setup your application.
View index.liquid.html
<!-- index.liquid -->
{% if products.size > 0 %}
{% if keywords != nil %}
<h3 class="search-results-title">Resultados para: <span class="search-results-keywords">{{ keywords }}</span></h3>
{% if keywords contains "Camisa" or keywords contains "Camisas" %}
<span class="atencion">¡SÓLO ESTA SEMANA! Todas las camisas tienen descuento de 20% con el código CAMISOLA</span>
{% endif %}
{% endif %}
View show.liquid.html
<!-- show.liquid -->
<div id="cart-form">
{% if product | has_category: 'Envío Gratis' %}
<h1 class="jumbo">{{ }}</h1>
{% else %}
<h1>{{ }}</h1>
{% endif %}
<p class="prices">
<span class="price selling">{{ product.price_with_currency }}</span>
View show.liquid.html
<!-- dentro de show.liquid -->
<div id="main-image">
<!-- cloud-zoom -->
<div id="wrap" style="top:0px;z-index:9999;position:relative;">
<a href="{{ product.featured_image | image_size: 'original' }}" class="cloud-zoom" id="zoom1" rel="adjustX:19, adjustY:0, softFocus:false, position:'right', showTitle:false" style="position: relative; display: block; ">
<img src="{{ product.featured_image | image_size: 'large' }}" alt="{{ product.featured_image.alt }}" align="left" title="{{ product.featured_image.alt | capitalize }}" style="display: block; " />
<div class="mousetrap" style="background-image:url(&quot;.&quot;);z-index:999;position:absolute;left:0px;top:0px;">
View benchmark-hash-default.rb
# Code
def do_benchmark
n = 5000 do |x| "|| approach" do
n.times do
{}[:a] || :b
View first-phase-world-cup-games.json
[{"group": "A", "number": "1", "time": "Thu Jun/12/14 17:00","local": "Brazil", "visitor": "Croatia", "city": "Arena de São Paulo, São Paulo", "timezone": "UTC-3"},
{"group": "A", "number": "2", "time": "Fri Jun/13/14 13:00","local": "Mexico", "visitor": "Cameroon", "city": "Estádio das Dunas, Natal", "timezone": "UTC-3"},
{"group": "A", "number": "17", "time": "Tue Jun/17/14 16:00","local": "Brazil", "visitor": "Mexico", "city": "Estádio Castelão, Fortaleza", "timezone": "UTC-3"},
{"group": "A", "number": "18", "time": "Wed Jun/18/14 18:00","local": "Cameroon", "visitor": "Croatia", "city": "Arena Amazônia, Manaus", "timezone": "UTC-4"},
{"group": "A", "number": "33", "time": "Mon Jun/23/14 17:00","local": "Cameroon", "visitor": "Brazil", "city": "Brasília", "timezone": "UTC-3"},
{"group": "A", "number": "34", "time": "Mon Jun/23/14 17:00","local": "Croatia", "visitor": "Mexico", "city": "Recife", "timezone": "UTC-3"},
{"group": "B", "number": "3", "time": "Fri Jun/13/14 16:00","local": "Spain", "visitor": "
View process-all-jobs-in-sidekiq-queues.rb
q =
q.each do |job|
# Is this the best way?
Object.const_get(job.klass).new.perform *job.args
View register_first_buy_later.liquid
{% if current_user.is_customer? %}
permitir comprar
{% else %}
registrate, chabón!
{% endif %}
View changed-attributes-nonsense-backbone-js
Order = Backbone.Model.extend({
initialize: function() {
this.bind("change:shipping_method_id", this.persist);
// If the Order is valid, it tries to persist it.
persist: function(model, name) {
if (this.vanillaValid("#checkout_form_confirm")) {
Something went wrong with that request. Please try again.