Skip to content

Instantly share code, notes, and snippets.

View M-Naveed-Ashraf's full-sized avatar
💻
Programmer

Muhammad Naveed Ashraf M-Naveed-Ashraf

💻
Programmer
  • Lahore, Punjab, Pakistan
View GitHub Profile
@M-Naveed-Ashraf
M-Naveed-Ashraf / nextjs14-vps-guide.md
Created March 28, 2024 10:42 — forked from aryanprince/nextjs14-vps-guide.md
Quickly deploy a Next.js 14 app on a VPS (Droplets, EC2, etc.) with app router, RSCs, and other Next.js features

from aryan: most guides i found online weren't helpful for me, hope this helps tho :)

1. Connect to machine

ssh root@<server-ip-address>

Optional but recommended:

sudo apt update && sudo apt upgrade -y
@M-Naveed-Ashraf
M-Naveed-Ashraf / work-with-multiple-github-accounts.md
Last active January 19, 2023 07:03 — forked from rahularity/work-with-multiple-github-accounts.md
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github/bitbucket Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal and one bitbucket account, https://github.com/needu-mezino. Now i want to setup my system to easily talk to both the github accounts and bitbucket account.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent
@M-Naveed-Ashraf
M-Naveed-Ashraf / github_clone_using_token.sh
Created July 21, 2022 13:16 — forked from magickatt/github_clone_using_token.sh
Clone a GitHub repository using a Personal Access Token
export GITHUB_USER=magickatt
export GITHUB_TOKEN=secret
export GITHUB_REPOSITORY=magickatt/ContainerisingLegacyApplicationsTalk
git clone https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}
@M-Naveed-Ashraf
M-Naveed-Ashraf / app.js
Created November 18, 2021 13:43 — forked from codecademydev/app.js
Codecademy export
const express = require('express');
const app = express();
const PORT = process.env.PORT || 4001;
app.listen(PORT, () => {
console.log(`Server is listening on port ${PORT}`);
});
const mountains = ['denali', 'olympus', 'kilimanjaro', 'matterhorn'];
@M-Naveed-Ashraf
M-Naveed-Ashraf / app.js
Last active November 18, 2021 13:36 — forked from codecademydev/app.js
Codecademy export ... DELETE API request delete a data ... express practice
const express = require('express');
const app = express();
const PORT = process.env.PORT || 4001;
const puddingFlavors = ['chocolate', 'banana', 'butterscotch', 'pistachio'];
const findPuddingIndex = (name) => {
return puddingFlavors.indexOf(name);
}
@M-Naveed-Ashraf
M-Naveed-Ashraf / app.js
Last active November 18, 2021 13:27 — forked from codecademydev/app.js
Codecademy export ... POST API request add data ... express practice
const express = require('express');
const app = express();
const PORT = process.env.PORT || 4001;
const soups = ['gazpacho', 'borscht', 'primordial', 'avgolemono', 'laksa'];
app.post('/soups', (req, res, next) => {
const receivedData = req.query.name;
soups.push(receivedData);
@M-Naveed-Ashraf
M-Naveed-Ashraf / app.js
Last active November 18, 2021 13:21 — forked from codecademydev/app.js
Codecademy export ... PUT API request update a document using params.query
const express = require('express');
const app = express();
const PORT = process.env.PORT || 4001;
const currencies = {
diram: {
countries: ['UAE', 'Morocco'],
},
real: {
@M-Naveed-Ashraf
M-Naveed-Ashraf / app.js
Created November 18, 2021 13:15 — forked from codecademydev/app.js
Codecademy export ... GET API request getting only one document from collection of documents .... express practice
const express = require('express');
const app = express();
const PORT = process.env.PORT || 4001;
const battlefields = {
fortSumter: {
state: 'SC',
},
manassas: {
@M-Naveed-Ashraf
M-Naveed-Ashraf / app.js
Last active November 18, 2021 13:12 — forked from codecademydev/app.js
Codecademy export .... GET API request for one document from collection of documents ... express practice
const express = require('express');
const app = express();
const PORT = process.env.PORT || 4001;
const buildingMaterials = {
wood: ['plywood', '2x4s', 'cedar shingles'],
metal: ['steel girders', 'wall studs', 'rebar'],
};
@M-Naveed-Ashraf
M-Naveed-Ashraf / app.js
Last active November 18, 2021 13:09 — forked from codecademydev/app.js
Codecademy export ... GET API Request boiler plate ... express practice
const express = require('express');
const app = express();
const PORT = process.env.PORT || 4001;
const sausageTypes = ['bratwurst', 'andouille', 'chorizo', 'boudin', 'kielbasa'];
app.get('/sausages', (req, res, next) => {
res.send(sausageTypes);
})