- docker container
- run --publish 80:80 --detch --name {custom_container_name} nginx
- ls [list all the running containers]
- ls -a [list all the containers installed]
- stop {container_id} {give upto 3 characters of the container} [Stops the running container]
- rm {container_id} [Remove the stoppped container]
- rm -f [Remove any container; stopped or running] [Not recommended]
- top (container_name) [displays the running process of the container]
- inspect (conatiner_name) [details of the container config]
This file contains 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
#include<bits/stdc++.h> | |
using namespace std; | |
void show(int arr[], int size){ | |
cout<<"\n"; | |
for(int i = 0; i < size; i++){ | |
cout<<arr[i]<<" "; | |
} | |
} | |
int getMax(int arr[], int size){ | |
int max = arr[0]; |
This file contains 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
#include<iostream> | |
using namespace std; | |
bool isSum(int set[], int size,int sum){ | |
bool subSet[size + 1][sum + 1]; | |
for(int i = 0; i <= size; i++){ | |
subSet[i][0] = true; | |
} | |
for(int i = 1; i <= sum; i++){ | |
subSet[0][i] = false; | |
} |
This file contains 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
/* | |
Write a BFS program using adjacency list and queue | |
*/ | |
#include<iostream> | |
#include<list> | |
#include<queue> | |
#include<stack> | |
using namespace std; | |
class Graph{ | |
private: |
This file contains 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
// the main app file | |
import express from "express"; | |
import loadDb from "./loadDb"; // dummy middleware to load db (sets request.db) | |
import authenticate from "./authentication"; // middleware for doing authentication | |
import permit from "./permission"; // middleware for checking if user's role is permitted to make request | |
const app = express(), | |
api = express.Router(); | |
// first middleware will setup db connection |
This file contains 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
BEGINNER'S GUIDE TO THE BASH TERMINAL | |
NAVIGATION | |
ls - list directory contents | |
pwd - print name of current/working directory | |
cd - change working directory | |
pushd/popd - put working directory on a stack | |
file - determine file type | |
locate - find files by name |
This file contains 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 PrivateRoute = ({ component: Component, ...args }) => { | |
// user is the authenticated user pulled from the React Context | |
const { user } = useContext(AuthContext); | |
return ( | |
<Route | |
{...args} | |
render={props => { | |
return user ? ( | |
<Component {...props} /> |
This file contains 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
find . -maxdepth 2 -name node_modules -type d -mtime +60 -exec rm -rf {} \; |
It was a pain for me to figure out how to debug TS in VSCode. Creating this doc for my reference and it might help you as well.
"sourceMap": true, /* SUPER-DUPER Important Generates corresponding '.map' file. */
"outFile": "./", /* Concatenate and emit output to single file. */
This file contains 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
{ | |
"recommendations": [ | |
"dbaeumer.vscode-eslint", | |
"esbenp.prettier-vscode", | |
"VisualStudioExptTeam.vscodeintellicode", | |
"johnpapa.vscode-peacock" | |
] | |
} |
OlderNewer