Skip to content

Instantly share code, notes, and snippets.

💭
Working to deliver magic!

Guillermo Siliceo grillermo

💭
Working to deliver magic!
  • Mexico City
Block or report user

Report or block grillermo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@grillermo
grillermo / fast_experiment.rb
Created Nov 15, 2019 — forked from jonatas/fast_experiment.rb
Try to automated replace create for build_stubbed in specs
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
@grillermo
grillermo / replace.rb
Last active Nov 6, 2019
automatically replace create with build_stubbed in spec suite
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
@grillermo
grillermo / replace.rb
Created Nov 6, 2019
automatically replace create with build_stubbed in spec suite
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"),
@grillermo
grillermo / app assets javascripts rails_admin actions create_aliada_working_hours.js
Created Feb 8, 2018
A complete rails admin custom action, the file of this gist are the paths were you should put your files
@grillermo
grillermo / not_removable_has_many_association.rb
Created Mar 9, 2017
A has many rails admin field with the remove association button gone.
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
@grillermo
grillermo / scrape-facturify-with-artoo.js
Last active Dec 31, 2016
You can't export from all your companies in facturify and you cant scrape in automated fashion due to the captcha so you have to use a browser based scraper such artoo.js
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
You can’t perform that action at this time.