Skip to content

Instantly share code, notes, and snippets.

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

Thet Zaw Win ygnthetzaw

🏠
Working from home
View GitHub Profile
@ygnthetzaw
ygnthetzaw / breadcrumb.php
Created April 4, 2022 19:36
Simple Wordpress Breadcrumb based on current url
<?php
global $wp;
$route = home_url($wp->request);
$routeArray = explode('/', $route);
if (!empty($routeArray)) {
$breadcrumb = '<ol class="breadcrumb">';
$link = '';
for ($i = 0; $i < count($routeArray); $i++) {
$link .= $routeArray[$i] . '/';
if ($i >= 2) {
<?php
define('BOT_TOKEN', 'XXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXX'); // place bot token of your bot here
function checkTelegramAuthorization($auth_data) {
$check_hash = $auth_data['hash'];
unset($auth_data['hash']);
$data_check_arr = [];
foreach ($auth_data as $key => $value) {
$data_check_arr[] = $key . '=' . $value;
@ygnthetzaw
ygnthetzaw / cbmcurrency-opencart.ocmod.xml
Last active November 16, 2020 17:15
Using Central Bank Myanmar API in opencart currency
<?xml version="1.0" encoding="utf-8"?>
<modification>
<name>CBM Currency</name>
<code>cbm_currency</code>
<version>1</version>
<author>Innosoft</author>
<link>https://www.innosoftmm.com/</link>
<file path="admin/model/localisation/currency.php">
<!-- removing the old function by rename -->
@ygnthetzaw
ygnthetzaw / gist:226ea88a617de11ecb1f0f3426803f32
Last active September 21, 2020 17:17
Digital Ocean Space using AWS S3 ASP.NET CORE SDK
*********
install Nuget Packges
AWSSDK.Extensions.NETCore.Setup
AWSSDK.S3
Startup.cs
*********
Insert the current code below inside this function "public void ConfigureServices(IServiceCollection services) { "
@ygnthetzaw
ygnthetzaw / .htaccess
Created September 8, 2019 14:55 — forked from jonathonbyrdziak/.htaccess
htaccess mod_expires / mod_cache / mod_deflate / mod_headers
# ------------------------------------------------------------------------------
#
# Curtousy of the Magento Support Center
# http://magentosupport.help/what-are-expires-headers-and-how-do-i-implement-them/
#
# ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# | Mod Caching via Apache |
@ygnthetzaw
ygnthetzaw / gist:cad49af8e753aea0b8badd37560c34ed
Created October 8, 2018 14:20 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@ygnthetzaw
ygnthetzaw / sudo script to run
Created December 16, 2017 17:10
Run php 7.0 and php 5.6 on Ubuntu 17.04
sudo apt-get install apache2 libapache2-mod-php php php-fpm php-mcrypt php-mysql
sudo a2enmod alias vhost_alias rewrite headers env fastcgi
sudo a2ensite www-php7
sudo service apache2 restart
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php5.6 php5.6-fpm php5.6-mcrypt php5.6-mysql