Skip to content

Instantly share code, notes, and snippets.

View prosenjit-manna's full-sized avatar
🎯
Focusing

Prosenjit Manna prosenjit-manna

🎯
Focusing
  • Itobuz Technologies
View GitHub Profile

Setup remote git repo on EC2

Create a bare repository

$ mkdir <repo-name>.git
$ cd <repo-name>.git
$ git init --bare
@prosenjit-manna
prosenjit-manna / nav-menu-exporter-importer.php
Created June 6, 2016 07:38 — forked from hissy/nav-menu-exporter-importer.php
[WordPress Plugin] Nav Menu Exporter and Importer / Export and Import nav menus. Requires WordPress Importer plugin.
<?php
/*
Plugin Name: Nav Menu Exporter and Importer
Description: Export and Import nav menus. Requires WordPress Importer plugin
Author: hissy, megumi themes
Version: 0.1
Text Domain: nav-menu-exporter-importer
License: GPL version 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/
// Get The Page ID You Need
get_option( 'woocommerce_shop_page_id' );
get_option( 'woocommerce_cart_page_id' );
get_option( 'woocommerce_checkout_page_id' );
get_option( 'woocommerce_pay_page_id' );
get_option( 'woocommerce_thanks_page_id' );
get_option( 'woocommerce_myaccount_page_id' );
get_option( 'woocommerce_edit_address_page_id' );
get_option( 'woocommerce_view_order_page_id' );
get_option( 'woocommerce_terms_page_id' );
@prosenjit-manna
prosenjit-manna / currency_list
Created June 23, 2016 11:17 — forked from MindaugasR/currency_list
World Currency list in PHP Array
array (
'ALL' => 'Albania Lek',
'AFN' => 'Afghanistan Afghani',
'ARS' => 'Argentina Peso',
'AWG' => 'Aruba Guilder',
'AUD' => 'Australia Dollar',
'AZN' => 'Azerbaijan New Manat',
'BSD' => 'Bahamas Dollar',
'BBD' => 'Barbados Dollar',
'BDT' => 'Bangladeshi taka',
@prosenjit-manna
prosenjit-manna / fn.php
Last active July 8, 2016 06:31
Wordpress image resize dynamically
<?php
/**
* @param array $params
*
* @since 4.2
* ifo_filters : ifo_ifoods_getimagesize - to override output of this function
* @return array|bool
*/
function ifoods_getImageBySize( $params = array() ) {
$params = array_merge( array(
[vc_row full_width="stretch_row_content_no_spaces" content_placement="middle" css=".vc_custom_1465896858540{padding-top: 0px !important;padding-right: 0px !important;padding-bottom: 0px !important;padding-left: 0px !important;}" el_class="banner-v3"][vc_column][vc_single_image image="2675" img_size="full" css=".vc_custom_1465896982911{margin: 0px !important;padding: 0px !important;}"][/vc_column][/vc_row][vc_row][vc_column][vc_single_image image="2663" img_size="full" alignment="center" css=".vc_custom_1465215200308{margin-bottom: 0px !important;}"][ultimate_heading main_heading="About Us" main_heading_color="#333333" sub_heading_color="#444444" spacer="line_only" spacer_position="bottom" line_height="1" line_color="#b02b3e" main_heading_font_family="font_family:Vidaloka|font_call:Vidaloka" main_heading_style="font-weight:bold;" main_heading_font_size="desktop:70px;" sub_heading_font_family="font_family:Lato|font_call:Lato" sub_heading_font_size="desktop:14px;" line_width="50" spacer_margin="margin-top:15px;"
@prosenjit-manna
prosenjit-manna / gist:4dcaabcfe108989fe11c83d76437bbfe
Created July 27, 2016 06:05 — forked from mikejolley/gist:2044109
WooCommerce - Update number of items in cart and total after Ajax
<?php
// Ensure cart contents update when products are added to the cart via AJAX (place the following in functions.php)
add_filter( 'woocommerce_add_to_cart_fragments', 'woocommerce_header_add_to_cart_fragment' );
function woocommerce_header_add_to_cart_fragment( $fragments ) {
ob_start();
?>
<a class="cart-contents" href="<?php echo WC()->cart->get_cart_url(); ?>" title="<?php _e( 'View your shopping cart' ); ?>"><?php echo sprintf (_n( '%d item', '%d items', WC()->cart->get_cart_contents_count() ), WC()->cart->get_cart_contents_count() ); ?> - <?php echo WC()->cart->get_cart_total(); ?></a>
<?php
@prosenjit-manna
prosenjit-manna / vt_resize.php
Created August 4, 2016 08:00 — forked from seedprod/vt_resize.php
Resize WordPress images on the fly vt_resize w/ multisite support
<?php
/*
* Resize images dynamically using wp built in functions
* Victor Teixeira
*
* php 5.2+
*
* Exemplo de uso:
*
* <?php
@prosenjit-manna
prosenjit-manna / GitHub-Forking.md
Created August 13, 2016 05:18 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, when I started going through the process of forking and issuing pull requests, I had some trouble figuring out the proper method for doing so and made quite a few mistakes along the way. I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your

<?php
/**
* New button implementation
* array_merge is needed due to merging other shortcode data into params.
* @since 4.5
*/
$pixel_icons = vc_pixel_icons();
require_once vc_path_dir( 'CONFIG_DIR', 'content/vc-icon-element.php' );