Setup:
$ mongo
> use pubsub
> db.createCollection('messages', { capped: true, size: 100000 })
> db.messages.insert({})
$ npm install mongodb
Register:
// Add this code snippet to your settings.json file: | |
"emmet.includeLanguages": { | |
"javascript": "javascriptreact" | |
}, | |
"emmet.triggerExpansionOnTab": true |
// I used Datagrip in my crash course, but you can use the mongodb shell and you'll ge tthe same results. | |
//Friday, 18th June, 2021 | |
//mongoDB basic commands and queries | |
//To show all databases | |
show dbs | |
//To switch(choose) a database | |
use sampleDatabase |
Setup:
$ mongo
> use pubsub
> db.createCollection('messages', { capped: true, size: 100000 })
> db.messages.insert({})
$ npm install mongodb
Register:
// Procedure
**Stop the container(s) using the following command:
docker-compose down
**Delete all containers using the following command:
docker rm -f $(docker ps -a -q)
# Program to display the Fibonacci sequence up to n-th term | |
nterms = int(input("How many terms? ")) | |
# first two terms | |
n1, n2 = 0, 1 | |
count = 0 | |
# check if the number of terms is valid | |
if nterms <= 0: |
for fizzbuzz in range(51): | |
if fizzbuzz % 3 == 0 and fizzbuzz % 5 == 0: | |
print("fizzbuzz") | |
continue | |
elif fizzbuzz % 3 == 0: | |
print("fizz") | |
continue | |
elif fizzbuzz % 5 == 0: | |
print("buzz") | |
continue |
First, delete package-lock.json and node modules | |
Second, run the command : npm cache clean --force | |
Next, run the command : npm install | |
Finally, you should be able to run your react server : npm start |
Overview of nano's shortcuts | |
The editor's keystrokes and their functions | |
File handling | |
Ctrl+S Save current file | |
Ctrl+O Offer to write file ("Save as") | |
Ctrl+R Insert a file into current one | |
Ctrl+X Close buffer, exit from nano | |
Editing |
set tabsize 4 | |
set tabstospaces | |
set autoindent | |
set trimblanks | |
set linenumbers | |
set constantshow | |
set titlecolor white,green | |
set keycolor cyan | |
set functioncolor cyan | |
set numbercolor yellow |
# Get editor completions based on the config schema | |
"$schema" = 'https://starship.rs/config-schema.json' | |
# Inserts a blank line between shell prompts | |
add_newline = true | |
# Replace the '❯' symbol in the prompt with '➜' | |
[character] # The name of the module we are configuring is 'character' | |
success_symbol = '[➜](bold green)' # The 'success_symbol' segment is being set to '➜' with the color 'bold green' | |
error_symbol = "[✖](bold red) " |