Skip to content

Instantly share code, notes, and snippets.

Alejandro E. Babio alejandrobabio

Block or report user

Report or block alejandrobabio

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
alejandrobabio /
Created Mar 22, 2019 — forked from erickpatrick/
Install Vim 8 with Python, Python 3, Ruby (2.5) and Lua support on Ubuntu
# remove current vim
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-gui-common
# removes current link for vim
sudo rm -rf /usr/local/share/vim /usr/bin/vim
# add ppa for newest version of ruby (currently, as of 06/06/2017, ruby v2.4)
sudo apt-add-repository ppa:brightbox/ruby-ng
sudo apt-get update

Keybase proof

I hereby claim:

  • I am alejandrobabio on github.
  • I am alejandrobabio ( on keybase.
  • I have a public key whose fingerprint is 98F7 03BC F3B8 EF14 3C60 F3D7 E618 5CEC C03F FA24

To claim this, I am signing this object:

alejandrobabio /
Created Dec 15, 2017 — forked from PurpleBooth/
A template to make good

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.


alejandrobabio / gist:4578ed310cb4a16cea7902f8f454a99e
Last active Dec 11, 2017
Using flat_map to flatten a nested array
View gist:4578ed310cb4a16cea7902f8f454a99e
flat = (l = ->(x) { x.flat_map {|e| Array === e ? l.(e) : e } })
flat.([1, 2, 3, [4, 5, [6], [ ] ] ])
#==> [1,2,3,4,5,6]
alejandrobabio / application.html.slim
Last active Dec 8, 2017
dry-web-roda & sprockets
View application.html.slim
doctype html
link rel="stylesheet" href=asset("application.css")
script rel="javascript" type="text/javascript" src=asset("ng_application.js")
== yield
alejandrobabio / symbolize.rb
Created Nov 29, 2017
Recursive lambda that symbolize keys of a Hash
View symbolize.rb
Symbolize = (l = ->(h) { h.inject({}) { |m, (k,v)| m[(String === k ? k.to_sym : k)] = (Hash === v ? l.(v) : v); m }})
# Example:
hash = { 'task' => { 'description' => 'Ab@ @example @cd', 'target' => { 'label' => 'cd' } } }
# => { :task => { :description => "Ab@ @example @cd", :target => { :label => "cd" } } }
View Deploying Sharetribe to

Deploying to Heroku

  1. Deploy the app to heroku following heroku normal instructions (add link to heroku help)

  2. Set heroku environment variables

    Make sure all the options in config.yml are properly set then run:

     bundle exec rake heroku:config
alejandrobabio / hn_seach.js
Created Aug 17, 2016 — forked from kristopolous/hn_seach.js
hn job query search
View hn_seach.js
function query() {
// HN is done with very unsemantic classes.
job_list ='.c5a,.cae,.c00,.c9c,.cdd,.c73,.c88')),
query_list =,
shown = 0, total = job_list.length;
// Traverses up the dom stack trying to find a match of a specific class
function up_to(node, klass) {
if (node.classList.contains(klass)) {
alejandrobabio / fixtures.rake
Created Jun 23, 2016 — forked from ZachBeta/fixtures.rake
Rake task to create fixtures from test database in Rails 3.1
View fixtures.rake
#put in lib/tasks/fixtures.rake
namespace :db do
namespace :fixtures do
desc 'Create YAML test fixtures from data in an existing database.
Defaults to development database. Set RAILS_ENV to override.'
task :dump => :environment do
sql = "SELECT * FROM %s"
skip_tables = ["schema_migrations"]
(ActiveRecord::Base.connection.tables - skip_tables).each do |table_name|
You can’t perform that action at this time.