Skip to content

Instantly share code, notes, and snippets.

View snghnishant's full-sized avatar
👨‍💻
Grinding

Nishant Singh snghnishant

👨‍💻
Grinding
View GitHub Profile

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

@snghnishant
snghnishant / FizzBuzz.js
Last active October 7, 2020 03:49
FizzBuzz in JavaScript
function fizzbuzz(){
for(var i=1; i<=100; i++){
var myvar = "";
if(i%3 === 0) myvar += "Fizz";
if(i%5 === 0) myvar += "Buzz";
if(myvar == "") myvar = i;
console.log(myvar);
}
}
@snghnishant
snghnishant / sqrt.cpp
Created April 24, 2020 07:12
Newton Square Root
#include <iostream>
#include<math.h>
using namespace std;
int main() {
float guess, quotient, average{0};
int num, x{1};
cin>>num;
while(true){
if(pow(x,2)<=num){
guess = x;
@snghnishant
snghnishant / fibonacci.c
Created May 4, 2020 12:32
Fibonacci series up to n digits using recursion with linear runtime.
#include<stdio.h>
void fb(int n, int a, int b){
if(n<=0){
return ;
}
else if(n==1){
printf("%d\t", a);
return ;
}else{
printf("%d\t", a);
@snghnishant
snghnishant / web-development.md
Last active November 9, 2021 16:49
Deep dive into Web Development (MERN Stack)

Web Designing

  1. Basics of UI/UX with Figma/AdobeXD/Web Flow and Common Web Design Trends
  2. Difference between Wireframes, Mockups, Prototype in UI designing.
  3. HTML5
  4. CSS3
  5. Advanced CSS
  • CSS Functions
  • Flexbox
  • Gridbox
  • CSS Variables
@snghnishant
snghnishant / M001.md
Created May 15, 2020 16:12
MongoDB University - MongoDB Basics (M001)

Chapter 1

  • Opening mongodb shell without db instance mongo --nodb
@snghnishant
snghnishant / BookList.md
Last active November 17, 2020 18:25
Books, Online Courses, and Conferences.
@snghnishant
snghnishant / jsMethods.md
Last active May 30, 2020 11:34
JS Methods
  1. typeof value
  2. value.length
  3. parseInt(value)
  4. parseFloat(value)
  5. value.toFixed()
  6. value.toUpperCase()
  7. value.toLowerCase()
@snghnishant
snghnishant / c-sharp-101.md
Last active September 16, 2020 07:59
C# 101

Introduction to C#

Anatomy or structure of a C# program

/* A namespace is used to organise our classes and their methods in a herarchical manner.
This helps in avoiding method conflicts, suppose when two or more classes have same method
with different definition then we can mention explicitly their namespace.class.method for 
the method to use. */

using System; 
@snghnishant
snghnishant / FizzBuzz.c
Created October 7, 2020 03:48
FizzBuzz in C
#include <stdio.h>
#include <string.h>
int main(int argc, char **argv)
{
int i = 1;
while( i <= 100){
char str[10] = "";
if( i%3 == 0)
strcat(str, "Fizz");
if( i%5 == 0)