Skip to content

Instantly share code, notes, and snippets.

View prabalsslw's full-sized avatar
🎯
Focusing

Prabal Mallick prabalsslw

🎯
Focusing
View GitHub Profile
@prabalsslw
prabalsslw / webhookSignatureValidation.py
Created September 8, 2022 03:56
bKash RPP Webhook Signature Validation
import base64
import hashlib
import hmac
sig = '' // Signature from the payload header
payl = '' // Webhook payload from the body
key = '' // API Key provided by organization
def is_valid_signature(signature, payload, api_key):
signature = base64.urlsafe_b64decode(signature)
@prabalsslw
prabalsslw / curl-verbose.php
Created September 2, 2021 11:33 — forked from hubgit/curl-verbose.php
Verbose cURL in PHP
<?php
// Request URL
$url = 'http://www.google.com/';
// HTTP headers
$headers = array(
//'Content-Type: application/json',
//'Accept: application/json',
);
@prabalsslw
prabalsslw / Bkash Recurring Date Time Calculation Function
Created August 19, 2021 13:22
Bkash Recurring Date Time Calculation Function
<?php
function get_recurring_date_time($frequecy, $startdate, $enddate) {
$start_date = strtotime($startdate);
$end_date = strtotime($enddate);
$difference = $end_date - $start_date;
$days = floor($difference/(60*60*24));
switch ($frequecy) {
@prabalsslw
prabalsslw / Simple Query String to SQL WHERE Clause
Last active August 19, 2021 13:23
Simple Query String to SQL WHERE Clause - This script will help you to simplify your search module
$queries = array();
parse_str($_SERVER['QUERY_STRING'], $queries); // GET Query String from URL
$result = array_filter($queries); // Filter empty string
$keys = array_keys($result); // Separate array key
$values = array_values($result); // Separate array value
function queryParsing($key, $value)
{
return($key." = "."'$value'"); // Build string like username = 'value'
}
@prabalsslw
prabalsslw / curl.ini
Created December 31, 2020 10:48 — forked from reinaldomendes/curl.ini
PHP Curl error 77 on ssl conections
;###################################################
; NOTE
;####################################################
; change your curl.ini on /etc/php.d/curl.ini
;
;This config was only tested on amazon AMI
;Please check if /etc/ssl/certs/ca-bundle.crt exists
;
;If you don't have the ca-bundle root certificate you
; can get this in
package com.example.easycheckout;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
@prabalsslw
prabalsslw / CsrfValidatorSkip.php
Created June 21, 2020 13:48
Magento 2.x Invalid Form Key
<?php
#Path - Sslwireless/Sslcommerz/Plugin/CsrfValidatorSkip.php
namespace Sslwireless\Sslcommerz\Plugin;
class CsrfValidatorSkip
{
/**
* @param \Magento\Framework\App\Request\CsrfValidator $subject
* @param \Closure $proceed