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
| diff --git a/node_modules/react-scripts/config/webpack.config.js b/node_modules/react-scripts/config/webpack.config.js | |
| index 8f70442..dfd86d8 100644 | |
| --- a/node_modules/react-scripts/config/webpack.config.js | |
| +++ b/node_modules/react-scripts/config/webpack.config.js | |
| @@ -47,6 +47,10 @@ const shouldInlineRuntimeChunk = process.env.INLINE_RUNTIME_CHUNK !== 'false'; | |
| // Check if TypeScript is setup | |
| const useTypeScript = fs.existsSync(paths.appTsConfig); | |
| +// Skip TypeScript type checking | |
| +const typeCheckTypeScript = |
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
| const NO_VALUE_SYMBOL = Symbol("USE_RESET_STATE_NO_VALUE"); | |
| const useResetState = (createValue, deps = []) => { | |
| const [, triggerRerender] = useState(createValue); | |
| const stateRef = useRef(NO_VALUE_SYMBOL); | |
| const depsRef = useRef(deps); | |
| if (stateRef.current === NO_VALUE_SYMBOL) { | |
| stateRef.current = createValue(); | |
| } | |
| if (depsRef.current.some((value, index) => value !== deps[index])) { |
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
| /** | |
| * This is a Live Query polyfill, as graphql-js does not strictly have support for that. Instead, we leave it up to the | |
| * client to recognize a Live Query is requested with the `@live` directive on a `query` operation and here we | |
| * transform it into a `live` subscription instead. | |
| * | |
| * Consider a schema like the following: | |
| * | |
| * ```graphql | |
| type Badge { | |
| id: ID! |
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/react@16.0.0/umd/react.development.js"></script> | |
| <script src="https://unpkg.com/react-dom@16.0.0/umd/react-dom.development.js"></script> | |
| <script src="https://unpkg.com/babel-standalone@6.26.0/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
| 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
| const env = new Environment({ | |
| network, | |
| store, | |
| handlerProvider: RelayDefaultHandlerProvider, | |
| log: isDev ? relayTransactionLogger : null, | |
| }); | |
| if (isDev) { | |
| window.relayEnvironment = env; | |
| window.debugRelayStore = () => |
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
| #!/bin/bash | |
| # @author Adriano Rosa (http://adrianorosa.com) | |
| # @date: 2014-05-13 09:43 | |
| # | |
| # Bash Script to create a new self-signed SSL Certificate | |
| # At the end of creating a new Certificate this script will output a few lines | |
| # to be copied and placed into NGINX site conf | |
| # | |
| # USAGE: this command will ask for the certificate name and number in days it will expire |
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); |
OlderNewer