Skip to content

Instantly share code, notes, and snippets.

@LucasPadovan
LucasPadovan / env.sfc.bak
Created March 11, 2022 18:23
Env file SFC
NODE_ENV="development"
SENTRY_DSN="https://6c747db5b08e4cc9bb9bf80ea76ad807@o417197.ingest.sentry.io/5773813"
EMAIL_SERVICE_URL=""
PAYPAL_CLIENT_ID=""
PAYPAL_CLIENT_SECRET=""
UNBXD_SITE_ID="dev-shoesforcrews-com812371608054982"
UNBXD_API_KEY="8cc4cb455045d0b216c1dd3144d8a81c"
#AVA_TAX_AUTH=MjAwMDE2OTYzMjo2NzA3NzEzMTk5QkIyMDQ5
#UNBXD_MS_ENDPOINT="https://products.dev.sfc.merce.io"
@LucasPadovan
LucasPadovan / adjustToCenter.js
Created September 5, 2018 15:51
adjust array to center
console.clear();
const uno = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'];
let activeIndex = 1;
const visibleElements = 5;
const centerElement = parseInt(visibleElements / 2, 0);
const dos = uno.map((item, index) => {
let adjustedIndex = index + 2 + activeIndex;
let level = 3;
@LucasPadovan
LucasPadovan / LRShift.js
Created September 4, 2018 14:51
Shift an array left and right
let items = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l'];
function shift({array, direction, amount}) {
let arr = array.slice(0);
let times = amount > arr.length ? amount % arr.length : amount;
let result = arr;
let modifier = direction === 'left' ? arr.length - times : times;
result = arr.concat(arr.splice(0, modifier));
@LucasPadovan
LucasPadovan / autostart_ssh_agent
Created April 21, 2015 00:58
Autostart code for ssh agent in windwos
# Note: ~/.ssh/environment should not be used, as it
# already has a different purpose in SSH.
env=~/.ssh/agent.env
# Note: Don't bother checking SSH_AGENT_PID. It's not used
# by SSH itself, and it might even be incorrect
# (for example, when using agent-forwarding over SSH).
agent_is_running() {
@LucasPadovan
LucasPadovan / delete_sidekiq_works.rb
Created August 19, 2014 15:20
Call this multiple times to delete the stack of the worker
q = Sidekiq::Queue.new('worker_name')
q.each do |j|
j.delete
end
@LucasPadovan
LucasPadovan / Clean pay reports
Created January 13, 2014 14:33
Clean payment reports and coupon payments
payment_reports = PaymentReport.where(medium: 'PagoFacil')
payments = Payment.where(payment_report_id: payment_reports.map(&:id))
payments.update_all(payment_report_id: nil)
payment_reports.destroy_all
Zendesk_api gem version 1.1.1
###########################################################################################################################
Using ruby 1.9.2 -p125 with /api/v2 part.
[1] pry(main)> class CustomerService
[1] pry(main)* require 'zendesk_api'
[1] pry(main)*
[1] pry(main)* class << self
@LucasPadovan
LucasPadovan / Log_firehouse_con_truck_presence
Created October 27, 2013 04:04
Log test unitarios sin comentar lina de validacion de truck_presence de endowment
/home/lockon/.rbenv/versions/1.9.3-p327/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) -Itest /home/lockon/Programas/RubyMine-5.4/rb/testing/runner/tunit_or_minitest_in_folder_runner.rb
Testing started at 01:01 ...
Work directory: /home/lockon/workspace/firehouse
Loading files....
=========================================
1. /home/lockon/workspace/firehouse/test/unit/intervention_test.rb:1
2. /home/lockon/workspace/firehouse/test/unit/endowment_test.rb:1
3. /home/lockon/workspace/firehouse/test/unit/firefighter_test.rb:1
4. /home/lockon/workspace/firehouse/test/unit/mobile_intervention_test.rb:1
5. /home/lockon/workspace/firehouse/test/unit/user_test.rb:1
@LucasPadovan
LucasPadovan / firehouse_unit_test
Created October 27, 2013 03:58
Test unitarios firehouse
Este es el log de los test unitarios COMENTANDO la validación del truck_number de los endowments.
Fallan 3 creo, intervention, endowment y endowment_line. Ni idea para que es el Version.count que aparece en los test unitarios autogenerados.
/home/lockon/.rbenv/versions/1.9.3-p327/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) -Itest /home/lockon/Programas/RubyMine-5.4/rb/testing/runner/tunit_or_minitest_in_folder_runner.rb
Testing started at 00:54 ...
Work directory: /home/lockon/workspace/firehouse
Loading files....
=========================================
1. /home/lockon/workspace/firehouse/test/unit/intervention_test.rb:1
2. /home/lockon/workspace/firehouse/test/unit/endowment_test.rb:1
@LucasPadovan
LucasPadovan / srbuj error
Created October 5, 2013 05:18
Srbuj I18n error
##es.application.yml
...
correctly_created: 'Tipo de intervención agregado correctamente.'
...
##inter_types_controller.rb
js_notify( message: t('view.intervention_types.correctly_created'), type: 'alert-success js-notify-18px-text', time: 2500 )
##html generado
### Chrome Ubuntu - Sin problemas