Skip to content

Instantly share code, notes, and snippets.

View itowhid06's full-sized avatar
🎯
Finding my feet...

Towhidul I Chowdhury itowhid06

🎯
Finding my feet...
View GitHub Profile
@itowhid06
itowhid06 / array_flatten.php
Created March 19, 2018 12:01 — forked from SeanCannon/array_flatten.php
PHP array_flatten() function. Convert a multi-dimensional array into a single-dimensional array.
<?php
/**
* Convert a multi-dimensional array into a single-dimensional array.
* @author Sean Cannon, LitmusBox.com | seanc@litmusbox.com
* @param array $array The multi-dimensional array.
* @return array
*/
function array_flatten($array) {
if (!is_array($array)) {
@itowhid06
itowhid06 / Apache.md
Created April 24, 2018 14:56 — forked from ignatisD/Apache.md
MailHog localhost xampp/wamp integration

#MailHog example page

MailHog is an email testing tool for developers.

It gives the developer the option to intercept and inspect the emails sent by his application.

You can download the MailHog Windows client from one of the links below.

@itowhid06
itowhid06 / gist:46ccc16dc045f967a194c1e341656ef8
Created May 14, 2018 12:04
Save canvas Data with jQuery and PHP
The following code saves a canvas as png with ajax to php.
Javascript:
var canvasData = canvasElement.toDataURL("image/png");
$.ajax({
url:'save.php',
type:'POST',
data:{
data:canvasData
@itowhid06
itowhid06 / fuzzy_string_match.js
Created August 7, 2018 03:12 — forked from dtjm/fuzzy_string_match.js
Fuzzy string matching function for JavaScript
// Fuzzy matching algorithm
var fuzzyMatch = function(needle, haystack) {
if(needle === "" || haystack === "") return true;
needle = needle.toLowerCase().replace(/ /g, "");
haystack = haystack.toLowerCase();
// All characters in needle must be present in haystack
var j = 0; // haystack position
for(var i = 0; i < needle.length; i++) {

Oh my days! It's so easy! WordPress & Rest API Authentication

So before I went down the JWT route, whilst it would work, I haven't finished it yet and doing so would require lots of testing. Even more so, I went down the JWT route because I couldn't get WP authentication to work before. :/

But now I have.

Motivation

Currently the UX for the voting plugin is not ideal. There should be one dashboard where the awards

@itowhid06
itowhid06 / readme.md
Created January 11, 2019 09:10
AMPPS 3.8 in Ubuntu

Setup AMPPS 3.8 in Ubuntu 18.10

If you're like me and want to have your LAMP Stack setup simple and ready to go, you would love this piece of software. AMPPS is a product from the well-known Softaculous team, that packs an Apache Web Server, MySQL, PHP, Perl, Python and SOFTACULOUS.

AMPPS Installation

$ sudo apt-get update

Install much needed dependencies

$ sudo apt-get install libfontconfig1 libxrender1
@itowhid06
itowhid06 / filter-wc-orders-by-gateway.php
Created May 5, 2019 03:35 — forked from bekarice/filter-wc-orders-by-gateway.php
Filters WooCommerce Orders by Payment Gateway Used
<?php
/**
* Plugin Name: Filter WooCommerce Orders by Payment Method
* Plugin URI: http://skyverge.com/
* Description: Filters WooCommerce orders by the payment method used :)
* Author: SkyVerge
* Author URI: http://www.skyverge.com/
* Version: 1.0.0
* Text Domain: wc-filter-orders-by-payment
*
sudo softwareupdate --ignore "macOS Catalina"
sudo softwareupdate --reset-ignored
defaults write com.apple.systempreferences AttentionPrefBundleIDs 0
killall Dock
@itowhid06
itowhid06 / is_rtl.php
Created October 25, 2019 05:51 — forked from khal3d/is_rtl.php
Check if there RTL characters (Arabic, Persian, Hebrew)
<?php
/**
* Is RTL
* Check if there RTL characters (Arabic, Persian, Hebrew)
*
* @author Khaled Attia <sourcecode@khal3d.com>
* @param String $string
* @return bool
*/