Skip to content

Instantly share code, notes, and snippets.

View gnppro's full-sized avatar
🇲🇽

Gerardo Nava Pereda gnppro

🇲🇽
View GitHub Profile
@gnppro
gnppro / Ubuntu rbenv
Last active October 17, 2020 20:49 — forked from vtsatskin/Ubuntu rbenv
Installing Ruby 1.9.3 with OpenSSL on Ubuntu 11.04 using ruby-build and rbenv
# for more info: https://gist.github.com/1120938
@gnppro
gnppro / steps.md
Created April 17, 2020 05:31 — forked from nicobytes/steps.md
Docker Sawrm
  1. Create machines / nodes
dashboard-prod-m1
dashboard-prod-m2
dashboard-prod-m3
  1. Update machine
@gnppro
gnppro / verify_s3_file.rb
Created April 4, 2019 18:58 — forked from hartfordfive/verify_s3_file.rb
Check if file exists in S3 bucket with Ruby aws-sdk gem
require 'aws-sdk'
s3 = Aws::S3::Resource.new(
region: 'us-east-1',
credentials: Aws::InstanceProfileCredentials.new()
)
bucket = s3.bucket('my-daily-backups')
file = (DateTime.now).strftime("%Y.%m.%d-backup")
if bucket.object(file).exists?
@gnppro
gnppro / RubyUtils.js
Created March 8, 2019 16:03 — forked from borgateo/RubyUtils.js
Ruby's String Utils: center, rjust, ljust in JS
/*
* Ruby's String#center, String#rjust, String#ljust
*
* https://jsfiddle.net/6v0bpffm/
*/
function ljust( string, width, padding ) {
padding = padding || " ";
padding = padding.substr( 0, 1 );
if ( string.length < width )