Skip to content

Instantly share code, notes, and snippets.

View molebox's full-sized avatar
✍️

Rich Haines molebox

✍️
View GitHub Profile
@molebox
molebox / Update-branch.md
Created April 1, 2021 06:02 — forked from whoisryosuke/Update-branch.md
Bring your feature branch up to date with master. Deploying from Git branches adds flexibility. Bring your branch up to date with master and deploy it to make sure everything works. If everything looks good the branch can be merged. Otherwise, you can deploy your master branch to return production to its stable state.

Updating a feature branch

First we'll update your local master branch. Go to your local project and check out the branch you want to merge into (your local master branch)

$ git checkout master

Fetch the remote, bringing the branches and their commits from the remote repository. You can use the -p, --prune option to delete any remote-tracking references that no longer exist in the remote. Commits to master will be stored in a local branch, remotes/origin/master

// company.ts
import { arg, extendType, inputObjectType, intArg, list, nonNull, objectType, stringArg } from "nexus";
export const CompanyInputType = inputObjectType({
name: 'CompanyInputType',
definition(t) {
t.string('name')
t.string('contactPerson')
t.string('bio')
@molebox
molebox / gist:be0b5255e09fea675e8b207b8d8f8a21
Created February 23, 2021 12:51
Nexus objectType error
// schema
model Company {
id Int @id @default(autoincrement())
name String
trades Trade[]
}
model Trade {
id Int @id @default(autoincrement())
@molebox
molebox / main.js
Created January 30, 2021 13:32
Seed Postgres DB with data using node
const faker = require('faker');
const fs = require('fs');
const fastcsv = require("fast-csv");
const db = require('./db');
const contains = require('validator/lib/contains');
// The path to write the csv file to
const output = './src/output.csv';
// Create a stream to write to the csv file
@molebox
molebox / gist:c6fb4de724aabbddb67dae6423dc211d
Created January 12, 2021 18:49
Sanity Apollo Gatsby query error
import React, { useContext, useEffect } from "react";
import { Flex, Text, Close, Grid } from "theme-ui";
import { StateContext, DispatchContext } from "./../context";
import { gql, useLazyQuery } from "@apollo/client";
const Categories = () => {
const state = useContext(StateContext);
const dispatch = useContext(DispatchContext);
const [loadCategories, { loading, error, data }] = useLazyQuery(GET_CATEGORIES, {
@molebox
molebox / README-Template.md
Created May 3, 2019 17:53 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites