Skip to content

Instantly share code, notes, and snippets.

View willjw3's full-sized avatar

Will Ward willjw3

View GitHub Profile
import { v4 as uuidv4 } from 'uuid';
export const users = [
{
id: uuidv4(),
name: 'Octavio Flores',
email: 'oflores@zcorp.com',
password: 'abc123'
},
{
@willjw3
willjw3 / ts-gql-4-utils.js
Created March 22, 2021 12:02
Functions for part 4 of GraphQL & TypeScript tutorial.
import { v4 as uuidv4} from 'uuid';
import { pool } from "../database/db";
interface User {
id: string
name: string
email: string
password: string
}
{
"beers": [
{
"tap": 1,
"beer": "Dank For Days IPA",
"style": "IPA"
},
{
"tap": 2,
"beer": "Endless Winter Blues Dry Stout",
const months = {
"01": "January",
"02": "February",
"03": "March",
"04": "April",
"05": "May",
"06": "June",
"07": "July",
"08": "August",
"09": "September",
function mergeSort(array) {
if (array.length > 1) {
let mid = Math.floor(array.length / 2);
let lhs = mergeSort(array.slice(0, mid));
let rhs = mergeSort(array.slice(mid));
return merge(lhs, rhs);
} else {
return array;
}
}
{
"quotes": [
{
"quote": "Accept that you're just a product, not a gift",
"author": "Konrad"
},
{
"quote": "TEAMWORK: A few harmless flakes working together can unleash an avalanche of destruction.",
"author": "Justin Sewell"
},