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 {Response, NextFunction} from 'express' | |
| interface SomeRequest { | |
| body: { | |
| data: number[] | |
| } | |
| } | |
| const someRouteHandler = (req: SomeRequest, res: Response, next: NextFunction) => { | |
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 Circos, { Heatmap, Line } from 'react-circos' | |
| const MyCircos = () => ( | |
| <Circos> | |
| <Heatmap data={heatmapData} /> | |
| <Line data={lineData} /> | |
| </Circos> | |
| ) |
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 npmCheck = require('npm-check') | |
| const states = [ | |
| { | |
| title: '🤔 Major update available', | |
| filter: item => item.bump === 'major', | |
| text: item => `${item.moduleName}: ${item.installed} → ${item.latest}`, | |
| color: 'danger' | |
| }, | |
| { |
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 options = { | |
| stats: 'my_app.node_api', | |
| response_code: true, | |
| tags: ['my_app:node_api'] | |
| } | |
| app.use(require('connect-datadog')(options)) |
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 ErrorStackParser = require('error-stack-parser') | |
| const Slack = require('slack-node') | |
| const config = require('../config') | |
| const packageJson = require('../../package.json') | |
| const slack = new Slack() | |
| slack.setWebhook(config.slackHookUrl) | |
| module.exports = (err, req, res, next) => { |
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 Raven from 'raven-js' | |
| import config from './config' | |
| if (config.RAVEN_ENDPOINT) { | |
| Raven.config(config.RAVEN_ENDPOINT, {release: process.env.REACT_APP_RELEASE}).install() | |
| } |
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
| { | |
| "scripts": { | |
| "build": "REACT_APP_RELEASE=$(git rev-parse HEAD) react-scripts build" | |
| } | |
| } |
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
| elif [ "${CIRCLE_BRANCH}" == "master" ]; then | |
| export SENTRY_AUTH_TOKEN=xxx | |
| curl -sL https://sentry.io/get-cli/ | bash | |
| # `git rev-parse HEAD` return the hash of last commit and is used as release id | |
| RELEASE_ID=$(git rev-parse HEAD) | |
| # create new sentry release | |
| sentry-cli releases -o my-account -p my-app new $RELEASE_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
| import Raven from 'raven-js' | |
| import config from './config' | |
| if (config.RAVEN_ENDPOINT) { | |
| Raven.config(config.RAVEN_ENDPOINT).install() | |
| } |
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 setFullStoryIdentity = (user) => { | |
| if (!window.FS) return | |
| window.FS.identify(user.id, { | |
| displayName: `${user.firstName} ${user.lastName}`, | |
| email: user.email | |
| }) | |
| } |
NewerOlder