Skip to content

Instantly share code, notes, and snippets.

View phonemkyaw's full-sized avatar
🛠️
Building

Phone Myint Kyaw phonemkyaw

🛠️
Building
View GitHub Profile
@phonemkyaw
phonemkyaw / cloudSettings
Last active August 1, 2021 07:43
VS Code Setting
{"lastUpload":"2021-08-01T07:43:51.529Z","extensionVersion":"v3.4.3"}
@phonemkyaw
phonemkyaw / .htaccess
Created January 13, 2019 04:01 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@phonemkyaw
phonemkyaw / calculate_star_rating.py
Last active February 22, 2022 04:27
Python function to calculate the star rating from a given list of ratings
def calculate_star_rating(ratings):
"""This function calculates the star rating of the given list with array positions as
0 - 1 Star
1 - 2 Stars
2 - 3 Stars
3 - 4 Stars
4 - 5 Stars
"""
stars = [1,2,3,4,5]
return round(sum(list(map(lambda a,b: a*b, stars, ratings))) / sum(ratings), 2)
@phonemkyaw
phonemkyaw / myanmar_nrc_regex.json
Created November 15, 2018 10:06
Myanmar NRC Regular Expression JSON Schema
{
"$schema": "",
"$id": "http://example.com/root.json",
"type": "object",
"title": "Myanmar NRC Schema",
"description": "JSON Schema for Myanmar NRC Number",
"required": [
"nrc"
],
"properties": {
@phonemkyaw
phonemkyaw / amazon-ec2-ftp.md
Created September 1, 2018 15:03 — forked from gunjanpatel/amazon-ec2-ftp.md
amazon ec2 LAMP and FTP installation and setup
@phonemkyaw
phonemkyaw / sample_apache_vhost
Created June 15, 2017 09:22
Sample Apache Virtual Host
<VirtualHost *:80> |
ServerName test.org |
ServerAlias www.test.org |
DocumentRoot /var/www/test.org/public_html/ |
ErrorLog /var/www/test.org/logs/error.log |
TransferLog /var/www/test.org/logs/access.log |
</VirtualHost>
@phonemkyaw
phonemkyaw / install-php-7.sh
Created June 15, 2017 09:20
Install PHP 7 Fedora with all packages
#/bin/bash
#Install PHP 7 repository
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
#Install packages
dnf install php70w -y
dnf install php70w-gd.x86_64 -y
dnf install php70w-dba.x86_64 -y
dnf install php70w-fpm.x86_64 -y
@phonemkyaw
phonemkyaw / Dbupdate.php
Created April 28, 2017 10:08
Codeception DB query execute
<?php
namespace Codeception\Module;
/**
* Additional methods for DB module
*
* Save this file as DbHelper.php in _support folder
* Enable DbHelper in your suite.yml file
* Execute `codeception build` to integrate this class in your codeception
*/
class DbHelper extends \Codeception\Module