Input:
var someDynamicParam = 9812894732432;
$location.search('myParams', someDynamicParam).path('/request');
Output:
function extend (target, source) { | |
target = JSON.parse(JSON.stringify(target)); | |
Object.keys(source).map(function (prop) { | |
Object.prototype.hasOwnProperty.call(target, prop) && (target[prop] = source[prop]); | |
}); | |
return target; | |
}; |
/** | |
* Read the post for full details, hope these comments are helpful! | |
* http://toddmotto.com/angular-js-dependency-injection-annotation-process | |
*/ | |
function annotate(fn, strictDi, name) { | |
var $inject, | |
fnText, | |
argDecl, | |
last; | |
Z21haWxpbnZpdGU#AAjWDC2eHXTaEvbWN19YkGu-csrdu0xEv0RAqZIRtXDlouoVrL9F7Hgs1ITcurRw4omVdrjPjhYFm7V2pUYPhe57u_s5KqDn7A#ZXRpdm5pbGlhbWc |
Input:
var someDynamicParam = 9812894732432;
$location.search('myParams', someDynamicParam).path('/request');
Output:
add_filter('pre_comment_content', 'encode_code_in_comment'); | |
function encode_code_in_comment($source) { | |
$encoded = preg_replace_callback('/<code>(.*?)<\/code>/ims', | |
create_function( | |
'$matches', | |
'$matches[1] = preg_replace( | |
array("/^[\r|\n]+/i", "/[\r|\n]+$/i"), "", | |
$matches[1]); | |
return "<code>" . esc_html( $matches[1] ) . "</code>";' |
// Retina Device, add 'retina' to HTML tag | |
if (window.devicePixelRatio >= 2) { | |
document.getElementsByTagName('html')[0].className += ' retina'; | |
} | |
// No-retina Device, add 'no-retina' to HTML tag | |
else { | |
document.getElementsByTagName('html')[0].className += ' no-retina'; | |
} |
<!-- jQuery CDN Failsafe to CloudFlare CDN --> | |
<script>window.jQuery || document.write('<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.8.3/jquery.min.js"><\/script>');</script> |
// SVG custom feature detection and svg to png fallback | |
// toddmotto.com/mastering-svg-use-for-a-retina-web-fallbacks-with-png-script#update | |
function supportsSVG() { | |
return !! document.createElementNS && !! document.createElementNS('http://www.w3.org/2000/svg','svg').createSVGRect; | |
} | |
if (supportsSVG()) { | |
document.documentElement.className += ' svg'; | |
} else { | |
document.documentElement.className += ' no-svg'; | |
var imgs = document.getElementsByTagName('img'), |
// Headings | |
function heading( $atts ) | |
{ | |
extract(shortcode_atts(array( | |
'tag' => '', | |
'text' => '', | |
), $atts)); | |
return '<h' . $tag . '>' . $text . '</h' . $tag . '>'; | |
} | |
add_shortcode('heading', 'heading'); |
var iOS = navigator.userAgent.match(/(iPad)|(iPhone)|(iPod)/i); | |
if (!iOS) { | |
// Run scripts for anything but iOS | |
} |