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 / aes.go
Created October 19, 2019 03:29 — forked from willshiao/aes.go
AES 256-CFB in Node.js, Go, and Python
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"crypto/sha256"
"encoding/base64"
"fmt"
"io"
@sithuwin93
sithuwin93 / ActiveLink.js
Created October 27, 2019 02:40 — forked from remy/ActiveLink.js
Next.js version of `activeClassName` support.
@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
package main
import (
"flag"
"log"
"net/http"
"strings"
)
// FileSystem custom file system handler
@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);
@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 / 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 / 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 / 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
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 α€žα€Šα€Ία€œα€°α€™α€Ύα€―α€‘α€žα€­α€―α€„α€Ία€Έα€‘α€α€­α€―α€„α€Ία€Έα€™α€»α€¬α€Έα€‘α€α€½α€€α€Ία€‘α€½α€”α€Ία€œα€­α€―α€„α€Ία€Έα€•α€±α€«α€Ία€α€½α€„α€Ία€™α€Šα€Ία€žα€Šα€·α€Ία€…α€…α€Ία€™α€Ύα€”α€Ία€™α€Ύα€―α€”α€Ύα€„α€·α€Ία€•α€«α€α€Ία€žα€€α€Ία€žα€Šα€·α€Ία€‘α€€α€Όα€±α€¬α€„α€Ία€Έα€‘α€›α€¬α€€α€­α€―α€™α€»α€Ύα€α€±α€›α€”α€Ία€•α€½α€„α€·α€Ία€œα€„α€Ία€Έα€žα€±α€¬α€•α€α€Ία€α€”α€Ία€Έα€€α€»α€„α€Ία€α€½α€„α€Ία€†α€½α€±α€Έα€”α€½α€±α€Έα€α€Όα€„α€Ία€ΈαŠ α€†α€€α€Ία€žα€½α€šα€Ία€α€Όα€„α€Ία€Έα€”α€Ύα€„α€·α€Ία€™α€»α€Ύα€α€±α€α€Όα€„α€Ία€Έα€™α€»α€¬α€Έα€‘α€α€½α€€α€Ία€•α€œα€€α€Ία€–α€±α€¬α€„α€Ία€Έα€α€…α€Ία€α€―α€–α€Όα€…α€Ία€žα€Šα€Ία‹