This file contains 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 { 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) { |
This file contains 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
// 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); | |
json | |
.filter(entry => entry.messages.length) |
This file contains 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 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 |
This file contains 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
function (user, context, callback) { | |
const namespace = 'https://grateful.digital/'; | |
if ( | |
user.app_metadata && | |
user.app_metadata.refresh_token_encrypted | |
) { | |
const refreshTokenEncrypted = user.app_metadata.refresh_token_encrypted; | |
context.idToken[namespace + 'refresh_token_encrypted'] = refreshTokenEncrypted; | |
} |
This file contains 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 cors = require('cors'); | |
const express = require('express'); | |
const corsConfig = { | |
optionsSuccessStatus: 200, | |
origin: ['http://localhost:3000', 'http://localhost:8000'] | |
} | |
app = express(); |
This file contains 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
<blockquote class="instagram-media" data-instgrm-captioned data-instgrm-version="7" style=" background:#FFF; border:0; border-radius:3px; box-shadow:0 0 1px 0 rgba(0,0,0,0.5),0 1px 10px 0 rgba(0,0,0,0.15); margin: 1px; max-width:658px; padding:0; width:99.375%; width:-webkit-calc(100% - 2px); width:calc(100% - 2px);"> | |
<div style="padding:8px;"> | |
<div style=" background:#F8F8F8; line-height:0; margin-top:40px; padding:62.5% 0; text-align:center; width:100%;"> | |
<div style=" background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAMAAAApWqozAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAMUExURczMzPf399fX1+bm5mzY9AMAAADiSURBVDjLvZXbEsMgCES5/P8/t9FuRVCRmU73JWlzosgSIIZURCjo/ad+EQJJB4Hv8BFt+IDpQoCx1wjOSBFhh2XssxEIYn3ulI/6MNReE07UIWJEv8UEOWDS88LY97kqyTliJKKtuYBbruAyVh5wOHiXmpi5we58Ek028czwyuQdLKPG1Bkb4NnM+VeAnfHqn1k4+GPT6uGQcvu2h2OVuIf/gWUFyy8OWEpdyZSa3aVCqpVoVvzZZ2VTnn2wU8qzVjDDetO90GSy9mVLqtgYSy231MxrY6I2gGqjrTY0L8fxCxfCBbhWrsYYAAAAAElFTkSuQmCC); display:block; height:44px; margin:0 auto -44px; |
This file contains 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
{ | |
"eslintConfig": { | |
"parserOptions": { | |
"ecmaFeatures": { | |
"jsx": true | |
} | |
}, | |
"env": { | |
"browser": true, | |
"es6": true, |
This file contains 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
# Open browser and submit PR for current branch against master | |
pr () { | |
local repo=`git remote -v | grep -m 1 "(push)" | sed -e "s/.github.com[:/]\(.*/)\.git.*/\1/"` | |
local branch=`git name-rev --name-only HEAD` | |
echo "... creating pull request for branch \"$branch\" in \"$repo\"" | |
open https://github.com/$repo/pull/new/$branch | |
} |
This file contains 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
FROM node:lts | |
# Copy the working directory | |
RUN mkdir /usr/src/app | |
WORKDIR /usr/src/app | |
COPY . /usr/src/app | |
RUN npm ci --no-progress | |
RUN npm run build --if-exists | |
# Exposes a port to other containers but your app may use any port specified in it |