Skip to content

Instantly share code, notes, and snippets.

View sithuwin93's full-sized avatar
💭
I may be slow to respond.

Si Thu Win sithuwin93

💭
I may be slow to respond.
View GitHub Profile
@sithuwin93
sithuwin93 / main.go
Created September 9, 2021 03:36 — forked from ivanmrchk/main.go
Sending email template with golang using gomail v2 and attaching files.
package main
import (
"bytes"
"html/template"
"log"
gomail "gopkg.in/gomail.v2"
)
Reddit Content Policy
Reddit is a platform for communities to discuss, connect, and share in an open environment, home to some of the most authentic content anywhere online.
151/5000
Reddit သည်လူမှုအသိုင်းအဝိုင်းများအတွက်အွန်လိုင်းပေါ်တွင်မည်သည့်စစ်မှန်မှုနှင့်ပါတ်သက်သည့်အကြောင်းအရာကိုမျှဝေရန်ပွင့်လင်းသောပတ်ဝန်းကျင်တွင်ဆွေးနွေးခြင်း၊ ဆက်သွယ်ခြင်းနှင့်မျှဝေခြင်းများအတွက်ပလက်ဖောင်းတစ်ခုဖြစ်သည်။
@sithuwin93
sithuwin93 / google-ads-note.txt
Created March 29, 2020 08:49
google-ads-note
Pulish a content policy
Access the risks before monetizing
Monitor your pages
Ask your users to report violations
Build, or use an automated content filtering system
Use a 3rd party plugin for commenting
@sithuwin93
sithuwin93 / next_nginx.md
Created March 13, 2020 14:03 — forked from kocisov/next_nginx.md
How to setup next.js app on nginx with letsencrypt

How to setup next.js app on nginx with letsencrypt

next.js, nginx, reverse-proxy, ssl

1. Install nginx and letsencrypt

$ sudo apt-get update
$ sudo apt-get install nginx letsencrypt

Also enable nginx in ufw

@sithuwin93
sithuwin93 / sse.go
Created March 6, 2020 04:51 — forked from ismasan/sse.go
Example SSE server in Golang
// Copyright (c) 2017 Ismael Celis
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all
@sithuwin93
sithuwin93 / Setup MongoDB on localhost as Replica Set
Created January 6, 2020 05:28 — forked from davisford/Setup MongoDB on localhost as Replica Set
Setup MongoDB replica set on local host with only a single primary
Add the `replication` section to the mongod.conf file:
```
$cat /usr/local/etc/mongod.conf
systemLog:
destination: file
path: /usr/local/var/log/mongodb/mongo.log
logAppend: true
storage:
engine: mmapv1
@sithuwin93
sithuwin93 / axios.refresh_token.js
Created December 18, 2019 07:12 — forked from Godofbrowser/axios.refresh_token.1.js
Axios interceptor for refresh token when you have multiple parallel requests. Demo implementation: https://github.com/Godofbrowser/axios-refresh-multiple-request
// for multiple requests
let isRefreshing = false;
let failedQueue = [];
const processQueue = (error, token = null) => {
failedQueue.forEach(prom => {
if (error) {
prom.reject(error);
} else {
prom.resolve(token);
package main
import (
"flag"
"log"
"net/http"
"strings"
)
// FileSystem custom file system handler
@sithuwin93
sithuwin93 / README.md
Created November 5, 2019 20:49 — forked from agustif/README.md
NextJS sitemap generator with dynamic URL

NextJS sitemap generator

Install

The current setup has been tested on Next Js 7.0.0.

You need to install Axios.

$ npm install axios
@sithuwin93
sithuwin93 / ActiveLink.js
Created October 27, 2019 02:40 — forked from remy/ActiveLink.js
Next.js version of `activeClassName` support.