Skip to content

Instantly share code, notes, and snippets.

@adnan360
adnan360 / functions.php_snip
Created January 5, 2017 01:40
Booked plugin - range checking - test echo
echo "<p>Start time: $start_timestamp</p>";
echo "<p>End time:&nbsp; $end_timestamp</p>";
@adnan360
adnan360 / functions.php_snip
Created January 5, 2017 01:42
Booked plugin - test timestamp
$start_timestamp = strtotime('-1 second',strtotime($year.'-'.$month.'-'.$day.' 00:00:00'));
$end_timestamp = strtotime('+1 second',strtotime($year.'-'.$month.'-'.$day.' 23:59:59'));
@adnan360
adnan360 / functions.php_snip
Created January 5, 2017 01:44
Booked plugin - test timestamp (fix)
$start_timestamp = strtotime('-1 second',strtotime($year.'-'.$month.'-'.$day.' 00:00:01'));
$end_timestamp = strtotime('+1 second',strtotime($year.'-'.$month.'-'.$day.' 23:59:58'));
@adnan360
adnan360 / fixme_booked.php
Created January 5, 2017 01:51
Booked plugin - a fix plugin for the problem
<?php
/*
Plugin Name: fixme test for booked plugin
Using: place it in the plugins dir and activate from wp-admin
*/
if( ! function_exists( 'mplus_fix_query' ) )
{
function mplus_fix_query( $args ) {
// echo '<pre>'.print_r($args, true).'</pre>';
@adnan360
adnan360 / xampp-control-panel.desktop
Last active January 19, 2017 03:00
XAMPP GUI Control Panel shortcut for linux
[Desktop Entry]
Comment=Start and Stop XAMPP
Name=XAMPP Control Panel
Exec=gksudo python2 /opt/lampp/share/xampp-control-panel/xampp-control-panel.py
#Exec=gksudo /opt/lampp/manager-linux.run
Icon=/usr/share/icons/Humanity/devices/24/network-wired.svg
Encoding=UTF-8
Terminal=false
Name=XAMPP Control Panel
Comment=Start and Stop XAMPP
@adnan360
adnan360 / functions.php_snip
Created January 27, 2017 03:15
Woocommerce Subscriptions: get all subscribed products for a subscriber (find if a product is subscribed)
<?php
function has_an_active_subscriber( $product_id = null ){
// Empty array to store ALL existing Subscription PRODUCTS
$products_arr = array();
$products_subscr = get_posts( array(
'numberposts' => -1,
'post_status' => 'publish',
@adnan360
adnan360 / huge-sql-import.php
Created February 22, 2017 05:29
No limit database import (huge sql files import with automatic break and resume)
<?php
// Source: http://stackoverflow.com/a/25749714
if (empty($_GET['pass'])) { die('error'); }
// your config
$filename = 'yourGigaByteDump.sql';
$dbHost = 'localhost';
$dbUser = 'user';
$dbPass = '__pass__';
$dbName = 'dbname';
@adnan360
adnan360 / mailtodisk_in_lampp_linux.md
Last active September 1, 2019 02:25
Use of mailtodisk / mailoutput in XAMPP for Linux
@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 / 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