Skip to content

Instantly share code, notes, and snippets.

View kyawkyawsoezhu's full-sized avatar
🏠
Working from home

Kyaw Kyaw Soe kyawkyawsoezhu

🏠
Working from home
  • Myanmar
View GitHub Profile
@kyawkyawsoezhu
kyawkyawsoezhu / payment-engine response.json
Created January 19, 2023 08:55
API response of Payment Engine
{
"fullPayment": {
"packagePrice": {
"voluntaryPrice": "1050000",
"compulsoryPrice": "64600",
"totalPrice": "1114600",
"discountPrice": "52500"
},
"paymentDetails": [
{
@kyawkyawsoezhu
kyawkyawsoezhu / .env.deploy
Created July 17, 2021 08:14
Laravel artisan command for deploy to the destination server
DEPLOY_USER=awesomeuser
DEPLOY_SERVER=awesome-api.example.com
DEPLOY_PATH=/var/www/awesome-api
@kyawkyawsoezhu
kyawkyawsoezhu / .env.deploy
Created July 17, 2021 06:29
Bash file for deploying ReactJS app (CRA) to production server
DEPLOY_USER=$USER
DEPLOY_SERVER=awesome.example.com
DEPLOY_PATH=/var/www/awesome-react-app
@kyawkyawsoezhu
kyawkyawsoezhu / gist:6d504d99d5faffc1f0a0a34b0481d685
Created June 26, 2018 16:42 — forked from jessedearing/gist:2351836
Create self-signed SSL certificate for Nginx
#!/bin/bash
echo "Generating an SSL private key to sign your certificate..."
openssl genrsa -des3 -out myssl.key 1024
echo "Generating a Certificate Signing Request..."
openssl req -new -key myssl.key -out myssl.csr
echo "Removing passphrase from key (for nginx)..."
cp myssl.key myssl.key.org
openssl rsa -in myssl.key.org -out myssl.key
@kyawkyawsoezhu
kyawkyawsoezhu / soft-code-n-rename-script.sh
Last active February 12, 2018 09:36
an example of soft code subtitle and rename video using `mkvmerge` and `filebot`
#!/bin/bash
outputPath="/home/kyawkyawsoezhu/Desktop/Outputs"
basePath="/home/kyawkyawsoezhu/Desktop/Downloads"
videoPath=(${basePath}/*/*.mkv)
mmSubtitlePath=(${basePath}/*/mmsub/*.srt)
engSubtitlePath=(${basePath}/*/engsub/*.srt)
index=0
@kyawkyawsoezhu
kyawkyawsoezhu / .bashrc
Created October 13, 2017 08:13
Show Git branch name in Ubuntu Terminal
# Show git branch name
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[33m\]$(parse_git_branch)\[\033[00m\]\$ '
@kyawkyawsoezhu
kyawkyawsoezhu / reduxAPITokenMiddleware.js
Created September 21, 2017 11:34
Redux middleware to request token and put into API endpoint header
import jwt from 'jsonwebtoken';
import moment from 'moment';
import axios from '../tools/axios';
const isTokenAboutToExpire = (token) => {
const tokenPayload = jwt.decode(token.access_token);
const expiry = moment.unix(tokenPayload.exp);
return expiry.diff(moment(), 'seconds') < 300;
};
@kyawkyawsoezhu
kyawkyawsoezhu / reduxAPITokenMiddleware
Created September 21, 2017 11:34
Redux middleware to request token and put into API endpoint header
import jwt from 'jsonwebtoken';
import moment from 'moment';
import axios from '../tools/axios';
const isTokenAboutToExpire = (token) => {
const tokenPayload = jwt.decode(token.access_token);
const expiry = moment.unix(tokenPayload.exp);
return expiry.diff(moment(), 'seconds') < 300;
};
@kyawkyawsoezhu
kyawkyawsoezhu / Postman.desktop
Created September 16, 2017 09:25 — forked from aviskase/Postman.desktop
Install Postman
[Desktop Entry]
Encoding=UTF-8
Name=Postman
Exec=postman
Icon=/opt/Postman/resources/app/assets/icon.png
Terminal=false
Type=Application
Categories=Development;
<?php
namespace App\Traits;
use DB;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Query\JoinClause;
use phpDocumentor\Reflection\Types\Mixed_;
trait LimitPerGroupable