Skip to content

Instantly share code, notes, and snippets.

Avatar

Kurt Kemple kkemple

View GitHub Profile
@kkemple
kkemple / Dockerfile
Created May 26, 2021
Snippets for setting up federated GraphQL APIs
View Dockerfile
FROM node:14
# Create app directory
WORKDIR /usr/src/app
COPY package*.json ./
# Install app dependencies
RUN npm install
@kkemple
kkemple / gatsby-node.js
Created Oct 22, 2020
gatsby source plugin for Oribt
View gatsby-node.js
// constants for your GraphQL Post and Author types
const fetch = require("isomorphic-fetch")
const MEMBER_NODE_TYPE = `OrbitMember`
const ORBIT_API_KEY = `<YOUR_KEY_HERE>`
exports.sourceNodes = async ({
actions,
createContentDigest,
createNodeId,
@kkemple
kkemple / autonomous.txt
Created Jun 24, 2020 — forked from Khaledgarbaya/autonomous.txt
Instructions on how to reset the autonomous desk. This fixes a problem where the desk will not lower (also reportedly fixes incorrectly reported heights).
View autonomous.txt
> Thank you for reaching out to Autonomous! I am sorry to hear that you are having some trouble with your SmartDesk
> but I will be glad to assist. It sounds like your system needs a "hard reset" can I please have you follow these
> steps thoroughly.
Reset Steps:
1. Unplug the desk for 20 seconds. Plug it back in. Wait a full 20 seconds.
2. Press the up and down buttons until the desk lowers all the way and beeps or 20 seconds pass.
3. Release both buttons.
4. Press the down buttons until the desk beeps one more time or 20 seconds pass.
View TranslationScreen.js
import React, { useState, useEffect } from "react";
import {
TouchableOpacity,
View,
KeyboardAvoidingView,
Modal,
ScrollView,
StyleSheet,
StatusBar
} from "react-native";
View event-connection-hook.js
import { useState, useEffect } from "react";
import { Auth, API, graphqlOperation } from "aws-amplify";
import parse from "date-fns/parse";
import format from "date-fns/format";
import formatDistance from "date-fns/formatDistance";
import { getEvent } from "../graphql/queries";
import {
onUpdateEvent,
View EventScreen.js
import React, { memo, useState, useEffect } from "react";
import { SafeAreaView, View, TouchableOpacity } from "react-native";
import { Agenda } from "react-native-calendars";
import styled from "@emotion/native";
import { FontAwesome5 } from "@expo/vector-icons";
import { Auth, API, graphqlOperation } from "aws-amplify";
import eachDayOfInterval from "date-fns/eachDayOfInterval";
import parse from "date-fns/parse";
import startOfMonth from "date-fns/startOfMonth";
import startOfDay from "date-fns/startOfDay";
View MainActivity.java
package com.example.nycworkshopexample;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;
import com.amazonaws.amplify.generated.graphql.CreateTodoMutation;
import com.amazonaws.amplify.generated.graphql.ListTodosQuery;
import com.amazonaws.amplify.generated.graphql.OnCreateTodoSubscription;
View amplify-multienv-build-settings.yaml
version: 0.1
backend:
phases:
build:
commands:
- '# Get Amplify CLI Cloud-Formation stack info from environment cache'
- export STACKINFO="$(envCache --get stackInfo)"
- '# Execute Amplify CLI with the helper script'
- amplifyPush --environment $BUILD_ENV
- '# Store Amplify CLI Cloud-Formation stack info in environment cache'
View amplify-multienv-todos.js
import React, { Component } from "react";
import Amplify, { graphqlOperation } from "aws-amplify";
import { withAuthenticator, Connect } from "aws-amplify-react";
import "./App.css";
import awsConfig from "./aws-exports";
import * as mutations from "./graphql/mutations";
import * as queries from "./graphql/queries";
import * as subscriptions from "./graphql/subscriptions";
View amplify-multienv-auth.js
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import Amplify from 'aws-amplify';
import awsConfig from './aws-exports';
import { withAuthenticator } from 'aws-amplify-react';
Amplify.configure(awsConfig);