This file contains 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
// MULTIPLE *UNIQUE* ARRAY VALUES (uses jQuery) | |
// Parameter arr: array containing values | |
// Parameter totalNum: total number of values to get | |
// Returns Array | |
function rndArrValues(arr, totalNum){ | |
if ( totalNum <= 0 ){ return; } | |
var theResult = []; | |
var newElement; |
This file contains 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
// For getting unique values in array | |
// usage: | |
// var duplicates = [1,3,4,2,1,2,3,8]; | |
// var uniques = duplicates.unique(); // result = [1,3,4,2,8] | |
Array.prototype.contains = function(v) { | |
for(var i = 0; i < this.length; i++) { | |
if(this[i] === v) return true; | |
} | |
return false; | |
}; |
This file contains 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 Mobile Android-style Toast popup | |
// https://gist.github.com/kamranzafar/3136584 | |
// Usage: toast("Your Message Here"); | |
var toast = function(msg){ | |
$("<div class='ui-loader ui-overlay-shadow ui-body-e ui-corner-all'><h4>"+msg+"</h4></div>") | |
.css({ display: "block", | |
opacity: 0.96, | |
"background-color": "#332C2C", | |
"z-index":"9999", | |
position: "fixed", |
This file contains 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 | |
// ACTUAL DECLARATION OF SECTIONS | |
$this->sections[] = array( | |
'icon' => 'el-icon-cogs', | |
'title' => __('General Settings', 'YOURTHEME'), | |
'fields' => array( | |
array( | |
'id' => 'opt-social-facebook', | |
'type' => 'text', |
This file contains 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 | |
// http://webandphp.com/remove-markup-from-wordpress-shortcodes | |
/** | |
* Removes mismatched </p> and <p> tags from a string | |
* | |
* @author Jason Lengstorf <jason@copterlabs.com> | |
*/ | |
function copter_remove_crappy_markup( $string ) | |
{ |
This file contains 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(document).ready(function($){ | |
$(document).on('click', '.dot-irecommendthis',function() { | |
var link = $(this); | |
if(link.hasClass('active')) return false; | |
var id = $(this).attr('id'), | |
suffix = link.find('.dot-irecommendthis-suffix').text(); | |
$.post(dot_irecommendthis.ajaxurl, { action:'dot-irecommendthis', recommend_id:id, suffix:suffix }, function(data){ |
This file contains 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
// via http://stackoverflow.com/questions/4550505/getting-random-value-from-an-array | |
// usage: var myRandomDiffElement = myArray.randomDiffElement(lastRandomElement); | |
Array.prototype.randomDiffElement = function(last) { | |
if (this.length == 0) { | |
return; | |
} else if (this.length == 1) { | |
return this[0]; | |
} else { | |
var num = 0; | |
do { |
This file contains 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
// Snippet from app.js | |
.run(function($ionicPlatform, $rootScope) { | |
$ionicPlatform.ready(function() { | |
if(window.cordova && window.cordova.plugins.Keyboard) { | |
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); | |
} | |
if(window.StatusBar) { | |
StatusBar.styleDefault(); | |
} |
This file contains 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
# You may use the command line option '-S' to verify your virtual host | |
# configuration. | |
# | |
# Use name-based virtual hosting. | |
# | |
NameVirtualHost *:80 | |
# | |
# VirtualHost example: |
This file contains 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 | |
// ---------------------------------------------------- | |
// WooCommerce Additions to functions.php in WordPress | |
// ---------------------------------------------------- | |
// Theme support. Removes warning message in admin. | |
add_theme_support( 'woocommerce' ); | |
// Removing tabs and replace with simple product description (removes "Reviews" etc) | |
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 ); |
OlderNewer