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 / booking.sql
Last active January 28, 2023 18:35
MySQL Cheat Sheet
-- Simulate creating booking.com database
SHOW DATABASES;
CREATE DATABASE booking_company;
USE booking_company;
SELECT DATABASE ();
SHOW CREATE DATABASE booking_company;
-- create guests table
CREATE TABLE guests (
id INT NOT NULL AUTO_INCREMENT,
@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 / cheatSheet.docker
Last active May 4, 2023 06:30
Docker Cheat Sheet
Container Management Commands
// docker create image [Create the container]
// docker run image [start the image]
// docker start container [start the container]
// docker stop container [graceful stop]
// docker kill container [kill container]
// docker restart container [stop + start]
// docker pause container [suspends container]
// docker unpause container [resume container]
@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 / 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 / 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