Server
const { ProxyAgent, fetch: fetchWithProxy } = require('undici');
const proxyAgent = new ProxyAgent(process.env.HTTP_PROXY);
const main = async () => {
try {
const res = await fetchWithProxy('https://api.ipify.org?format=json', {Server
const { ProxyAgent, fetch: fetchWithProxy } = require('undici');
const proxyAgent = new ProxyAgent(process.env.HTTP_PROXY);
const main = async () => {
try {
const res = await fetchWithProxy('https://api.ipify.org?format=json', {| const { chromium } = require('playwright'); | |
| const fs = require('fs'); | |
| const generateFromURL = async (url, outputPath, options = {}) => { | |
| const browser = await chromium.launch(); | |
| const page = await browser.newPage(); | |
| const defaultOptions = { | |
| format: 'A4', | |
| printBackground: true, |
Typing vagrant from the command line will display a list of all available commands.
Be sure that you are in the same directory as the Vagrantfile when running these commands!
vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)| var db = mongoose.connect('mongodb://localhost:27017/DB'); | |
| // In middleware | |
| app.use(function (req, res, next) { | |
| // action after response | |
| var afterResponse = function() { | |
| logger.info({req: req}, "End request"); | |
| // any other clean ups |
| "use strict"; | |
| // Future versions of Hyper may add additional config options, | |
| // which will not automatically be merged into this file. | |
| // See https://hyper.is#cfg for all currently supported options. | |
| module.exports = { | |
| config: { | |
| // choose either `'stable'` for receiving highly polished, | |
| // or `'canary'` for less polished but more frequent updates | |
| updateChannel: 'stable', | |
| // default font size in pixels for all tabs |
mix3d asked for some help using this guide with windows so here we go. This was tested with Windows 10. Run all commands in Git Bash once it's installed.
Github will be the main account and bitbucket the secondary.
| const AWS = require('aws-sdk'); | |
| const CognitoSDK = require('amazon-cognito-identity-js-node'); | |
| AWS.CognitoIdentityServiceProvider.AuthenticationDetails = CognitoSDK.AuthenticationDetails; | |
| AWS.CognitoIdentityServiceProvider.CognitoUserPool = CognitoSDK.CognitoUserPool; | |
| AWS.CognitoIdentityServiceProvider.CognitoUser = CognitoSDK.CognitoUser; | |
| const Username = 'testuser'; | |
| const TempPassword = 'TemporaryPassword2!'; | |
| const NewPassword = 'NewPassword@#@!19'; | |
| const Email = 'some@email.com'; |
| const axios = require('axios'); | |
| const fs = require('fs/promises'); | |
| const main = async () => { | |
| const { data } = await axios.get('API_ENDPOINT'); | |
| const tableOfContents = data.instance.details.toc.categories.map(item => { | |
| return item.title; | |
| }); |
| const asyncWrap = promise => promise.then(result => [null, result]).catch(err => [err]) | |
| const func = async () => { | |
| const [error, result] = await asyncWrap(doAsyncThing()) | |
| } |