Skip to content

Instantly share code, notes, and snippets.

Avatar

Magda Iris magdairis

View GitHub Profile
View SHOP-backend-documentation.md

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
View cloud-src-commands.md

Create repo on Cloud Source

gcloud source repos create $REPO_NAME

Setup git authentication with Cloud Source

git config --global credential.'https://source.developers.google.com'.helper gcloud.sh

Add remote

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

View 01-database.md

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")
View header.md

Questions

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 = itemsJson.map((itemJson) => {
let imagePath = itemJson["imagePath"]
View keybase.md

Keybase proof

I hereby claim:

  • I am magdairis on github.
  • I am magdairis (https://keybase.io/magdairis) on keybase.
  • I have a public key ASDYEr-uuCOVLQTvpxEErOoti-E7sEOgrEPo6Vsiw7-hcQo

To claim this, I am signing this object: