Skip to content

Instantly share code, notes, and snippets.

View mizanmahi's full-sized avatar
🎯
Focused

Mizan Mahi mizanmahi

🎯
Focused
View GitHub Profile
@mizanmahi
mizanmahi / pm2.md
Last active November 13, 2024 19:35
PM2 Useful Commands

PM2 commands for managing and monitoring Node.js applications:

1. Starting and Stopping Applications

  • Start an application:
    pm2 start app.js
    Starts a Node.js app (app.js), creating a managed process.

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Create Free AWS Account

Create free AWS Account at https://aws.amazon.com/

2. Create and Lauch an EC2 instance and SSH into machine

I would be creating a t2.medium ubuntu machine for this demo.

@mizanmahi
mizanmahi / 1) Code setup
Created September 22, 2024 09:09 — forked from emondarock/1) Code setup
AWS SSL configuration with nodejs, nginx and letsencrypt using certbot
1) Clone Repo
2) Install all module by `sudo npm install`. After installing all modules if u get any error run `npm rebuild`
2) Install pm2 by running `sudo npm i pm2 -g`
4) run via pm2 `pm2 start pm2-config.json`
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"segments": [
{
"foreground": "#01F0FF",
"style": "plain",
"template": " {{ .UserName }} ",
const array = [
['a', ['m', 'n', 'o']],
['b', ['s', 't', 'u']],
['d', ['e', 'f', 'g']],
]
function getShortestPath(target, array){
let shortest = array[0];
let shortestDistance = Infinity;
for(let i = 0; i < array.length; i++){
@mizanmahi
mizanmahi / talkToSpeech.js
Created October 13, 2021 16:27
Js text to speech api
const textToSpeech = (text) => {
const speech = new SpeechSynthesisUtterance(text);
[speech.voice] = speechSynthesis.getVoices();
// sp.rate = ?; //speed of the voice. Default value is 1. lowest = 0.1 and highest = 10
// sp.pitch = ?; //pitch of the voice. Default value is 1. lowest = 0 and highest = 2
speechSynthesis.speak(speech);
};
textToSpeech('Hello TalkJS!');