Skip to content

Instantly share code, notes, and snippets.

// Checks if there is any expiring members this month
if ( count( $expiring_members ) == 0 ) {
echo "No member is expiring in this month!";
return;
}
@adnan360
adnan360 / write-bangla-with-unijoy-and-fcitx-in-kde.md
Created September 16, 2017 08:01
How to Write Bangla with Unijoy Layout using Fcitx in KDE Plasma 5

How to Write Bangla with Unijoy Layout using Fcitx in KDE Plasma 5

This has been tested on Arch Linux 2017 (Linux Kernel 4.12.12-1-ARCH) with KDE Plasma 5.10 installed, with libreoffice-fresh version 5.4.1.2.0 and other KDE apps.

Install the necessary pacakges:

sudo pacman -S fcitx fcitx-qt4 fcitx-qt5 m17n-db fcitx-m17n fcitx-configtool 
@adnan360
adnan360 / noLimitDumpRestore.php
Created August 31, 2017 10:34
No limit mysql dump import tool (pauses and resumes automatically, great for big sql files)
<?php
// source: https://stackoverflow.com/a/25749714
// by Grain
// your config
$filename = 'yourGigaByteDump.sql';
$dbHost = 'localhost';
$dbUser = 'user';
$dbPass = '__pass__';
$dbName = 'dbname';
$maxRuntime = 8; // less then your max script execution limit
@adnan360
adnan360 / how to setup ngrok.md
Last active August 23, 2017 02:04
How to setup NGROK

NGROK - A nifty little program to share your localhost with everyone

We have live sites for running client sites, we have staging sites for testing. But what about localhost sites. We sometimes have some test code running in local that we want the world to see!

NGROK is a tiny program that let's you temporarily create an url for your localhost! And anybody with the URL can visit this and enjoy the goodness within!

Moreover it does not need install, runs on Windows, Linux, Mac, BSD or ARM, plus its open source. How cool can it get?!

Basics (for geeks)

@adnan360
adnan360 / compton.conf
Created July 19, 2017 18:16
Compton configuration for a typical installation (~/.config/compton.conf)
shadow = true;
no-dnd-shadow = true;
no-dock-shadow = true;
clear-shadow = true;
shadow-radius = 7;
shadow-offset-x = -7;
shadow-offset-y = -7;
shadow-exclude = [ "name = 'Notification'", "class_g = 'Conky'", "class_g ?= 'Notify-osd'", "class_g = 'Cairo-clock'", "class_g = 'Synapse'", "class_g = 'Firefox' && argb" ];
shadow-ignore-shaped = true;
menu-opacity = 0.9;
@adnan360
adnan360 / filter orders.php
Created July 6, 2017 06:15
Wordpress/Woocommerce: Filter orders by custom meta tag
<?php
add_action( 'restrict_manage_posts', 'posts_filter_dropdown' );
function posts_filter_dropdown($post_type) {
// error_log('$post_type ====='.$post_type);
if('shop_order' != $post_type){
return;
}
$selected_option = @$_GET['order_type_filter'];
echo '
@adnan360
adnan360 / fonts.conf
Created June 13, 2017 14:42
Set preferred font in Linux (set system's default fonts)
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<!-- for: ~/.config/fontconfig/fonts.conf -->
<alias>
<family>serif</family>
<prefer><family>Noto Sans</family></prefer>
</alias>
@adnan360
adnan360 / https-on-localhost.md
Last active April 19, 2025 15:12
Use HTTPS on Localhost (XAMPP, Windows)

Sometimes some websites require https to work. This can be useful in those cases.

This has been tested with XAMPP (PHP 7.0.8) on Windows 7. Please see the Reference links at the end if in confusion about some step.

STEP 1: Editing Configs

Open:

C:\xampp\php\php.ini
@adnan360
adnan360 / kde-ibus-bangla-instructions-plasma5.md
Last active October 18, 2021 12:09
How to write Bangla in Arch/Manjaro Linux KDE (Plasma 5) (every app including Libreoffice, KDE apps)

How to setup/write in Bangla/Bengali in KDE using unijoy layout.

This instruction was tested on Manjaro 17 KDE, which had Plasma 5.9.3, Qt 5.8.0, KDE Frameworks 5.31.0. Libreoffice Version: 5.2.5.1.

Open a terminal and run:

sudo pacman -S ibus ibus-qt ibus-m17n m17n-db
@adnan360
adnan360 / mailtodisk_in_lampp_linux.md
Last active September 1, 2019 02:25
Use of mailtodisk / mailoutput in XAMPP for Linux