Skip to content

Instantly share code, notes, and snippets.

View garethpbk's full-sized avatar

Gareth Kloeden garethpbk

View GitHub Profile
@garethpbk
garethpbk / .md
Last active April 29, 2021 17:50
Cool Cats

Cool Cats

Step 1: Create a New Expo Project

expo init cool-cats

If using npm:

expo init cool-cats --npm

@garethpbk
garethpbk / CreateUser.js
Last active November 20, 2018 17:40
apollo-link-rest CreateUser component
import React from 'react';
const CreateUser = ({ createUser, createNewUser, state, handleChange }) => {
const {
name,
username,
email,
address: {
street,
suite,
@garethpbk
garethpbk / createNewUser.js
Created November 20, 2018 17:38
apollo-link-state createNewUser function
createNewUser = async (e, action) => {
e.preventDefault();
const currentUsers = client.readQuery({ query: GET_ALL_USERS_QUERY });
const id = currentUsers.users.length + 1;
await action({
variables: {
input: {
@garethpbk
garethpbk / NestedState.js
Created November 20, 2018 17:36
apollo-link-rest nested state management example
state = {
name: '',
username: '',
email: '',
address: {
street: '',
suite: '',
city: '',
zipcode: '',
geo: {
@garethpbk
garethpbk / SingleUserReturn.js
Last active November 20, 2018 17:35
apollo-link-rest SingleUser component return
const {
name,
username,
email,
address: {
street,
suite,
city,
zipcode,
geo: { lat, lng },
// from https://codepen.io/Evangogh/pen/VjaRQV
MktoForms2.loadForm("//app-ab06.marketo.com", "981-LQX-968", 3668);
MktoForms2.whenReady(function(form) {
form.onValidate(function(builtInValid) {
if (!builtInValid) return;
form.submittable(true);
var vals = form.vals();
var invalidDomains = ["gmail.cm", "gmail.co",
"gmail.om", "yahoo.cm", "yahoo.co", "yahoo.om",