Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Working to deliver magic!

Guillermo Siliceo grillermo

💭
Working to deliver magic!
View GitHub Profile
@grillermo
grillermo / logs.rb
Created Aug 31, 2020
stack overflow question 63612987
View logs.rb
Processing by RailsAdmin::MainController#edit as HTML
Parameters: {"_pjax"=>"[data-pjax-container]", "model_name"=>"first_job", "id"=>"252828"}
User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT $2 [["id", 307509], ["LIMIT", 1]]
FirstJob Load (2.3ms) SELECT "first_jobs".* FROM "first_jobs" WHERE "first_jobs"."id" = $1 ORDER BY "first_jobs"."id" ASC LIMIT $2 [["id", 252828], ["LIMIT", 1]]
Rendering /gems/rails_admin-2.0.2/app/views/rails_admin/main/edit.html.haml within layouts/rails_admin/pjax
Company Load (0.7ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = $1 LIMIT $2 [["id", 319315], ["LIMIT", 1]]
(5.1ms) SELECT COUNT(*) FROM "companies"
Rendered /gems/rails_admin-2.0.2/app/views/rails_admin/main/_form_filtering_select.html.haml (12.2ms)
Rendered /gems/rails_admin-2.0.2/app/views/rails_admin/main/_form_field.html.haml (1.6ms)
Rendered /gems/rails_admin-2.0.2/app/views/rails_admin/main/_form_datetime.html.ham
@grillermo
grillermo / company_467_delete_output.rb
Created Jun 29, 2020
output de borrado de compañia 467
View company_467_delete_output.rb
Company Publico created at 2018-02-14 16:43:35 -0600
company offices ["Sede Roma Norte"]
company users ["adriana@publi.co"]
company offices cleaning_subscriptions [#<Office id: 450, company_id: 467, name: "Sede Roma Norte", additional_instructions: nil, created_at: "2018-02-14 22:44:45", updated_at: "2020-05-20 22:19:44", phone: "5541720940", region_id: 1, check_in_code: "http://tandem.aliada.mx/qr/QQX0LqE78_dhf-9Xd8IwSQ", qr_set_up: false, location_id: 649, address_id: 35325, invoice_info_id: nil, odoo_id: nil>]
company offices invoices
found master list with name Anti COVID-19 created at 2020-03-17 21:05:17 -0600
and 0 items
found master list with name Muzquiz created at 2018-02-15 18:19:34 -0600
and 0 items
found master list with name Anti COVID-19 created at 2020-03-17 17:02:13 -0600
@grillermo
grillermo / SLEEP AND ADOLESCENCE
Created Mar 28, 2020
SLEEP AND ADOLESCENCE - Why We Sleep
View SLEEP AND ADOLESCENCE
SLEEP AND ADOLESCENCE
Why do we spend so much time in REM sleep in the womb and early in life, yet switch to a heavier dominance of deep NREM sleep in late childhood and early adolescence? If we quantify the intensity of the deep-sleep brainwaves, we see the very same pattern: a decline in REM-sleep intensity in the first year of life, yet an exponential rise in deep NREM sleep intensity in mid- and late childhood, hitting a peak just before puberty, and then damping back down. What’s so special about this type of deep sleep at this transitional time of life?
Prior to birth, and soon after, the challenge for development was to build and add vast numbers of neural highways and interconnections that become a fledgling brain. As we have discussed, REM sleep plays an essential role in this proliferation process, helping to populate brain neighborhoods with neural connectivity, and then activate those pathways with a healthy dose of informational bandwidth.
But since this first round of brain wiring is purposeful
@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(