Skip to content

Instantly share code, notes, and snippets.

View PelagicDev's full-sized avatar

Jordan Godwin PelagicDev

  • CompanyCam
  • Wilmington, NC
  • 13:07 (UTC -04:00)
  • X @PelagicDev
View GitHub Profile

Keybase proof

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:

@PelagicDev
PelagicDev / heroku-db-reset.md
Last active March 3, 2017 19:32
Reset Wildfire-staging App (Heroku)

RESET & RE-SEED HEROKU DATABASE (wildfire-staging):

  1. From the terminal, run: heroku pg:reset -a wildfire-staging & confirm the app name wildfire-staging
  2. From Postico’s SQL editor, run: CREATE EXTENSION postgis;
  3. Back to terminal, run: heroku run rails db:setup_heroku -a wildfire-staging
  4. The terminal should output “Heroku App Ready!” when it’s finished.
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 })