Skip to content

Instantly share code, notes, and snippets.

@phothinmg
phothinmg / gist:17fe7966afee9ffcfbdd7c3b63053f84
Created September 11, 2025 17:19 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@phothinmg
phothinmg / bash-colors.md
Created July 24, 2025 06:14 — forked from JBlond/bash-colors.md
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple
@phothinmg
phothinmg / Utils.js
Created May 22, 2025 09:44 — forked from lacymorrow/Utils.js
A handy collection of JS utility functions
var Utils = {
sleep: function (milliseconds) {
return new Promise(resolve => setTimeout(resolve, milliseconds));
},
isUndefined: function (value) {
return typeof value === 'undefined';
},
isObject: function (o) {
return (
typeof o === 'object' &&
@phothinmg
phothinmg / meta-tags.md
Created March 16, 2025 13:38 — forked from whitingx/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
@phothinmg
phothinmg / CPP colors
Created March 8, 2025 11:41 — forked from Kielx/CPP colors
c++ terminal output colors
You need the terminal color codes. For linux it's the following (your system might be different, look it up):
//the following are UBUNTU/LINUX, and MacOS ONLY terminal color codes.
#define RESET "\033[0m"
#define BLACK "\033[30m" /* Black */
#define RED "\033[31m" /* Red */
#define GREEN "\033[32m" /* Green */
#define YELLOW "\033[33m" /* Yellow */
#define BLUE "\033[34m" /* Blue */
#define MAGENTA "\033[35m" /* Magenta */
// Also I know it's better to find some library for this task but if someone is okay with using a pure javascript solution, here's an example snippet. Please note timezone names are hard-coded but I don't expect the names change (the names, offset could change).
// It is a response to https://gist.github.com/redoPop/3915761
/*
It has 4 fallbacks,
1. first it tries to format the date as a string `${timezone}`,
and extract the timezone name from the braces at the end,
and look up the abbr in the dict,
2. then, if it's not in the dict, it just prints the part within ( and ),
3. if the date in text representation is not formatted with ( and ) at the end,
@phothinmg
phothinmg / makeRequest.js
Created December 31, 2024 20:36 — forked from lddefensor/makeRequest.js
Pure JS HTTPRequest Implementation using Promise
function makeRequest(method, url, data){
return new Promise(
function(resolve, reject)
{
var http = new XMLHttpRequest();
http.open(method, url);
http.onload= function(){
if(this.status >= 200 && this.status < 300)
{
var response = http.response;
@phothinmg
phothinmg / makeRequest.js
Created December 31, 2024 20:36 — forked from lddefensor/makeRequest.js
Pure JS HTTPRequest Implementation using Promise
function makeRequest(method, url, data){
return new Promise(
function(resolve, reject)
{
var http = new XMLHttpRequest();
http.open(method, url);
http.onload= function(){
if(this.status >= 200 && this.status < 300)
{
var response = http.response;
@phothinmg
phothinmg / net.js
Created February 7, 2024 08:05 — forked from sid24rane/net.js
Simple TCP Client and Server in Node.js (Covering all useful Properties & Methods)
var net = require('net');
// creates the server
var server = net.createServer();
//emitted when server closes ...not emitted until all connections closes.
server.on('close',function(){
console.log('Server closed !');
});

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