Skip to content

Instantly share code, notes, and snippets.

View coder618's full-sized avatar
🎯
Focusing

Ahadul Islam coder618

🎯
Focusing
View GitHub Profile
@coder618
coder618 / Form Data To JSON
Created September 5, 2020 11:06
Convert Form Data into JSON formate
/**
Return Form Data in json formate.
require jQuery Form Selector
*/
function returnFormJson(fromSelector) {
var output = [];
var f_Data = $(fromSelector).serializeArray();
@coder618
coder618 / Assessment
Last active December 3, 2020 07:10
Notionhive Assessment
Q1: Suppose this array come from back-end. data of this array can be dynamic.
You have to make a Dynamic HTML Output (using ul tag) based on this array,
where each item will fall under its parent id.
output will look something like this.
Bangladesh
Dhaka
Uttara
Khilgaon
@coder618
coder618 / jQuery Accordion
Created October 17, 2020 07:28
jQuery Accordion snippet
<ul class="accordion">
<?php for($i=0; $i< 5; $i++): ?>
<li>
<a class="toggle" href="javascript:void(0);">Item 1 <i class="far fa-chevron-down"></i></a>
<div class="inner">
some inner textttttttt
</div>
</li>
<?php endfor; ?>
</ul>
@coder618
coder618 / Text to speech Amazon poly - Dutch (php)
Created April 2, 2021 11:04
Amazon polly API with Dutch Language (PHP)
<?php
// require_once 'app/aws/aws-autoloader.php';
require 'vendor/autoload.php';
$awsAccessKeyId = '-----';
$awsSecretKey = '-----';
$credentials = new \Aws\Credentials\Credentials($awsAccessKeyId, $awsSecretKey);
$client = new \Aws\Polly\PollyClient([
'version' => '2016-06-10',
'credentials' => $credentials,
'region' => 'us-east-1',
@coder618
coder618 / out-of-stock.php
Created April 14, 2021 13:32
woocommerce out of stock check
$has_stock = false;
// echo $product->get_type();
if( $product->get_type() == 'variable' ){
$available_variations = $product->get_available_variations();
foreach( $available_variations as $item ){
if($item['is_in_stock']== true){
$has_stock = true;
}
}
@coder618
coder618 / gist:46734a58c0cc587e9dd24761f7df20fd
Created September 8, 2021 07:40
WooCommerce Order email object
<?php
/*
This function will return easy to use email object which can be use in
any email template by giving the order id only
*/
function coder618_get_email_obj($order_id){
$email_obj = ['order_id' => $order_id];