Skip to content

Instantly share code, notes, and snippets.

View gsong's full-sized avatar

George Song gsong

View GitHub Profile
@gsong
gsong / docker-compose.yml
Last active September 30, 2021 14:17
Docker compose file to start PG and PGAdmin
version: "3.8"
services:
pg:
image: postgres:alpine
container_name: dev-postgres
hostname: pg
environment:
POSTGRES_USER: me
POSTGRES_PASSWORD: password
@gsong
gsong / project-planning.md
Last active April 6, 2021 20:01
Techtonica Project Planning

Planning Your Final Project

Elements of Your Final Project

README

Non-Technical

  • Link to demo app
  • Elevator pitch
@gsong
gsong / machine.js
Last active May 24, 2020 14:35
Generated by XState Viz: https://xstate.js.org/viz
const context = { useLoadingStatus: false };
const queryMachine = Machine(
{
id: "query",
context,
on: {
UPDATE: [
{ target: "loading", cond: "isLoading" },
{ target: "notFound", cond: "isNotFound" },
@gsong
gsong / machine.js
Last active March 4, 2020 16:25
Generated by XState Viz: https://xstate.js.org/viz
const ALL = "All";
const fetchMachine = Machine(
{
id: "fetch",
initial: "loading",
context: { characters: [], filtered: [], genders: [], retries: 0 },
states: {
loading: {
@gsong
gsong / machine.js
Last active March 3, 2020 12:13
Generated by XState Viz: https://xstate.js.org/viz
const form = {
initial: "editing",
states: {
editing: {
entry: "updateStatus",
on: {
CHANGE: { target: "editing", actions: ["edit"] },
RESET: { target: "editing", actions: ["reset"] },
SUBMIT: { target: "submitting", cond: "submitAllowed" },
},
@gsong
gsong / machine.js
Last active March 20, 2020 17:21
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
@gsong
gsong / nyt_where_to_go_2018.py
Created January 14, 2018 20:17
Parse NYT where to go list
#!/usr/bin/env python
import csv
import json
import re
from collections import OrderedDict
from urllib.parse import quote
import attr
import click
@gsong
gsong / pyenv-setup.md
Last active September 11, 2018 06:44
Pyenv Setup Step-by-step
  1. Install [pyenv][] using [pyenv-installer][]:

    curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash
  2. Activate pyenv for Terminal:

    echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
@gsong
gsong / brew-config.log
Last active May 7, 2017 14:05
`brew install highlight` error
HOMEBREW_VERSION: 1.2.0-50-g3e4547f5
ORIGIN: https://github.com/Homebrew/brew
HEAD: 3e4547f52e7ebec633f8bfefc8a396d944edf908
Last commit: 52 minutes ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 9c4f788f512c3fdb9f83dace59b2194a778c13bd
Core tap last commit: 12 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/Homebrew
HOMEBREW_CELLAR: /usr/local/Cellar