Skip to content

Instantly share code, notes, and snippets.

import {Response, NextFunction} from 'express'
interface SomeRequest {
body: {
data: number[]
}
}
const someRouteHandler = (req: SomeRequest, res: Response, next: NextFunction) => {
@nicgirault
nicgirault / index.js
Created July 4, 2018 21:58
What could be react-circos
import Circos, { Heatmap, Line } from 'react-circos'
const MyCircos = () => (
<Circos>
<Heatmap data={heatmapData} />
<Line data={lineData} />
</Circos>
)
@nicgirault
nicgirault / index.js
Last active February 24, 2018 15:44
Visualise dependencies updates in Slack #techdebtviz #slack
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'
},
{
const options = {
stats: 'my_app.node_api',
response_code: true,
tags: ['my_app:node_api']
}
app.use(require('connect-datadog')(options))
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) => {
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()
}
{
"scripts": {
"build": "REACT_APP_RELEASE=$(git rev-parse HEAD) react-scripts build"
}
}
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
import Raven from 'raven-js'
import config from './config'
if (config.RAVEN_ENDPOINT) {
Raven.config(config.RAVEN_ENDPOINT).install()
}
@nicgirault
nicgirault / fullstory-2.js
Last active December 16, 2017 10:14
fullstory-2.js
export const setFullStoryIdentity = (user) => {
if (!window.FS) return
window.FS.identify(user.id, {
displayName: `${user.firstName} ${user.lastName}`,
email: user.email
})
}