Skip to content

Instantly share code, notes, and snippets.

View IcedMonk's full-sized avatar
:octocat:
Focusing

Samyek IcedMonk

:octocat:
Focusing
View GitHub Profile
@IcedMonk
IcedMonk / nextjs.md
Created May 28, 2024 07:56
NextJS 14

Next 14

Dynamic Routing

  • IF we want dynamic route such as /products/:productId then we write that in a [] as a folder name

products > [productId]

  • To get the productId in page.tx which is inside the [productId] we get the paramater(params) in the component
export default function ProductDetails({
        params,

Mongo, Postgres, Mssql with Ngnix as a Docker Container

# docker-compose
version: '3.1'
services:

  # MySQL database
  mysql:
    image: mysql:8.0
@IcedMonk
IcedMonk / Docker_ngnix_nodejs.md
Created October 4, 2023 08:42
Docker_ngnix_nodejs

Adding Certificate to Docker App

  • This is my docker compose
version: "3"
services:
  bot:
    build: .
    ports:
      - "3000:3000"
@IcedMonk
IcedMonk / ProblemSolver.md
Created September 1, 2023 08:31
Host React app to Apache server

React app to Shared Hosting

this senario is for when the react app using react-router-dom shows this type of error on refresh, in apache server

React error image

By default, CRA produces a build assuming your app is hosted at the server root. To override this, Specify the homepage in you package.json

{
@IcedMonk
IcedMonk / reactRouterUsage.md
Last active September 1, 2023 10:34
My way of using react-router-dom

My React-Router-Dom Setup

In main or index file

import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App.jsx";

// react router import
import { BrowserRouter } from "react-router-dom";
@IcedMonk
IcedMonk / Preview.md
Last active September 26, 2023 11:05
My way of using Redux RTK with React.js

RTK Setup

  • Install this 2 packages
    • react-redux
    • @reduxjs/toolkit

Create store in src > app with file name store.js

import { configureStore } from "@reduxjs/toolkit";
import dashboardReducer from "../features/dashboard/dashboardSlice";
  • To run the Apache server in my machine, on port 8080(named it apache) and the path with my name is the project path which i want to host
docker run --name apache -p 8080:80 -v /Users/samyeksonawane/Documents/Apache:/usr/local/apache2/htdocs -d httpd
  • If I wish to remove the image after stopping it I will add the rm to it
docker run --rm --name apache -p 8080:80 -v /Users/samyeksonawane/Documents/Apache:/usr/local/apache2/htdocs -d httpd
  • To run the mongodb server in my machine, on port 27017(named it mongo) and the path is to store the data in my local machine

SQL (Structured Query Language)

  • RDBMS (Relational Database Management System)
  1. MySQL
  2. Oracle
  3. MS access, etc
SQL MYSQL
@IcedMonk
IcedMonk / DockerMechanics.md
Last active January 22, 2025 10:14
A brief & detailed instructions for docker learners, with hands on examples. Become starter to professional in docker

Docker Mechanics icedMonk

  • The Basic command to start the docker container

Docker run <image name>

  • The docker run command includes 2 command docker create + docker start

docker run = rocker create + docker start

@IcedMonk
IcedMonk / EndPoint.md
Last active March 13, 2021 09:10
This is the documentation for the API

The API endpoints to be created

The API reference documentation is The TMDB website


  • /configuration -> For more info here
  • /genre/movie/list -> For more information here
  • /discover/movie -> Required paramaters are with_genres, with_cast, page, sort_by For more information click here
  • /movie/${movie_id} -> Required paramaters are append_to_response The movie_id here is the variable which is passed to fetch particular movie, for more information here