This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Adds the thousands separator | |
| function numberWithThousands(x) { | |
| return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, "."); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Zendesk Trigger Search Script | |
| SETUP INSTRUCTIONS: | |
| 1. Make sure you have Python 3.x installed | |
| 2. Create a virtual environment (recommended): | |
| python3 -m venv venv | |
| source venv/bin/activate # On Windows: venv\Scripts\activate | |
| 3. Install required dependencies: | |
| pip install requests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Adding the Open Graph in the Language Attributes - functions.php | |
| function add_opengraph_doctype( $output ) { | |
| return $output . ' xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml"'; | |
| } | |
| add_filter('language_attributes', 'add_opengraph_doctype'); | |
| //Lets add Open Graph Meta Info | |
| function insert_fb_in_head() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php if ( has_post_thumbnail() ) :?> | |
| <a href="<?php the_permalink() ?>" class="thumb"><?php the_post_thumbnail('thumbnail', array( | |
| 'alt' => trim(strip_tags( $post->post_title )), | |
| 'title' => trim(strip_tags( $post->post_title )), | |
| )); ?></a> | |
| <?php endif; ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT p.id_product, p.active, pl.name, GROUP_CONCAT(DISTINCT(cl.name) SEPARATOR ",") as categories, p.price, p.id_tax_rules_group, p.wholesale_price, p.reference, p.supplier_reference, p.id_supplier, p.id_manufacturer, p.upc, p.ecotax, p.weight, p.quantity, pl.description_short, pl.description, pl.meta_title, pl.meta_keywords, pl.meta_description, pl.link_rewrite, pl.available_now, pl.available_later, p.available_for_order, p.date_add, p.show_price, p.online_only, p.condition, p.id_shop_default | |
| FROM ps_product p | |
| LEFT JOIN ps_product_lang pl ON (p.id_product = pl.id_product) | |
| LEFT JOIN ps_category_product cp ON (p.id_product = cp.id_product) | |
| LEFT JOIN ps_category_lang cl ON (cp.id_category = cl.id_category) | |
| LEFT JOIN ps_category c ON (cp.id_category = c.id_category) | |
| LEFT JOIN ps_product_tag pt ON (p.id_product = pt.id_product) | |
| WHERE pl.id_lang = 1 | |
| AND cl.id_lang = 1 | |
| AND p.id_shop_default = 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php /* | |
| WP No Category Base | |
| */ | |
| // Refresh rules on activation/deactivation/category changes | |
| register_activation_hook(__FILE__, 'no_category_base_refresh_rules'); | |
| add_action('created_category', 'no_category_base_refresh_rules'); | |
| add_action('edited_category', 'no_category_base_refresh_rules'); | |
| add_action('delete_category', 'no_category_base_refresh_rules'); | |
| function no_category_base_refresh_rules() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {foreach from=$features item=feature} | |
| {if $feature.id_feature = 1} | |
| <tr> | |
| <td>{$feature.value|escape:'htmlall':'UTF-8'}</td> | |
| <td>{$feature.id|escape:'htmlall':'UTF-8'}</td> | |
| </tr> | |
| {/if} | |
| {/foreach} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(document).ready(function() { | |
| // Select the target node (tweet modal) | |
| var target = $('.PermalinkOverlay-modal').get(0); | |
| // Create an observer instance | |
| var observer = new MutationObserver(function(mutations) { | |
| mutations.forEach(function(mutation) { | |
| // Get the Twitter modal window replies count | |
| var loneTweetsCount = $('.PermalinkOverlay-body .ThreadedConversation--loneTweet .tweet').length |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Listen to content.js events | |
| chrome.extension.onMessage.addListener( | |
| function(request, sender, sendResponse) { | |
| if (request.count || request.count === 0) { | |
| chrome.browserAction.setBadgeText({'text': request.count.toString()}) | |
| } | |
| } | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // select the target node | |
| var target = document.querySelector('#some-id'); | |
| // create an observer instance | |
| var observer = new MutationObserver(function(mutations) { | |
| mutations.forEach(function(mutation) { | |
| console.log(mutation.type); | |
| }); | |
| }); |
NewerOlder