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 { MongoClient, type Document } from "mongodb"; | |
const uri = | |
"<insert_your_uri>"; | |
const client = new MongoClient(uri); | |
await client.connect(); | |
const database = client.db("freecodecamp"); | |
const usersCollection = database.collection("user"); | |
const usersNewCollection = database.collection("user_new"); |
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
# Place file within Windows' root user | |
[wsl2] | |
memory=24GB |
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
# Enable the subsequent settings only in interactive sessions | |
case $- in | |
*i*) ;; | |
*) return;; | |
esac | |
# Path to your oh-my-bash installation. | |
export OSH='/home/shauh/.oh-my-bash' | |
# Set name of the theme to load. Optionally, if you set this to "random" |
First, you'll need to download and install the freeCodeCamp Courses VSCode extension.
Then, in an empty workspace, open the VSCode command palette with Ctrl/Cmd + Shift + P
.
Select the command freeCodeCamp: Open Course
.
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
$(document).ready(function () { | |
/*global io*/ | |
let socket = io(); | |
socket.on('user', data => { | |
$('#num-users').text(data.currentUsers + ' users online'); | |
let message = | |
data.username + | |
(data.connected ? ' has joined the chat.' : ' has left the chat.'); | |
$('#messages').append($('<li>').html('<b>' + message + '</b>')); |
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
$(document).ready(function () { | |
/* Global io */ | |
let socket = io(); | |
socket.on('user', (data) => { | |
$('#num-users').text(data.currentUsers + ' users online'); | |
let message = data.username + (data.connected ? ' has joined the chat.' : ' has left the chat.'); | |
$('#messages').append($('<li>').html('<b>' + message + '</b>')); | |
}); |
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
'use strict'; | |
require('dotenv').config(); | |
const express = require('express'); | |
const myDB = require('./connection'); | |
const fccTesting = require('./freeCodeCamp/fcctesting.js'); | |
const session = require('express-session'); | |
const passport = require('passport'); | |
const routes = require('./routes.js'); | |
const auth = require('./auth.js'); |
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
'use strict'; | |
require('dotenv').config(); | |
const express = require('express'); | |
const myDB = require('./connection'); | |
const fccTesting = require('./freeCodeCamp/fcctesting.js'); | |
const session = require('express-session'); | |
const passport = require('passport'); | |
const routes = require('./routes.js'); | |
const auth = require('./auth.js'); |
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
$(document).ready(function () { | |
/*global io*/ | |
let socket = io(); | |
socket.on('user count', function (data) { | |
console.log(data); | |
}); | |
// Form submittion with new message in field with id 'm' | |
$('form').submit(function () { |
NewerOlder