Skip to content

Instantly share code, notes, and snippets.

View BekBrace's full-sized avatar
💻
Star it before you Fork it!

Bek Brace BekBrace

💻
Star it before you Fork it!
View GitHub Profile
@BekBrace
BekBrace / settings.json
Last active November 27, 2021 10:38
JSX/HTML autocomplete in your React projects
// Add this code snippet to your settings.json file:
"emmet.includeLanguages": {
"javascript": "javascriptreact"
},
"emmet.triggerExpansionOnTab": true
@BekBrace
BekBrace / Mongodbcs.db
Last active April 20, 2022 14:38
MongoDB Cheat Sheet
// 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
@BekBrace
BekBrace / Readm.md
Last active April 20, 2022 14:43
Pub/sub with MongoDB and Node.js

Setup:

$ mongo
> use pubsub
> db.createCollection('messages', { capped: true, size: 100000 })
> db.messages.insert({})

$ npm install mongodb

Register:

@BekBrace
BekBrace / restart_docker_instance.md
Last active April 21, 2022 07:32
How to Do a Clean Restart of a Docker Instance

// 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)

@BekBrace
BekBrace / fibonacci.py
Created May 30, 2022 06:13
Fibonacci sequence in Python
# 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:
@BekBrace
BekBrace / fizzbuzz.py
Created May 30, 2022 06:14
FizzBuzz in Python
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
@BekBrace
BekBrace / fix.txt
Last active June 26, 2022 07:00
Fixing React Error : This is probably not a problem with npm. There is likely additional logging output above.
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
@BekBrace
BekBrace / nano editor cheatsheet
Created August 7, 2022 06:35
nano editor cheatsheet
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
@BekBrace
BekBrace / nano.config
Last active August 7, 2022 06:36
config for nano editor
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
@BekBrace
BekBrace / starship.toml
Created December 23, 2022 09:59
This is my starship.toml config file for starship ( A cross-shell prompt [love it because it's minimal] )
# 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) "