Skip to content

Instantly share code, notes, and snippets.

View punit5658's full-sized avatar
🏖️
Work anywhere

Punit Patel punit5658

🏖️
Work anywhere
View GitHub Profile
@punit5658
punit5658 / Issues.md
Created March 4, 2022 19:12 — forked from kibotu/Issues.md
Ticket Templates

Bug Report Template

Help your QAs and the rest of your Agile Team members report bugs consistently! Use the bug report template for Jira issues and speed up the issue preparation process. This template ensures the reporter will provide enough information for the team to reproduce and fix the bug.


Provide a general summary of the issue in the Title above.

Expected Behaviour

#### Issue description
#### Steps to reproduce the issue
1.
2.
3.
@punit5658
punit5658 / installation.txt
Last active March 2, 2022 23:43
Node manager through NVM
Remove Node
brew uninstall --ignore-dependencies node
brew uninstall --force node
Update brew and install NVM
brew update
brew install nvm
Next, create a directory for NVM.
mkdir ~/.nvm
@punit5658
punit5658 / config.inc.php
Last active April 20, 2021 16:04
How to access remote MySql using local phpmyadmin
Open Location of phpMyAdmin and edit : config.inc.php ( Command : sudo vi config.inc.php )
Add following line to end of the file :
<?php
$i++;
$cfg['Servers'][$i]['host'] = '192.168.1.133';
$cfg['Servers'][$i]['user'] = 'username';
$cfg['Servers'][$i]['password'] = 'password';
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['compress'] = false;
@punit5658
punit5658 / composite-product.js
Created May 5, 2020 03:48
Composite Product Options
pageElem = jQuery('html').find('.pagination_elements');
pageElem.children().hide();
pageElem.find('li').slice(0,5).show();
jQuery('.composite_pagination').bind('DOMSubtreeModified', function(a,b){
pageElem = jQuery('html').find('.pagination_elements');
pageElem.children().hide();
if( pageElem.find('.pagination_element_current').nextAll().andSelf().length > 5 ){
pageElem.find('.pagination_element_current').nextAll().andSelf().slice(0,5).show();
}else{
pageElem.find('li').slice(-5).show();
@punit5658
punit5658 / functions.php
Created November 15, 2018 06:59
Enable SKU search in woocommerce
<?php
/**
* Join posts and postmeta tables
*
* @param string $join
* @param WP_Query $query
*
* @see https://iconicwp.com/blog/add-product-sku-woocommerce-search/
*
* @return string
@punit5658
punit5658 / functions.php
Last active September 19, 2018 12:53
WordPress pagination when we have created page same slug as post type
<?php
function pnavigation( $wp_query ) {
$big = 999999999; // need an unlikely integer
$pages = paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var('paged') ),
'total' => $wp_query->max_num_pages,
'prev_next' => false,
@punit5658
punit5658 / nginx.conf
Last active May 31, 2018 12:13
Nginx Configuration
gzip on;
gzip_static on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_min_length 512;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/css text/javascript text/xml text/plain text/x-component application/javascript application/x-javascript application/json application/xml application/rss+xml font/truetype application/x-font-ttf font/opentype application/vnd.ms-fontobject image/svg+xml;
@punit5658
punit5658 / magento-product-metabox.php
Last active December 6, 2017 05:52
List Magento Product Name, ID and Sku in WordPress side metabox
<?php
function wpdocs_register_meta_boxes() {
add_meta_box( 'product-list-box', __( 'Product List', 'textdomain' ), 'product_list_callback', 'articles','side' );
}
add_action( 'add_meta_boxes', 'wpdocs_register_meta_boxes' );
function product_list_callback(){ ?>
<select name="product_list[]" multiple>
<?php
global $wpdb, $post;
@punit5658
punit5658 / csv-export.js
Created August 21, 2017 12:21
Export CSV using jQuery.
jQuery(document).ready(function($) {
var newarr = [];
$table = jQuery('table');
var dyarr = [];
$table.find('tr').each(function(){
$(this).find('td font').each(function(){
dyarr.push( $(this).html() ); // Column
});
newarr.push(dyarr); // Row