Skip to content

Instantly share code, notes, and snippets.

View jvenezia's full-sized avatar

Jeremy Venezia jvenezia

View GitHub Profile
@jvenezia
jvenezia / Dockerfile
Created November 23, 2021 13:15
Algolia Data Engineer Assignment
FROM apache/airflow:2.2.0
USER root
ENV DEBIAN_FRONTEND=noninteractive \
TERM=linux \
AIRFLOW_GPL_UNIDECODE=yes
RUN apt-get -y update \
&& apt-get -y install python-pip libpq-dev postgresql-client python3-dev python3-distutils python3-apt
@jvenezia
jvenezia / prepare-commit-msg.sh
Last active August 29, 2015 14:26 — forked from bartoszmajsak/prepare-commit-msg.sh
How to automatically prepend git commit with a branch name
#!/bin/bash
# This way you can customize which branches should be skipped when
# prepending commit message.
if [ -z "$BRANCHES_TO_SKIP" ]; then
BRANCHES_TO_SKIP=(master develop test)
fi
BRANCH_NAME=$(git symbolic-ref --short HEAD)
BRANCH_NAME="${BRANCH_NAME##*/}"
HEROKU_APP = ARGV[0]
raise 'Heroku application name argument is missing. (e.g. \'ruby lib/tasks/teamcity/heroku/deploy.rb elcurator-staging\')' unless HEROKU_APP
HEROKU_GIT_URL = "git@heroku.com:#{HEROKU_APP}.git"
TEMP_DIFF_REMOTE = 'temp_diff_remote'
# Check if there is migrations to run
puts `git remote add #{TEMP_DIFF_REMOTE} #{HEROKU_GIT_URL}`
puts `git fetch #{TEMP_DIFF_REMOTE}`
there_is_migrations_to_run = !`git diff HEAD #{TEMP_DIFF_REMOTE}/master db/migrate`.empty?
@jvenezia
jvenezia / sizing_your_rails_application_with_unicorn_on_heroku.md
Last active December 1, 2021 12:07
Sizing your Rails application with Unicorn on Heroku

Sizing your Rails application with Unicorn on Heroku

This tutorial assumes you are running a Rails application on Heroku with a Unicorn server. However, if you are not using one of those you will find some general information which can help you in your context.

This article will help you to correctly configure your Unicorn server based on real data.

I recommend you to use New Relic, which is really easy to setup with Rails & Heroku. It will help you monitoring your application and configure it at its best.

Using Unicorn Web Server

@jvenezia
jvenezia / rails_mailer_structure.md
Last active January 4, 2023 13:44
Rails mailer structure

Rails mailer structure

Your application is growing, and you are starting to have a complex mailing system: notification emails, retention emails, misc user emails, admin emails, etc...

It's time to clean up your mailers !

Existing mailer

You may already have a single mailer, responsible of every emails, like this one:

@jvenezia
jvenezia / heroku_application_migration.md
Last active August 16, 2019 03:45
Migrating an Heroku Application to another

Migrating an Heroku Application to another

The usecase here is to migrate an Heroku Application to Heroku Europe, and minimise downtime.

The heroku documentation on this subject is quite complete.
It is recommanded to read it if you are planning a migration.
https://devcenter.heroku.com/articles/app-migration

Process

In this guide, sourceapp is the original (source) app and targetapp is the migrated (target) app.