Skip to content

Instantly share code, notes, and snippets.

View lanceharper's full-sized avatar

Lance Harper lanceharper

View GitHub Profile
@stormwild
stormwild / node.md
Last active April 2, 2024 13:42
Node Optimization
@dabit3
dabit3 / chat-api.ts
Last active August 21, 2020 18:28
Example AppSync GraphQL API
/* Imports from CDK */
import * as appsync from '@aws-cdk/aws-appsync';
import * as db from '@aws-cdk/aws-dynamodb';
/* Creating the API */
const api = new appsync.GraphQLApi(this, 'Api', {
name: 'my-chat-app', // API name
schemaDefinition: appsync.SchemaDefinition.FILE, // Type of schema
schemaDefinitionFile: './schema.graphql', // location of schema
authorizationConfig: { // authorization config
  1. Install these packages:
yarn install --dev @babel/core @babel/preset-env jest babel-jest
  1. Add babel.config.js (exactly babel.config.js, not .babelrc, not .babelrc.json etc):
module.exports = {
@tj
tj / app.js
Last active October 4, 2021 19:38
const http = require('http')
const rpc = require('./rpc')
/**
* Pets service.
*/
class Pets {
constructor(db = []) {
@metral
metral / launch-talk.md
Last active September 12, 2019 01:19
Secure, Production-Ready Kubernetes Apps Productively
@axemclion
axemclion / PerfLogger.java
Last active August 12, 2023 02:56
React Native Android - Systrace from ReactMarkers
package com.nparashuram;
import android.os.Process;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.view.ViewTreeObserver;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.bridge.ReactContext;
import React, { Suspense, useState } from "react";
import { unstable_createResource as createResource } from "react-cache";
import {
Combobox,
ComboboxInput,
ComboboxList,
ComboboxOption
} from "./Combobox2.js";
function App({ tabIndex, navigate }) {
// @flow
import React from 'react';
import { StatusBar } from 'react-native';
import hoistStatics from 'hoist-non-react-statics';
import invariant from 'invariant';
import { withNavigation } from 'react-navigation';
import type { Subscription } from '../../types';
@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API
@dabit3
dabit3 / App.js
Created May 18, 2018 19:32
GraphQL Lambda + AI
import React, { Component } from 'react';
import {
Platform,
StyleSheet,
Text,
View,
TextInput
} from 'react-native';
import { ButtonGroup, Button } from 'react-native-elements'