Skip to content

Instantly share code, notes, and snippets.

Ryan Gasparini rxgx

Block or report user

Report or block rxgx

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
rxgx / config.yml
Created Oct 30, 2019
CircleCI config for json-calendar
View config.yml
version: 2.1
codecov: codecov/codecov@1.0.5
- image: circleci/node:10.16
working_directory: ~/json-calendar
rxgx /
Created Oct 2, 2019
Graph as a Gateway

GraphQL as a Gateway Architecture Flow


  • Create a promotion based deployment flow for clients, instances of graphs, and backend resolvers.
  • Each node in this network has the potential to be live but only those which are tested and reliable are production-worthy.
  • Data and the metal are always guaranteed to be the latest usable pieces of the platform.


rxgx / newWithHooks.ts
Last active Sep 18, 2019
Apollo HoC to Hooks
View newWithHooks.ts
import React from 'react';
import { useQuery, QueryHookOptions } from '@apollo/react-hooks';
import ErrorBoundary from 'components/ErrorBoundary';
import PagePreloader from 'components/PagePreloader';
import getVendors from 'pages/Admin/queries/getVendors';
import VendorListTable from './VendorListTable';
const options: QueryHookOptions = {
fetchPolicy: 'no-cache',
variables: { isCorporate: true },
rxgx / client.js
Created Aug 22, 2019
GraphQL request client
View client.js
import { GraphQLClient } from 'graphql-request';
import authn from 'clients/authn';
import config from 'config';
const accessToken = authn.getToken('access_token');
const idToken = authn.getToken('id_token');
const graphQLClient = new GraphQLClient(config.apiGatewayUrl, {
headers: {
Authorization: accessToken,
rxgx /
Last active Sep 6, 2019
SPA Authn Options
rxgx / rename-flow-to-typescript.js
Created Aug 1, 2019
Rename files with Flow annotation to TypeScript
View rename-flow-to-typescript.js
const { genSummarizedReport } = require('flow-annotation-check');
const fs = require('fs');
const options = {
include: ['src/**/*.js'],
exclude: ['+(node_modules|build|flow-typed)/**/*.js'],
absolute: true,
function renameFile(srcPath, srcExt, destExt) {
rxgx / rename-to-jsx.js
Created Jul 31, 2019
Rename JS to JSX with ESLint JSON output
View rename-to-jsx.js
// Run eslint with the rule 'react/jsx-filename-extension' as 'error'
// eslint -o json > files.json
const fs = require('fs');
const json = require('./files.json')
console.log('run...', json.length);
.filter(entry => entry.messages.length)
View asyncExample.js
const AWS = require('aws-sdk');
const client = new AWS.SecretsManager({});
// Call the AWS API and return a Promise
function getAwsSecret(secretName) {
return client.getSecretValue({ SecretId: secretName }).promise();
// Create a async function to use the Promise
rxgx / addEncryptedToken.js
Last active Apr 18, 2018
Auth0 rule to save an encrypted version of Google's refresh token to a user's app_metadata
View addEncryptedToken.js
function (user, context, callback) {
const namespace = '';
if (
user.app_metadata &&
) {
const refreshTokenEncrypted = user.app_metadata.refresh_token_encrypted;
context.idToken[namespace + 'refresh_token_encrypted'] = refreshTokenEncrypted;
rxgx / server.js
Last active Mar 16, 2018
Express initial config
View server.js
const express = require('express');
app = express();
const server = app.listen(3000, () => {
const host = server.address().address;
const port = server.address().port;'Express now listening on http://%s:%s', host, port);
You can’t perform that action at this time.