Skip to content

Instantly share code, notes, and snippets.

View josedulanto's full-sized avatar
🏠
Working from home

José Dulanto josedulanto

🏠
Working from home
View GitHub Profile
@josedulanto
josedulanto / routes.rb
Created June 18, 2020 15:01
Adds Sidekiq web admin to Rails API only with basic auth and custom URL
# Adds Sidekiq web admin to Rails API only with basic auth and custom URL
Sidekiq::Web.use(Rack::Auth::Basic) do |username, password|
username == Rails.application.credentials[Rails.env.to_sym][:sidekiqweb][:username] &&
password == Rails.application.credentials[Rails.env.to_sym][:sidekiqweb][:password]
end
mount(Sidekiq::Web => "/#{Time.now.strftime("%Y%m%d")}sidekiqadmin")
@josedulanto
josedulanto / closures.rb
Created April 15, 2020 18:20
Ruby Closures
# CLOSURES IN RUBY Paul Cantrell https://innig.net
# Email: username "paul", domain name "innig.net"
# I recommend executing this file, then reading it alongside its output.
#
# Alteratively, you can give yourself an unreasonable Ruby test by deleting all
# the comments, then trying to guess the output of the code!
#
# (Naive HR departments, please do not use that idea as a hiring quiz.)
┌[vagrant@amex]─[~/.linuxbrew]─[]
└[$]› brew install openssl
==> Downloading https://www.openssl.org/source/openssl-1.0.2d.tar.gz
Already downloaded: /home/vagrant/.cache/Homebrew/openssl-1.0.2d.tar.gz
==> perl ./Configure --prefix=/home/vagrant/.linuxbrew/Cellar/openssl/1.0.2d_1 --openssldir=/home/vagrant/.linuxbrew/etc/openssl no-ssl2 zlib-dynamic shared enable-cms linux-x86_64
==> make depend
==> make
Last 15 lines from /home/vagrant/.cache/Homebrew/Logs/openssl/03.make:
Thu Nov 12 16:11:30 -0600 2015
@josedulanto
josedulanto / Move a git repo with all its branches
Created September 28, 2015 21:53
The easiest way to move a repo from one place to another including all branches ;)
# Do the usual clone of a repository
git clone <repo>
# Create local branches from remote and track them
for remote in `git branch -r | grep -v /HEAD`; do git checkout --track $remote ; done
# Set the new repo
git remote set-url origin <new-repo>
# Push everything to the new repo
@josedulanto
josedulanto / keybase.md
Created February 24, 2015 22:36
Keybase.io Identity

Keybase proof

I hereby claim:

  • I am josedulanto on github.
  • I am josedulanto (https://keybase.io/josedulanto) on keybase.
  • I have a public key whose fingerprint is 68E7 4741 85D8 AD98 E25C 7DB5 8BEE C19E 9E48 8C39

To claim this, I am signing this object: