Skip to content

Instantly share code, notes, and snippets.

View MHJahanbakhsh's full-sized avatar
💭
I may be slow to respond.

MohammadHossein Jahanbakhsh MHJahanbakhsh

💭
I may be slow to respond.
  • iran
View GitHub Profile
@MHJahanbakhsh
MHJahanbakhsh / myscript.sh
Created September 22, 2023 14:00 — forked from bradtraversy/myscript.sh
Basic Shell Scripting
#! /bin/bash
# ECHO COMMAND
# echo Hello World!
# VARIABLES
# Uppercase by convention
# Letters, numbers, underscores
NAME="Bob"
# echo "My name is $NAME"
@MHJahanbakhsh
MHJahanbakhsh / ssh.md
Created May 8, 2023 18:19 — forked from bradtraversy/ssh.md
SSH & DevOps Crash Course Snippets

SSH Cheat Sheet

This sheet goes along with this SSH YouTube tutorial

Login via SSH with password (LOCAL SERVER)

$ ssh [email protected]

Create folder, file, install Apache (Just messing around)

$ mkdir test

$ cd test

@MHJahanbakhsh
MHJahanbakhsh / js_linked_list.js
Created October 6, 2022 15:41 — forked from bradtraversy/js_linked_list.js
JS Linked List Class
// Construct Single Node
class Node {
constructor(data, next = null) {
this.data = data;
this.next = next;
}
}
// Create/Get/Remove Nodes From Linked List
class LinkedList {
@MHJahanbakhsh
MHJahanbakhsh / css-media-queries-cheat-sheet.css
Created September 18, 2022 08:44 — forked from bartholomej/css-media-queries-cheat-sheet.css
CSS Media Query Cheat Sheet (with Foundation)
/*------------------------------------------
Responsive Grid Media Queries - 1280, 1024, 768, 480
1280-1024 - desktop (default grid)
1024-768 - tablet landscape
768-480 - tablet
480-less - phone landscape & smaller
--------------------------------------------*/
@media all and (min-width: 1024px) and (max-width: 1280px) { }
@media all and (min-width: 768px) and (max-width: 1024px) { }
@MHJahanbakhsh
MHJahanbakhsh / koa-server.md
Last active November 21, 2022 21:44 — forked from kevinwucodes/koa-server.md
understanding koajs middleware architecture stack order

Notes

Portfolio: https://mhj-portfolio-nextjs.herokuapp.com/

Koa middleware cascade in a more traditional way as you may be used to with similar tools - this was previously difficult to make user friendly with node's use of callbacks. However with async functions we can achieve "true" middleware. Contrasting Connect's implementation which simply passes control through series of functions until one returns, Koa invoke "downstream", then control flows back "upstream".

The following example responds with "Hello World", however first the request flows through the x-response-time and logging middleware to mark when the request started, then continue to yield control through the response middleware. When a middleware invokes next() the function suspends and passes control to the next middleware defined. After there are no more middleware to execute downstream, the stack will unwind and each middleware is resumed to perform its upstream behaviour.

@MHJahanbakhsh
MHJahanbakhsh / sample.md
Last active August 31, 2022 06:54 — forked from bradtraversy/sample.md
Markdown Cheat Sheet

how to have a newline in markdown: before hit enter key,press two spaces

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6