Skip to content

Instantly share code, notes, and snippets.

View alejandrobabio's full-sized avatar
Working from home

Alejandro Babio alejandrobabio

Working from home
View GitHub Profile
alejandrobabio / app.Dockerfile
Last active July 16, 2023 20:06 — forked from satendra02/app.DockerFile
docker+rails+puma+nginx+postgres (Production ready)
FROM ruby:2.3.1
# Install dependencies
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
# Set an environment variable where the Rails app is installed to inside of Docker image:
ENV RAILS_ROOT /var/www/app_name
RUN mkdir -p $RAILS_ROOT
# Set working directory, where the commands will be ran:
alejandrobabio /
Created March 22, 2019 11:21 — 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
alejandrobabio /
Created December 15, 2017 18:16 — 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.


Business Logic / Domain Model structures for Ruby, Rails

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 August 17, 2016 14:21 — forked from kristopolous/hn_seach.js
hn job query search
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 June 23, 2016 21:41 — forked from ZachBeta/fixtures.rake
Rake task to create fixtures from test database in Rails 3.1
#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|
alejandrobabio /
Created June 1, 2016 20:34 — forked from seyhunak/
Rails - Apache Bench - Load Testing (if Devise Sign-in Required)
curl --cookie-jar cookie_file $LOGIN_PAGE | grep csrf-token
<meta content="csrf-token" name="csrf-token" />
alejandrobabio / tmux-cheatsheet.markdown
Created December 8, 2015 11:55 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:


start new with session name:

tmux new -s myname