Skip to content

Instantly share code, notes, and snippets.

@dodafish
dodafish / rails_template_uuids.rb
Created February 9, 2020 12:47
UUIDs for Rails ActiveRecords
# Configures Rails to use UUIDs instead of incremental integers.
# Limits Rails to run with postgresql only (even in development and test environments)
# postgresql adapter
gem "pg"
# default to use uuids in generators
initializer 'generators.rb', <<-CODE
Rails.application.config.generators do |g|
g.orm :active_record, primary_key_type: :uuid
@dodafish
dodafish / project-create.sh
Last active January 17, 2020 23:01 — forked from francoisromain/project-create.sh
A bash script to create a Git post-receive hook to deploy after a Git push
#!/bin/bash
# source: https://gist.github.com/francoisromain/58cabf43c2977e48ef0804848dee46c3
# and another script to delete the directories created by this script
# project-delete.sh: https://gist.github.com/francoisromain/e28069c18ebe8f3244f8e4bf2af6b2cb
# Call this file with `bash ./project-create.sh project-name`
# - project-name is mandatory
# This will creates 4 directories and a git `post-receive` hook.