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 main = async () => { | |
try { | |
// Initialise prompt with an empty message | |
+ prompt.start(); | |
+ prompt.message = ''; | |
// Turn prompt.get() into a promise | |
+ const get = util.promisify(prompt.get); | |
// Create a schema to validate user input |
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 { ChatManager, TokenProvider } = require('@pusher/chatkit') | |
const { JSDOM } = require('jsdom') | |
const util = require('util') | |
+ const prompt = require('prompt') | |
... |
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 {ChatManager, TokenProvider} = require('@pusher/chatkit'); | |
const {JSDOM} = require('jsdom'); | |
const util = require('util'); | |
const makeChatkitNodeCompatible = () => { | |
const {window} = new JSDOM(); | |
global.window = window; | |
global.navigator = {}; | |
}; |
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 express = require("express"); | |
const bodyParser = require("body-parser"); | |
const cors = require("cors"); | |
const Chatkit = require("@pusher/chatkit-server"); | |
const app = express(); | |
const chatkit = new Chatkit.default({ | |
instanceLocator: "YOUR_INSTANCE_LOCATOR", | |
key: "YOUR_KEY" |
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 nginx:latest | |
COPY ./default.conf /etc/nginx/conf.d/default.conf | |
COPY ./about.json /var/www/about.json | |
EXPOSE 80 |
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
image: my.registry/hugo/now-image:latest | |
stages: | |
- review | |
variables: | |
REPO_NAME: now-review-app | |
start_review: | |
stage: review |
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
image: docker:latest | |
variables: | |
DOCKER_DRIVER: overlay | |
services: | |
- docker:dind | |
stages: | |
- push |
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:alpine | |
RUN npm install -g --silent --unsafe-perm now |
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
image: node | |
stages: | |
- review | |
variables: | |
REPO_NAME: now-review-app | |
start_review: | |
stage: review |
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
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key | |
# that enables you to choose a character from a menu of options. If you are on Lion | |
# try it by pressing and holding down 'e' in any app that uses the default NSTextField | |
# for input. | |
# | |
# It's a nice feature and continues the blending of Mac OS X and iOS features. However, | |
# it's a nightmare to deal with in Atom if you're running vim mode, | |
# as it means you cannot press and hold h/j/k/l to move through your file. You have | |
# to repeatedly press the keys to navigate. |