- Install prettier
- Make a .prettierignore file, and add directories you'd like prettier to not format, for example:
**/node_modules
- Run
prettier --write "**/*.js"
*Don't forget the quotes. - Optional: if you want to format JSON/SCSS files too, replace js with json/scss.
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
{ | |
"targets": [ | |
{ | |
"target_name": "example_addon", | |
"sources": [ "example_addon.c" ], | |
"include_dirs": [ "<!@(node -p \"require('node-addon-api').include\")" ], | |
"dependencies": [ "<!@(node -p \"require('node-addon-api').gyp\")" ] | |
} | |
] | |
} |
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
# Author: Zameer Ansari | |
# You should look at the following URL's in order to grasp a solid understanding | |
# of Nginx configuration files in order to fully unleash the power of Nginx. | |
# http://wiki.nginx.org/Pitfalls | |
# http://wiki.nginx.org/QuickStart | |
# http://wiki.nginx.org/Configuration | |
# | |
# Generally, you will want to move this file somewhere, and start with a clean | |
# file but keep this around for reference. Or just disable in sites-enabled. | |
# |
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
Benchmark: ""pino"" is the fastest. | |
- winston1 faster than winston2 by 1.1696 | |
- winston3 faster than winston1 by 1.5686 | |
- bunyan faster than winston1 by 1.0245 | |
- pino faster than winston1 by 1.8904 | |
- winston3 faster than winston2 by 1.8347 | |
- bunyan faster than winston2 by 1.1983 | |
- pino faster than winston2 by 2.2109 | |
- winston3 faster than bunyan by 1.5311 | |
- pino faster than winston3 by 1.2051 |
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
FROM golang:1.9 | |
WORKDIR /go/src/github.com/purplebooth/example | |
COPY . . | |
RUN go build -ldflags "-linkmode external -extldflags -static" -a main.go | |
FROM scratch | |
COPY --from=0 /go/src/github.com/purplebooth/example/main /main | |
CMD ["/main"] |
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 fastify = require('fastify'); | |
function init(serverFactory) { | |
const app = fastify({ serverFactory }); | |
app.get('/', (request, reply) => reply.send({ hello: 'world' })); | |
return app; | |
} | |
if (require.main === module) { | |
// called directly i.e. "node app" |
- 13" Macbook Pro 3.3 GHz i7 (late 2016)
- Microsoft Surface Book (2016)
- Dell up3216q 32" monitor
You can install Node Nightlies/RCs via nvm using NVM_NODEJS_ORG_MIRROR
environment variable.
Install latest Node RC
NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/rc/ nvm i node
Install latest Node.js Nightly
NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/nightly/ nvm i node
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
/******************************************************************************* | |
* Copyright (c) 2017 Nicola Del Gobbo | |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | |
* use this file except in compliance with the License. You may obtain a copy of | |
* the license at http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS | |
* OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY | |
* IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, | |
* MERCHANTABLITY OR NON-INFRINGEMENT. |