- From the terminal, run:
heroku pg:reset -a wildfire-staging
& confirm the app namewildfire-staging
- From Postico’s SQL editor, run:
CREATE EXTENSION postgis;
- Back to terminal, run:
heroku run rails db:setup_heroku -a wildfire-staging
- The terminal should output “Heroku App Ready!” when it’s finished.
This file contains hidden or 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
import React, { useState, useEffect, useCallback } from 'react' | |
export const IDLE = 'IDLE' | |
export const LOADING = 'LOADING' | |
export const SUCCESS = 'SUCCESS' | |
export const ERROR = 'ERROR' | |
export function useAsyncData(fetchFn, deps) { | |
const stableFetchFn = useCallback(fetchFn, deps) | |
const [{ state, data, error }, setState] = useState({ state: IDLE }) |
I hereby claim:
- I am PelagicDev on github.
- I am jgodwin (https://keybase.io/jgodwin) on keybase.
- I have a public key whose fingerprint is 4C81 6BBB 5B4E 1BEC 3B8C 5067 29B3 F2D7 D116 0571
To claim this, I am signing this object:
This file contains hidden or 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
image: benphelps/docker-ruby-phantomjs:latest | |
Testing: | |
services: | |
- postgres:latest | |
variables: | |
POSTGRES_DB: test | |
POSTGRES_HOST: postgres | |
POSTGRES_USER: testuser | |
POSTGRES_PASS: testuser | |
environment: test |
This file contains hidden or 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
POSTGRES_USER=phelps | |
POSTGRES_PASS=phelps | |
POSTGRES_HOST=localhost |
This file contains hidden or 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 ApplicationHelper | |
def retina_image_tag(default_name, options={}) | |
retina_name = default_name.gsub(%r{\.\w+$}, '@2x\0') | |
retina_image_tag(default_name, options.merge('data-interchange' => "[#{asset_path(retina_name)}, (retina)]")) | |
end | |
end |
This file contains hidden or 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
class TournamentsController < ApplicationController | |
# GET /tournaments/new | |
def new | |
@form = TournamentSubmissionForm.new | |
end | |
# POST /tournaments | |
def create | |
@form = TournamentSubmissionForm.from_params(params) |
This file contains hidden or 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
[Unit] | |
Description=Puma Rails Server | |
After=network.target | |
[Service] | |
Type=simple | |
User=deploy | |
WorkingDirectory=/home/deploy/app/current | |
ExecStart=/home/deploy/.rbenv/bin/rbenv exec bundle exec puma -C /home/deploy/app/shared/config/puma.rb | |
ExecStop=/home/deploy/.rbenv/bin/rbenv exec bundle exec pumactl -S /home/deploy/app/shared/tmp/pids/puma.state stop |
Follow this guide until it gets to the upstart
parts and then
follow the steps below (http://codepany.com/blog/rails-5-puma-capistrano-nginx-jungle-upstart/):
Add to Gemfile:
group :development do
gem 'capistrano', '~> 3.6'
gem 'capistrano-rails', '~> 1.1'
NewerOlder