Skip to content

Instantly share code, notes, and snippets.

View nelyj's full-sized avatar
👁️
25/8

Nelson Jiménez nelyj

👁️
25/8
View GitHub Profile
@nelyj
nelyj / clear-sidekiq-jobs.sh
Created August 19, 2021 21:14 — forked from wbotelhos/clear-sidekiq-jobs.sh
Clear Sidekiq Jobs
require 'sidekiq/api'
# 1. Clear retry set
Sidekiq::RetrySet.new.clear
# 2. Clear scheduled jobs
Sidekiq::ScheduledSet.new.clear
default: "%-d/%-m/%Y"
long: "%-d de %B de %Y"
short: "%-d de %B de %Y"
Resultado mandatos PAC - Carga del {day} de {month}
Estimados,
Adjunto resumen de carga PAC {day} de {month},
De un total de {total_installments_amount} cuotas a cobrar, se recaudaron un total de {paid_installment_amount} por un monto de {paid_amount} pesos.
(Equivalente a un {successful_percent}%)
Por otro lado tenemos un rechazo del {failure_percent_estado}% por cuotas cargadas a cuentas del banco estado (SS)
https://taylorpearson.me/luck/
https://taylorpearson.me/luck/
@nelyj
nelyj / orders_controller_spec.rb
Created August 22, 2019 07:08 — forked from chsh/orders_controller_spec.rb
RSpec controller example
require 'spec_helper'
# This spec was generated by rspec-rails when you ran the scaffold generator.
# It demonstrates how one might use RSpec to specify the controller code that
# was generated by Rails when you ran the scaffold generator.
#
# It assumes that the implementation code is generated by the rails scaffold
# generator. If you are using any extension libraries to generate different
# controller code, this generated spec may or may not pass.
#
@nelyj
nelyj / ssl_puma.sh
Created April 23, 2019 04:32 — forked from nathancolgate/ssl_puma.sh
localhost SSL with puma
# 1) Create your private key
$ cd ~/.ssh
$ openssl genrsa -des3 -passout pass:x -out lvh.me.pass.key 2048
# 2) Generate RSA key
$ openssl rsa -passin pass:x -in lvh.me.pass.key -out lvh.me.key
# 3) Get rid of private key
$ rm lvh.me.pass.key
@nelyj
nelyj / tmux.md
Created October 18, 2018 01:40 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@nelyj
nelyj / notes.md
Created September 8, 2018 23:15 — forked from michaelminter/notes.md
FIXME, TODO, and OPTIMIZE code comments

You can add some special notes to your source code comments in Rails to remind you later of stuff you need to do:

class Article < ActiveRecord::Base
  # TODO add named_scopes
  # FIXME method A is broken
  # OPTIMIZE improve the code 

  has_many :comments
  ....

end

@nelyj
nelyj / folio_scrapping.rb
Last active December 31, 2017 02:08
SII scrapping to get folios
#mi github: https://github.com/nelyj
require 'uri'
require 'net/http'
url = "https://maullin.sii.cl/cvc_cgi/dte/of_solicita_folios"
headers = { "User-Agent" => "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.472.63 Safari/534.3",
"Referer" => "https://hercules.sii.cl/cgi_AUT2000/autInicio.cgi?referencia=https://maullin.sii.cl/cvc_cgi/dte/of_solicita_folios",
"Content-Type" => "application/x-www-form-urlencoded" }
uri = URI.parse(url)