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
if(jQuery.browser.msie){ | |
var version = jQuery.browser.version; | |
switch(version){ | |
case "6.0": | |
jQuery("html").addClass("ie ie6 lte10 lte9 lte8 lte7"); | |
break; | |
case "7.0": | |
jQuery("html").addClass("ie ie7 lte10 lte9 lte8 lte7"); | |
break; | |
case "8.0": |
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
// ---------------------------------------------------------- | |
// A short snippet for detecting versions of IE in JavaScript | |
// without resorting to user-agent sniffing | |
// ---------------------------------------------------------- | |
// If you're not in IE (or IE version is less than 5) then: | |
// ie === undefined | |
// If you're in IE (>=5) then you can determine which version: | |
// ie === 7; // IE7 | |
// Thus, to detect IE: | |
// if (ie) {} |
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
var src = "http://placekitten.com/500/500", | |
img = $("<img />"); | |
img.hide().attr("src", src); | |
img.load(function() { | |
// Image is loaded | |
}); |
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
$.ajax({ | |
url: '/URL/', | |
type: 'POST', /* POST/GET */ | |
dataType: 'json', /* xml/html/script/json/jsonp */ | |
data: form_data, | |
crossDomain: true, | |
success: function(data, textStatus, xhr) { | |
/* success */ | |
}, | |
error: function(xhr, textStatus, errorThrown) { |
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 | |
/** | |
* A pretty version of "print_r" function | |
* | |
* @param Array|stdClass $obj | |
* @param string $title Optional. | |
* @param bool $collapse Optional. | |
* @return string Type returned. | |
*/ |
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
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="> |
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
{ | |
"New York": [ | |
"New York", | |
"Buffalo", | |
"Rochester", | |
"Yonkers", | |
"Syracuse", | |
"Albany", | |
"New Rochelle", | |
"Mount Vernon", |
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 | |
/** | |
* Send WooCommerce order email(s) | |
* | |
* @param integer $order_id WooCommerce order id. | |
* @param string|array $email_id The id of the email or an array of the email ids that need to send. | |
* @return bool Type returned Will return true if the email id provided is sent successfully. | |
*/ | |
function send_wc_order_email($order_id, $email_id) { |
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 | |
class LocalValetDriver extends LaravelValetDriver { | |
/** | |
* Determine if the driver serves the request. | |
* | |
* @param string $sitePath | |
* @param string $siteName | |
* @param string $uri |
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 | |
/** | |
* @author Ahmad Karim <hello@ahmadkarim.com> | |
* | |
* DEV & PROD specific variables | |
* for WordPress when working with | |
* LOCAL & LIVE instances at the same time | |
*/ | |
$localhosts = array('127.0.0.1', '::1'); |
OlderNewer