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 / toGregorian.js
Created April 10, 2024 09:31
Convert Julian Date to Gregorian
// Convert Julian Date to Gregorian
// @2024 PHO THIN MAUNG
function toGregorian(jd) {
const j = Math.floor(jd);
const jdn = Math.round(jd);
const fjdn = jd - j;
const a = 4 * jdn - 6884477;
const x3 = Math.floor(a / 146097);
const r3 = a % 146097;
@phothinmg
phothinmg / toJulian.js
Last active April 10, 2024 09:29
Converts a given date and time in the Gregorian calendar to the Julian day number.
// Convert Gregorian Date and Time to Julian
// @2024 PHO THIN MAUNG
function toJulian({
year,
month,
day,
hour = 12,
minute = 0,
second = 0,
tz = 0,