Skip to content

Instantly share code, notes, and snippets.

View cptiwari20's full-sized avatar
🏠
Working from home

Chandra Prakash Tiwari cptiwari20

🏠
Working from home
View GitHub Profile
@cptiwari20
cptiwari20 / Pabbly Webhook Handler
Created September 14, 2020 16:51
Handle Pabbly webhook events for your nodejs application
const pabblyWebhook = async (req, res, next) => {
if(req.body.event_name === 'test_webhook_url') return res.status(200).json({status: true, message: 'Tested data found'})
if(!req.body.data) return res.status(422).json({status: false, message: 'No data found'})
if(!req.body.event_type) return res.status(422).json({status: false, message: 'No event_type found'})
if(!req.body.data.id) return res.status(422).json({status: false, message: 'No id found'})
const subscription_id = req.body.data.id
try {
@rmiyazaki6499
rmiyazaki6499 / deploy-mern.md
Last active June 24, 2024 15:47
Deploying a Production ready React-Express app on AWS EC2 with CI/CD

Deploying a Production ready React-Express app on AWS

In this tutorial, I will be going over to how to deploy a Javascript app from start to finish using AWS and EC2. Recently, my partner Tu and I launched our app AlgoAcademy (a resource for reviewing algorithms and data structures) and we wanted to share with other developers some of the lessons we learned along the way.

Following this tutorial, you will have an application that has:

  • A React frontend, Express backend
  • An AWS EC2 server configured to host your application
  • SSL-certification with Certbot
  • A custom domain name
@cptiwari20
cptiwari20 / videoLink_helper.php
Last active April 26, 2022 11:45
A laravel helper that will convert any video link from youtube and Vimeo into the embed iframe link. You can use it in HTML or anywhere.
@pitch-gist
pitch-gist / gist:2999707
Created June 26, 2012 22:21
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>