Skip to content

Instantly share code, notes, and snippets.


Magda Iris magdairis

View GitHub Profile

Setting up DB to be pushed and deployed easy peasy

Log in to Google Cloud console

  • Bearjam commerce project
  • Database instance can have multiple databases
    • so we don't have to pay for multiple users

Set up Cloud SQL proxy PostgreSQL

  • Quickstart for local testing

Create repo on Cloud Source

gcloud source repos create $REPO_NAME

Setup git authentication with Cloud Source

git config --global credential.''.helper

Add remote

git remote add origin $(gcloud source repos describe $REPO_NAME --format="value(url)"


Create Cloud SQL DB instance

gcloud sql instances create commerce-sql-00 --database-version=POSTGRES_12 --tier db-f1-micro --region europe-west2

Set Postgres superuser password

gcloud sql users set-password postgres --instance=commerce-sql-00 --prompt-for-password

Get instance connection name

gcloud sql instances describe commerce-sql-00 --format="value(connectionName)"

Start the Cloud SQL proxy

View header.jsx
import React, { useState } from "react";
import styles from "./Header.module.css";
import { motion } from "framer-motion";
import theme from "tailwindcss/defaultTheme";
import MenuToggle from "./MenuToggle";
import SvgIcon from "./SvgIcon";
import { Link } from "gatsby";
const Header = () => {
// const [variant, setVariant] = useState("closed")


Set the scene

  • What's the difference between a header and a nav?
  • Why do I need a header?
  • Should I use the same header for mobile and desktop?
  • What should I include in the header?
  • What makes a good header?
  • How is a header/nav different in React/Gatsby?
View uhh.js
const itemsJson = require('./items.json');
const FS = require('fs');
const PATH = require('path')
const SVGO = require('svgo');
const svgo = new SVGO();
let out = => {
let imagePath = itemJson["imagePath"]

Keybase proof

I hereby claim:

  • I am magdairis on github.
  • I am magdairis ( on keybase.
  • I have a public key ASDYEr-uuCOVLQTvpxEErOoti-E7sEOgrEPo6Vsiw7-hcQo

To claim this, I am signing this object: