Skip to content

Instantly share code, notes, and snippets.

View TheNetJedi's full-sized avatar
:shipit:
oof

Ameer Shaikh TheNetJedi

:shipit:
oof
View GitHub Profile
@bradtraversy
bradtraversy / node_nginx_ssl.md
Last active April 24, 2024 10:14
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

import time
print "..."
time.sleep(1)
print "..."
print "..."
print "..."
print "..."
time.sleep(1)
print "..."
@bradtraversy
bradtraversy / rethinkdb_cheat_sheet.MD
Last active April 14, 2024 01:44
RethinkDB Query Cheat Sheet

RethinkDB Cheat Sheet

Create database

r.dbCreate('mydb')

List databases

@yhdesai
yhdesai / index.js
Created April 1, 2019 13:40
Cloud Vision API NodeJS Sample
async function quickstart() {
const vision = require('@google-cloud/vision');
const client = new vision.ImageAnnotatorClient();
const fileName = 'hindi.png'
// Read a local image as a text document
const [result] = await client.documentTextDetection(fileName);
@mediavrog
mediavrog / gist:49c4f809dffea4e00738a7f5e3bbfa59
Last active April 14, 2023 08:56
CORS in Google Cloud Functions for Firebase
const cors = require('cors')({origin: true});
exports.sample = functions.https.onRequest((req, res) => {
cors(req, res, () => {
res.send('Passed.');
});
});