This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { onError } from 'apollo-link-error'; | |
| import { Observable } from 'apollo-link'; | |
| import { buildAuthHeader } from 'utils/requests'; | |
| import { getProvider as getGlobalProvider } from 'GlobalState'; | |
| let isFetchingToken = false; | |
| let tokenSubscribers = []; | |
| function subscribeTokenRefresh(cb) { | |
| tokenSubscribers.push(cb); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| #https://github.com/psycopg/psycopg2/issues/261 | |
| import psycopg2 | |
| ISOLEVEL = psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT | |
| import time |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { buildClientSchema, printSchema } = require("graphql"); | |
| const fs = require("fs"); | |
| const introspectionSchemaResult = JSON.parse(fs.readFileSync("result.json")); | |
| const graphqlSchemaObj = buildClientSchema(introspectionSchemaResult); | |
| const sdlString = printSchema(graphqlSchemaObj); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <body> | |
| <div id="⚛️"></div> | |
| <script src="https://unpkg.com/[email protected]/umd/react.development.js"></script> | |
| <script src="https://unpkg.com/[email protected]/umd/react-dom.development.js"></script> | |
| <script src="https://unpkg.com/[email protected]/babel.js"></script> | |
| <script type="text/babel"> | |
| ReactDOM.render(<div>Hello World!</div>, document.getElementById('⚛️')) | |
| </script> | |
| </body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # rename all .js to .mjs | |
| for f in **/*.js; do mv -- "$f" "${f%.js}.mjs"; done | |
| # add .mjs to all file-based import statements* | |
| find . -type f -name "*.mjs" -exec sed -i '' -E "s/(import.+'\.[a-zA-Z0-9\.\/-]+)';/\1\.mjs';/g" {} \; | |
| # *NOTES: | |
| # 1. This will double up existing .mjs extension in imports. | |
| # Couldn't get phrase negation working in this sed substitution regex :( | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| AWSTemplateFormatVersion: '2010-09-09' | |
| Description: Cognito Stack | |
| Parameters: | |
| AuthName: | |
| Type: String | |
| Description: Unique Auth Name for Cognito Resources | |
| Resources: | |
| # Creates a role that allows Cognito to send SNS messages | |
| SNSRole: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <svg width="80%" height="80%" viewBox="-100 -100 200 200"> | |
| <!-- Need this definition to make a drop shadow - based on examples from many articles, including svg spec --> | |
| <defs> | |
| <filter id="drop-shadow" x="-100%" y="-100%" width="300%" height="300%"> | |
| <feGaussianBlur in="SourceAlpha" stdDeviation="2"/> | |
| <feOffset dx="5" dy="5" result="offsetblur"/> | |
| <feFlood flood-color="#000000"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { createCipheriv, createDecipheriv, randomBytes } from "crypto"; | |
| const ENCRYPTION_KEY: string = process.env.ENCRYPTION_KEY || ""; // Must be 256 bits (32 characters) | |
| const IV_LENGTH: number = 16; // For AES, this is always 16 | |
| /** | |
| * Will generate valid encryption keys for use | |
| * Not used in the code below, but generate one and store it in ENV for your own purposes | |
| */ | |
| export function keyGen() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class FunctifiedAsync { | |
| constructor(iterable) { | |
| this.iterable = iterable; | |
| } | |
| async *[Symbol.asyncIterator]() { | |
| for await (const value of this.iterable) { | |
| yield value; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { fontWeight: '100' }, // Thin | |
| { fontWeight: '200' }, // Ultra Light | |
| { fontWeight: '300' }, // Light | |
| { fontWeight: '400' }, // Regular | |
| { fontWeight: '500' }, // Medium | |
| { fontWeight: '600' }, // Semibold | |
| { fontWeight: '700' }, // Bold | |
| { fontWeight: '800' }, // Heavy | |
| { fontWeight: '900' }, // Black |