Skip to content
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 = Sidekiq::Queue.new
q.each do |job|
# Is this the best way?
Object.const_get(job.klass).new.perform *job.args
end
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")) {
View incremental-backups-percona-xtrabackup.sh
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"
View csv-to-yaml.rb
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}"] = ''
View csv2json ruby script
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],
View fucking-enies
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
View liquid will paginate
# Paginate a collection
#
# Usage:
#
# {% paginate contents.projects by 5 %}
# {% for project in paginate.collection %}
# {{ project.name }}
# {% endfor %}
# {% endpaginate %}
#
View ombu-shop-api-variant-update
PUT /admin/variants/#{sku}.json
# Request
{
"variant": {
"sku": "remera-lacoste-verde",
"count_on_hand": 27
}
}
Something went wrong with that request. Please try again.