Skip to content

Instantly share code, notes, and snippets.

@lucleray
lucleray / generate-migration.sh
Created June 21, 2021 05:55
Create a migration file by reading local changes made to db/create-tables.sql
slugify='node_modules/.bin/slugify'
git show HEAD:db/create-tables.sql > db/tmporigin.sql
cp db/create-tables.sql db/tmpnew.sql
today="$(date -u +'%Y%m%d%H%M')"
file_name="db/migrations/$($slugify "$today $1").sql"
file_content=$(apgdiff --add-defaults db/tmporigin.sql db/tmpnew.sql)

Keybase proof

I hereby claim:

  • I am lucleray on github.
  • I am lucleray (https://keybase.io/lucleray) on keybase.
  • I have a public key ASBiCcIDy1vCfwW0_WyJBTUzjA5-mST0I69nZlsUjOq83wo

To claim this, I am signing this object:

@lucleray
lucleray / cloudflare-purge-post-receive.sh
Last active January 25, 2018 15:14
Purge CloudFlare when deploying GitHub Pages: post-receive hook
#!/bin/sh
#
# To use, rename this file to "post-receive" and drop it into the `.git/hooks/` directory in your project's root.
# Change the $branch value based on the type of page you're deploying.
# Use "master" for Organization Pages, and "gh-pages" for Project Pages.
#
# Find your Zone Id and get your API key in the Cloudflare interface, under the "Overview" tab
#
# Inspired by jonlong/cloudflare-purge-post-receive : https://gist.github.com/jonlong/240eb9a7501f1ae4c09f