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
// Having the condition start on a newline is not readable | |
const availabilityStartDate = | |
availability.startDate ? DateTime.fromJSDate(availability.startDate, { zone: 'utc' }) : DateTime.now().toUTC(); | |
// Previously it was much more readable: | |
const availabilityStartDate = availability.startDate | |
? DateTime.fromJSDate(availability.startDate, { zone: "utc" }) | |
: DateTime.now().toUTC(); | |
///////////////////////////////////////////////////////////// |
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
module.exports = { | |
root: true, | |
parser: '@typescript-eslint/parser', | |
plugins: [ | |
'@typescript-eslint', | |
], | |
overrides: [ | |
{ | |
files: ['*.graphql'], | |
extends: ['plugin:@graphql-eslint/schema-recommended'], |
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
{ | |
"type": "module", | |
"devDependencies": { | |
"@types/mongoose": "5.5.39", | |
"typescript": "3.7.4" | |
}, | |
"dependencies": { | |
"@typegoose/typegoose": "6.2.0", | |
"mongoose": "5.8.3" | |
} |
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
type Bar = { bar: number }; | |
const test = { bar: 123 } as Bar; | |
test.bar; |
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
{ | |
"name": "jest-test", | |
"version": "1.0.0", | |
"main": "index.js", | |
"license": "MIT", | |
"devDependencies": { | |
"jest": "24.1.0", | |
"nock": "10.0.6", | |
"weak": "1.0.1" | |
} |
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 requireSoSlow = require('require-so-slow'); | |
process.env.PROVIDER_NAME = 'webshows'; | |
require('./bin/serve'); | |
process.on('SIGTERM', () => { | |
requireSoSlow.write('rss.trace'); | |
}); |
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 winston = require('winston'); | |
const { combine, printf, splat } = winston.format; | |
const customFormat = combine( | |
splat(), | |
printf((info) => JSON.stringify(info)) | |
); | |
const logger = winston.createLogger({ | |
transports: [ |
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
diff --git a/package.json b/package.json | |
index 6a694e4..3dbaf84 100644 | |
--- a/package.json | |
+++ b/package.json | |
@@ -42,9 +42,7 @@ | |
"@babel/core": "^7.0.0", | |
"@babel/plugin-syntax-jsx": "^7.0.0", | |
"@babel/plugin-transform-modules-commonjs": "^7.0.0", | |
- "babel-core": "^7.0.0-bridge.0", | |
"babel-eslint": "^9.0.0", |
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 _ = require('lodash'); | |
const mongoose = require('mongoose'); | |
const Benchmark = require('benchmark'); | |
const { ObjectId } = mongoose.Types; | |
const isObjectId = (id) => id instanceof ObjectId; | |
function withCond(props, value) { | |
return _.cond([ |
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 fs = require('fs'); | |
const sharp = require('sharp'); | |
const axios = require('axios'); | |
const URL = | |
'http://static.megaphone.fm/podcasts/05f71746-a825-11e5-aeb5-a7a572df575e/image/uploads_2F1516902193862-jqkml22bswo-cee641b4533ddb31a5a7ab656fe45116_2FCURRENT_Reply+All+Logo.png'; | |
function time(hrtime) { | |
const nanoseconds = hrtime[0] * 1e9 + hrtime[1]; | |
const seconds = nanoseconds / 1e9; |
NewerOlder