Skip to content

Instantly share code, notes, and snippets.

View nikhilkrdwivedi's full-sized avatar
🎯
Focusing

Nikhl Kumar nikhilkrdwivedi

🎯
Focusing
View GitHub Profile
@nikhilkrdwivedi
nikhilkrdwivedi / sample-env-key-server.env
Last active August 15, 2023 08:13
Add environment variables in the .env file inside launchpad/server
ISSUER_URL= # A valid url like https://google.com
JWT_SECRET= # Your JWT secret string like IamVengeance_IamtheNight_IamBatman
PORT= # Backend app port like 9090
MONGO_URI= # Momgodb url like mongodb+srv://xxxxxxxxx:xxxxxxxxx@xxxxxxxxxxx.xxxxxxxx.mongodb.net/DB_NAME
@nikhilkrdwivedi
nikhilkrdwivedi / sample-env-key-react.env
Last active August 15, 2023 08:14
Add environment variables in the .env file inside launchpad/
VITE_API_BASE_URL= # Your backend url where you authorize users like http://localhost:3020/
VITE_GRAF_BASE_URL= # Your Grafbase url like https://xxxxxxxx.grafbase.app/graphql
@nikhilkrdwivedi
nikhilkrdwivedi / sample-env-key-grafbase.env
Last active August 15, 2023 08:15
Add these properties in launchpad/grafbase/.env file
ISSUER_URL= # A valid url like https://google.com
JWT_SECRET= # Your JWT secret string like IamVengeance_IamtheNight_IamBatman
@nikhilkrdwivedi
nikhilkrdwivedi / node_nginx_ssl.md
Created August 4, 2020 04:00 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

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. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

#include<cmath>
#include<iostream>
#include<climits>
using namespace std;
int Maximum_Sum_Subarray(int arr[],int n) //Overall Time Complexity O(n)
{
int ans = A[0],sum = 0;
for(int i = 1;i < n; ++i) //Check if all are negative
ans = max(ans,arr[i]);