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 controller = new AbortController() | |
| const signal = controller.signal | |
| setTimeout(() => { | |
| controller.abort() | |
| }, 1000) | |
| fetch(url, { signal }) |
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
| gainResult(fn) { | |
| return Promise.race([ | |
| new Promise(resolve => { | |
| try { | |
| const ret = fn((err, result) => { | |
| if (err) { | |
| resolve({ | |
| type: "async", | |
| error: err.message | |
| }); |
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 | |
| cd dist | |
| shopt -s nullglob | |
| for f in *.map | |
| do | |
| echo "uploading $f to New Relic" | |
| publish-sourcemap $f $SCHUMACHER_CLIENT_ROOT --applicationId=238312787 --nrAdminKey=$NEW_RELIC_ADMIN_KEY | |
| done | |
| cd - |
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
| { | |
| "version": 2, | |
| "name": "phmt.me", | |
| "builds": [ | |
| { "src": "package.json", "use": "@now/static-build", "config": { "distDir": "build" } } | |
| ], | |
| "routes": [ | |
| { "src": "/static/(.*)", "headers": { "cache-control": "s-maxage=31536000,immutable" }, "dest": "/static/$1" }, | |
| { "src": "/favicon.ico", "dest": "/favicon.ico" }, | |
| { "src": "/asset-manifest.json", "dest": "/asset-manifest.json" }, |
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 c/src/ui/form/InputField.css i/src/ui/form/InputField.css | |
| index 088fbc98..7946478e 100644 | |
| --- c/src/ui/form/InputField.css | |
| +++ i/src/ui/form/InputField.css | |
| @@ -4,13 +4,24 @@ | |
| width: 100%; | |
| } | |
| -.inputField-input[type="text"] { | |
| +.inputField-input[type="text"], |
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 transform from 'transform-keys' | |
| // https://github.com/bjoerge/transform-keys#custom-key-transformers | |
| export function camelify(obj) { | |
| return transform(obj, (key) => { | |
| return key.replace(/_([a-z])/ig, (_, $1) => { | |
| return $1.toUpperCase() | |
| }) | |
| }) | |
| } |
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
| ARNING in ./stories/ButtonGroup_story.js | |
| Module build failed: SyntaxError: Unexpected token (9:19) | |
| at Parser.pp$4.raise (/Users/dmarr/code/schumacher/node_modules/@storybook/addon-storysource/node_modules/acorn/dist/acorn.js:2748:13) | |
| at Parser.pp.unexpected (/Users/dmarr/code/schumacher/node_modules/@storybook/addon-storysource/node_modules/acorn/dist/acorn.js:644:8) | |
| at Parser.pp.expect (/Users/dmarr/code/schumacher/node_modules/@storybook/addon-storysource/node_modules/acorn/dist/acorn.js:638:26) | |
| at Parser.pp$3.parseMethod (/Users/dmarr/code/schumacher/node_modules/@storybook/addon-storysource/node_modules/acorn/dist/acorn.js:2521:8) | |
| at Parser.pp$1.parseClassMethod (/Users/dmarr/code/schumacher/node_modules/@storybook/addon-storysource/node_modules/acorn/dist/acorn.js:1308:23) | |
| at Parser.parseClassMethod (/Users/dmarr/code/schumacher/node_modules/acorn-class-fields/inject.js:104:23) | |
| at Parser.pp$1.parseClassMember (/Users/dmarr/code/schumacher/node_modules/@storybook/addon-storysou |
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 path = require('path'); | |
| const OpenBrowserPlugin = require('open-browser-webpack-plugin'); | |
| /* | |
| * Storybook Webpack FULL CONTROL MODE | |
| * | |
| * extend carefully, please read the docs! | |
| * https://storybook.js.org/configurations/custom-webpack-config/#full-control-mode | |
| * | |
| * @param {object} config - the default Storybook webpack config object |
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
| export const getTaxAmount = (rate, total) => { | |
| const totalCents = parseInt(total * 100, 10); | |
| const tax = Math.round(totalCents / (1 + rate) * rate); | |
| return { | |
| subtotal: (totalCents - tax) / 100, | |
| tax: tax / 100, | |
| total, | |
| }; | |
| }; |
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
| app.use(bodyParser.raw({ | |
| type: function () { | |
| return true; | |
| }, limit: '5mb' | |
| })); |