View fast_experiment.rb
require 'rubygems' | |
require 'fast' | |
def nice_experiment_with(file) | |
parts = file.split('/') | |
dir = parts[0..-2] | |
filename = "experiment_#{parts[-1]}" | |
File.join(*dir, filename) | |
end |
View replace.rb
# This file will look on each line on each _spec file on your suite, replace the create with a build_stubbed, | |
# run that test and if it succededs the change stays if it fails it undos the replace and tries on the next file. | |
require 'find' | |
require 'tempfile' | |
require_relative 'config/environment.rb' | |
class Runner | |
def initialize(specs_path) | |
@specs_path = specs_path |
View replace.rb
# This file will look on each line on each _spec file on your suite, replace the create with a build_stubbed, | |
# run that test and if it succededs the change stays if it fails it undos the replace and tries on the next file. | |
require 'find' | |
require 'tempfile' | |
require_relative 'config/environment.rb' | |
class Runner | |
def initialize(specs_path) | |
@specs_path = specs_path |
View app views rails_admin main _array_form.html.haml
:ruby | |
js_data = { | |
xhr: false, | |
sortable: false, | |
removable: true, | |
cacheAll: false, | |
regional: { | |
chooseAll: t("admin.misc.chose_all"), | |
clearAll: t("admin.misc.clear_all"), | |
search: t("admin.misc.search"), |
View not_removable_has_many_association.rb
require 'rails_admin/config/fields/association' | |
module RailsAdmin | |
module Config | |
module Fields | |
module Types | |
class NotRemovableHasManyAssociation < RailsAdmin::Config:: | |
Fields:: | |
Types:: | |
HasManyAssociation |
View scrape-facturify-with-artoo.js
aliadas_urls = [ | |
{ | |
url: 'https://client.facturify.com/models/multiempresa.php?type=defecto&id=12', | |
data: { | |
multi: 288, // ID of the company | |
}, | |
}, | |
] | |
artoo.ajaxSpider( |
View gist:40361797b7a9e17c6940
{ | |
"username": "paulina@aliada.mx", | |
"password": "Facturify2016%", | |
"json": { | |
"emisor": { | |
"rfc": "AUDG920525111", | |
"receptor": { | |
"tipo_persona": "Persona Moral", | |
"rfc": "AEM130927BD7", | |
"RazonSocial": "APC EGS MX SA DE CV", |
View .vimrc
"Author: Guillermo Siliceo Trueba | |
" | |
" Add the virtualenv's site-packages to vim path | |
py << EOF | |
import os.path | |
import sys | |
import vim | |
if 'VIRTUAL_ENV' in os.environ: | |
project_base_dir = os.environ['VIRTUAL_ENV'] |
View parsing-conekta-webhook.rb
def self.create_from_webhook_notification(params) | |
data = params['data'] | |
object = data['object'] | |
payment_data = object['payment_method'] | |
order_receipt = object['reference_id'] | |
# Parse | |
payment_method = payment_data['object'] | |
fee = object['fee'].to_f |
NewerOlder