Skip to content

Instantly share code, notes, and snippets.

View Ebugo's full-sized avatar
👋
Hi there, I'm looking for work.

Gospel Chinyereugo (Codebug) Ebugo

👋
Hi there, I'm looking for work.
View GitHub Profile
@Ebugo
Ebugo / date.js
Last active July 24, 2023 10:21 — forked from micah1701/dateFormat.js
Replicate PHP's native date() formatting in JavaScript for many common format types
/**
* Return a formated string from a date Object mimicking PHP's date() functionality
*
* @param {string} format "Y-m-d H:i:s" or similar PHP-style date format string
* @param {* | null} date Date Object, Datestring, or milliseconds
*
*/
function date(format, date) {
if (!date || date === "") {
date = new Date();
@Ebugo
Ebugo / node_nginx_ssl.md
Created May 5, 2021 07:11 — 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

@bradtraversy
bradtraversy / node_nginx_ssl.md
Last active May 21, 2024 22:10
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

@micah1701
micah1701 / dateFormat.js
Last active November 30, 2023 21:42
Replicate PHP's native date() formatting in JavaScript for many common format types
/**
* Return a formated string from a date Object mimicking PHP's date() functionality
*
* format string "Y-m-d H:i:s" or similar PHP-style date format string
* date mixed Date Object, Datestring, or milliseconds
*
*/
function dateFormat(format,date){
if(!date || date === "")