Skip to content

Instantly share code, notes, and snippets.

View Shahzad6077's full-sized avatar
🔥
Focusing

Muhammad Shahzad Ali Shahzad6077

🔥
Focusing
View GitHub Profile
@Shahzad6077
Shahzad6077 / nodejs-cheatsheet.js
Created March 18, 2020 07:10 — forked from LeCoupa/nodejs-cheatsheet.js
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@Shahzad6077
Shahzad6077 / gremlin-cheat-sheet.md
Last active March 17, 2021 07:59 — forked from jeremysears/gremlin-cheat-sheet.md
Gremlin Cheat Sheet in Groovy
@Shahzad6077
Shahzad6077 / java-env-path-set.md
Created March 17, 2021 07:58
Set Java JDK environment variables path
@Shahzad6077
Shahzad6077 / _include-media.scss
Created May 18, 2021 10:41
Media Query with Mixins SASS
@charset "UTF-8";
// _ _ _ _ _
// (_) | | | | | (_)
// _ _ __ ___| |_ _ __| | ___ _ __ ___ ___ __| |_ __ _
// | | '_ \ / __| | | | |/ _` |/ _ \ | '_ ` _ \ / _ \/ _` | |/ _` |
// | | | | | (__| | |_| | (_| | __/ | | | | | | __/ (_| | | (_| |
// |_|_| |_|\___|_|\__,_|\__,_|\___| |_| |_| |_|\___|\__,_|_|\__,_|
//
// Simple, elegant and maintainable media queries in Sass
@Shahzad6077
Shahzad6077 / GitCommitEmoji.md
Created July 30, 2021 12:22 — forked from parmentf/GitCommitEmoji.md
Git Commit message Emoji
name: echo the latest commit on PR
on: pull_request
jobs:
GetRecentCommit:
name: Get Latest Commit
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
steps:
- name: List commits on the pull request
run: |

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@Shahzad6077
Shahzad6077 / PhoneInput.jsx
Created January 18, 2022 05:58
US Phone Validation using regex Reactjs
import { useState } from "react"
export default function Index(){
const [phone,setPhone] = useState("");
const formatPhoneValidation = (current) => {
const value = `${current.value}`;
const input = value.replace(/\D/g, "").substring(0, 10); // First ten digits of input only
@Shahzad6077
Shahzad6077 / PromiseAllSettled.js
Created August 16, 2022 01:10 — forked from keidarcy/PromiseAllSettled.js
How to use Promise.allSettled and fetch api with GET and POST together
const p1 = new Promise((resolve, reject) => setTimeout(resolve(1), 200))
const p2 = new Promise((resolve, reject) => setTimeout(reject('error'), 300))
const p3 = new Promise((resolve, reject) => setTimeout(resolve(3), 4000))
Promise.all([p1, p2, p3]).then((res) => console.log(res)).catch(e => console.log(e))
Promise.allSettled([p1, p2, p3]).then((res) => console.log(res)).catch(e => console.log(e))
@Shahzad6077
Shahzad6077 / deploy_node_do.md
Created August 16, 2022 22:59 — forked from carlssonk/deploy_node_do.md
Deploy node.js app to DigitalOcean

Deploy Node.js Application to DigitalOcean

This step by step tutorial will show you how to set up a Node.js server with MongoDB to DigitalOcean using PM2, NGINX as reverse proxy and a SSL from LetsEncrypt. We will also add a custom domain name.

Prerequisites

Create Droplet & Generate SSH Key