Skip to content

Instantly share code, notes, and snippets.

View tiagojdf's full-sized avatar

Tiago Ferreira tiagojdf

View GitHub Profile
@tiagojdf
tiagojdf / safe.md
Created June 5, 2018 08:09 — forked from bryanrite/safe.md
Safe Postgres Operations on High Volume Tables

Originally taken from: Braintree Article and expanded on by me.

Safe

  • Add a new column
  • Drop a column
  • Rename a column
  • Add an index concurrently (Example), Note: it will still take a long time to run the migration, but it won't write-lock the table.
  • Drop a constraint (for example, non-nullable)
  • Add a default value to an existing column
@tiagojdf
tiagojdf / merge.md
Created March 31, 2017 14:50 — forked from jt/merge.md
Merge a forked gist

If someone forks a gist and you'd like to merge their changes. Do this:

  1. clone your repo, I use the name of the gist

     git clone git://gist.github.com/1163142.git gist-1163142
    
  2. add a remote for the forked gist, I'm using the name of my fellow developer

     git remote add aaron git://gist.github.com/1164196.git
    
@tiagojdf
tiagojdf / README.md
Last active February 13, 2020 01:00 — forked from marchelbling/README.md
git hooks

Git hooks for better pivotal integration:

  • pre-commit:
    • prevents commiting on a branch that is not suffixed by an issue number. Some special branches (develop, master) and hotfixes are not constrained
    • lints modified python files and exits upon non correctly formatted modules
    • other formats (js, scss) have pending code that is not currently called as the workflow for front code is not clear
  • prepare-commit-msg: prepend issue number to commit message if it's missing and if it is set in the branch name (see pre-commit hook)
  • post-checkout: [optional] automatically update submodules when checkouting a branch (requires to define the AUTO_SUBMODULE_UPDATE environment variable)

For easy setup:

@tiagojdf
tiagojdf / 0_reuse_code.js
Last active August 29, 2015 14:22
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console