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
| /* jQuery Tiny Pub/Sub - v0.8 - 07/19/2018 | |
| * http://benalman.com/ | |
| * Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */ | |
| (function($) { | |
| var o = $({}); | |
| $.subscribe = function() { | |
| o.on.apply(o, arguments); |
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 | |
| add_action('add_meta_boxes', 'add_country_name_meta_box'); | |
| function add_country_name_meta_box() | |
| { | |
| add_meta_box( | |
| 'country_name_meta_box', | |
| __('Widget Title', 'theme_name'), | |
| 'add_country_name_meta_box_callback', // Prints the box content | |
| 'post', // $page |
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').val('VALUE').trigger('change'); |
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
| $fa-var-500px: \f26e; | |
| $fa-var-address-book: \f2b9; | |
| $fa-var-address-book-o: \f2ba; | |
| $fa-var-address-card: \f2bb; | |
| $fa-var-address-card-o: \f2bc; | |
| $fa-var-adjust: \f042; | |
| $fa-var-adn: \f170; | |
| $fa-var-align-center: \f037; | |
| $fa-var-align-justify: \f039; | |
| $fa-var-align-left: \f036; |
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
| // input[type="reset"] sucks. Do it manually | |
| $(':input', this.form).each(function () { | |
| var type = this.type, | |
| tag = this.tagName.toLowerCase(); | |
| if (type == 'text' || type == 'search' || type == 'password' || tag == 'textarea') { | |
| this.value = ""; | |
| } else if (type == 'checkbox' || type == 'radio') { | |
| this.checked = false; |
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
| function parseQueryString () { | |
| var str = window.location.search, | |
| objURL = {}, | |
| isArray = _.isArray, | |
| first; | |
| str.replace( | |
| new RegExp('([^?=&]+)(=([^&]*))?', 'g'), | |
| function ($0, $1, $2, $3) { | |
| if (objURL[$1] && !isArray(objURL[$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
| @media print { | |
| // Show Only Active Slide | |
| .slick-slide { | |
| display: none !important; | |
| &.slick-active { | |
| display: block !important; | |
| } | |
| } | |
| // Reset adaptiveHeight |
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
| /** | |
| * Returns the scroll target position for scrolling to the top of an element. | |
| * | |
| * Pass the result to a scrollTo method: | |
| * | |
| * - $scrollContainer.scrollTop( result ) for instant scrolling | |
| * - $scrollContainer.scrollTo( result ) for animated scrolling with jQuery.scrollable | |
| * | |
| * @param {jQuery} $target the target element | |
| * @param {jQuery} $scrollContainer either $(window), or a scrollable HTML element |
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
| // NOTE: I added the .js extension to this gist so it would have syntax highlighting. This file should have NO file extension | |
| { | |
| // Settings | |
| "passfail" : false, // Stop on first error. | |
| "maxerr" : 100, // Maximum error before stopping. | |
| // Predefined globals whom JSHint will ignore. | |
| "browser" : true, // Standard browser globals e.g. `window`, `document`. |