This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PUT /admin/variants/#{sku}.json | |
# Request | |
{ | |
"variant": { | |
"sku": "remera-lacoste-verde", | |
"count_on_hand": 27 | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Paginate a collection | |
# | |
# Usage: | |
# | |
# {% paginate contents.projects by 5 %} | |
# {% for project in paginate.collection %} | |
# {{ project.name }} | |
# {% endfor %} | |
# {% endpaginate %} | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bonsai ombu_store$ ping caño.local | |
PING caño.local (127.0.0.1): 56 data bytes | |
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.054 ms | |
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.127 ms | |
^C | |
--- caño.local ping statistics --- | |
2 packets transmitted, 2 packets received, 0.0% packet loss | |
round-trip min/avg/max/stddev = 0.054/0.090/0.127/0.037 ms | |
bonsai ombu_store$ lynx caño.local |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'csv' | |
require 'json' | |
csv =CSV.parse(File.read('lib/data/GeoPC_Regions_ISO3166_2.csv'),{:col_sep => ";"}) | |
JS = [] | |
csv.each do |row| | |
h = {iso: row[0], | |
country: row[1], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'csv' | |
require 'yaml' | |
array = [] | |
i = 0 | |
CSV.foreach 'mentions.csv' do |l| | |
hash = {} | |
hash['url'] = l[2] | |
hash['date'] = l[1] | |
hash["mention_#{i}"] = '' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
STAMP=`date +%Y%m%d%H%M` | |
echo "Iniciando backup @ $STAMP" | |
mkdir -p /var/backups/$STAMP | |
LAST_DIR=`ls /var/backups/inc | sort -n | tail -1` | |
xtrabackup --use-memory=1G --backup --target-dir=/var/backups/inc/$STAMP --incremental-basedir=/var/backups/inc/$LAST_DIR --user=root --password=<root-password> | |
echo "Fin backup @ $STAMP" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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")) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if current_user.is_customer? %} | |
permitir comprar | |
{% else %} | |
registrate, chabón! | |
{% endif %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
q = Sidekiq::Queue.new | |
q.each do |job| | |
# Is this the best way? | |
Object.const_get(job.klass).new.perform *job.args | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"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": " |