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
/*Reset Default {*/
*{
}
h1,h2,h3,h4,h5,h6{
padding: 0;
margin: 0;
font-weight: 500;
}
.h3{
{% block style %}
<link href="https://maxcdn.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Hind+Vadodara:300,400,500,600,700" rel="stylesheet">
<link href="https://rawgit.com/kyawkyawsoezhu/1cfb27576050b23c13900d6edf309236/raw/temasek-twig.css" rel="stylesheet">
<style>
@media (max-width: 767px) {
@kyawkyawsoezhu
kyawkyawsoezhu / QualityClubElite2017ThemedDinner.js
Created March 29, 2017 08:21
Quality Club Elite 2017 Themed Dinner
$(function(){
function init(){
console.log("INIT");
var $firstname = $("div[id$='firstname']").parent('.control-group');
var $lastname = $("div[id$='lastname']").parent('.control-group');
var $businessname = $("div[id$='biz_name']").parent('.control-group');
var $email = $("div[id$='email']").parent('.control-group');
var $agentCode = $("div[id$='Agent_Code']").parent('.control-group');
var $tableRep = $("div[id$='iSGLiSC4']").parent('.control-group');
var $tableMates = $("div[id$='Table_mates']").parent('.control-group');
<?php
namespace App\Traits;
use DB;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Query\JoinClause;
use phpDocumentor\Reflection\Types\Mixed_;
trait LimitPerGroupable
@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;
@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 / 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 / .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 / 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 / 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