Do this in the REPL mode:
console.log ( require('repl')._builtinLibs );
Or put this line of code in your app.js file and execute:
console.log ( require('repl')._builtinLibs ); return;
You can find the same question [here][1] I just encountered this error:
Server is running on port: 5000
MongoServerError: bad auth : Authentication failed.
at Connection.onMessage (/home/mostafa/documents/local-repositories/mern-mongodb-tutorial/server/node_modules/mongodb/lib/cmap/connection.js:202:30)
at MessageStream.<anonymous> (/home/mostafa/documents/local-repositories/mern-mongodb-tutorial/server/node_modules/mongodb/lib/cmap/connection.js:62:60)
at MessageStream.emit (node:events:527:28)
at processIncomingData (/home/mostafa/documents/local-repositories/mern-mongodb-tutorial/server/node_modules/mongodb/lib/cmap/message_stream.js:108:16)
at MessageStream._write (/home/mostafa/documents/local-repositories/mern-mongodb-tutorial/server/node_modules/mongodb/lib/cmap/message_stream.js:28:9)
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
import React from 'react'; | |
import ReactDOM from 'react-dom/client'; | |
const root = ReactDOM.createRoot(document.getElementById("root")); | |
const element = <h1> Hello, world </h1>; | |
root.render(element); |
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
// link to the main tweet: https://twitter.com/iam_vee/status/1517357609170386944?s=20&t=MN3UgYbDae5NCTSoeh5mzg | |
var sum = 0, counter = 0, | |
maxTries = 1000_000; | |
for (let i = 1; i <= maxTries; i++) { | |
counter++; | |
while (1) { | |
sum++; | |
if (gimmeRand1to6() == 6) break; | |
} | |
} |
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
// Link to main question ==> https://twitter.com/Loc0m0/status/1508697606716764162?s=20&t=Ziozpzj6KIznNArdT9n3xQ | |
const splicer = function () { | |
let accumulator = ""; | |
for (let i = 1; i <= 100_000; i++) { | |
accumulator = accumulator + "0" + i.toString(); | |
} | |
let arrayOfStrings = accumulator.split("0"); | |
let arrayOfNumbers = arrayOfStrings.map(Number); | |
let result = arrayOfNumbers.reduce((sum, current) => sum + current, 0); | |
console.log(result); |
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
# .bashrc | |
# Source global definitions | |
if [ -f /etc/bashrc ]; then | |
. /etc/bashrc | |
fi | |
# User specific environment | |
if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]] | |
then |
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
$ sudo dnf install libatomic | |
$ sudo ./v symlink |
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
set nocompatible " be iMproved, required | |
set autochdir " when making new file, the pwd is the path. not the root. | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" alternatively, pass a path where Vundle should install plugins | |
"call vundle#begin('~/some/path/here') |
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
let s = "*"; | |
for (; s.length < 99; s = "*" + s) | |
console.log(s); |
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 readline = require("readline"); | |
const rl = readline.createInterface({ | |
input: process.stdin, | |
output: process.stdout, | |
}); | |
// ask user for the name input | |
rl.question(`What Fibbonacci sentence do you want to calculate? `, (last_fibbo_sentence) => { |