Skip to content

Instantly share code, notes, and snippets.

View sanjaybhowmick's full-sized avatar

Sanjay Bhowmick sanjaybhowmick

  • Kolkata, India
  • 08:46 (UTC +05:30)
View GitHub Profile
@sanjaybhowmick
sanjaybhowmick / database.sql
Last active June 6, 2022 08:34
PayPal IPN Integration - PHP & MySQL
CREATE TABLE IF NOT EXISTS `payments` (
`id` int(6) NOT NULL AUTO_INCREMENT,
`txnid` varchar(20) NOT NULL,
`payment_amount` decimal(7,2) NOT NULL,
`payment_status` varchar(25) NOT NULL,
`itemid` varchar(25) NOT NULL,
`createdtime` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
@sanjaybhowmick
sanjaybhowmick / functions.php
Created April 26, 2016 06:40
Google Map Embed in WordPress Post / Page
<?php
// Google Map embed short code
// Usage: [googlemap src="you_url"]
function GoogleMapEmbed($atts, $content = null) {
extract(shortcode_atts(array(
"width" => '100%',
"height" => '480',
"src" => ''
), $atts));
return '<iframe width="'.$width.'" height="'.$height.'" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'.$src.'" ></iframe>';
@sanjaybhowmick
sanjaybhowmick / loop.php
Created June 9, 2017 08:54
WooCommerce Featured Products loop
<!-- Featured products loop -->
<?php
$args = array(
'posts_per_page' => -1,
'post_type' => 'product',
'post_status' => 'publish',
'tax_query' => array(
array(
'taxonomy' => 'product_visibility',
'field' => 'name',
@sanjaybhowmick
sanjaybhowmick / html-table-changed-data.html
Created June 29, 2024 06:18
HTML table changed data comparision
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Highlight Changed Data</title>
<style>
.changed {
background-color: yellow;
}
@sanjaybhowmick
sanjaybhowmick / inr-numeric-words.php
Created June 29, 2024 06:25
Indian currency numeric to words conversion
<?php
function convertToIndianCurrencyWords($number) {
$ones = array(
0 => '', 1 => 'One', 2 => 'Two', 3 => 'Three', 4 => 'Four',
5 => 'Five', 6 => 'Six', 7 => 'Seven', 8 => 'Eight', 9 => 'Nine'
);
$teens = array(
11 => 'Eleven', 12 => 'Twelve', 13 => 'Thirteen', 14 => 'Fourteen',
15 => 'Fifteen', 16 => 'Sixteen', 17 => 'Seventeen', 18 => 'Eighteen',