This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create and download backup | |
heroku pg:backups:capture | |
heroku pg:backups:download | |
# Assumes the database container is named 'db' | |
DOCKER_DB_NAME="$(docker-compose ps -q db)" | |
DB_HOSTNAME=db | |
DB_USER=postgres | |
LOCAL_DUMP_PATH="path/to/local.dump" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_relative 'environment' | |
app = Server.new do | |
trigger :turn_on_lightbulb do | |
# Make an API request... | |
Net::HTTP.post_form(URI('http://lightbulb.local'), 'status' => 'on') | |
# Response (any JSON-like data) | |
{ light_bulb: "on" } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module PaperclipMigrations | |
def self.included(base) | |
base.extend ClassMethods | |
end | |
module ClassMethods | |
def add_paperclip_fields(table, prefix) | |
add_column table, "#{prefix}_file_name", :string | |
add_column table, "#{prefix}_content_type", :string |