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 | |
// DEFAULT OPTIONS | |
$GLOBALS['ppr_mode'] = 'screen'; // mode = screen | popup | email | log | off | |
$GLOBALS['ppr_char_limit'] = 200;//1024 * 500; | |
$GLOBALS['ppr_str_limit'] = 1024 * 4; | |
$GLOBALS['ppr_backtrace_str_limit'] = 100; | |
$GLOBALS['ppr_backtrace_array_limit'] = 6; | |
$GLOBALS['ppr_backtrace_arg_limit'] = 5; | |
$GLOBALS['ppr_mailto'] = @$_SERVER['SERVER_ADMIN']; |
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
function defineMyPlugin($) { | |
/*...*/ | |
} | |
if (typeof define == 'function') { | |
define('MyPlugin', ['jquery'], defineMyPlugin); | |
} | |
else { | |
defineMyPlugin(jQuery); | |
} |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
function qsa(sel, each) { | |
return [].map.call(document.querySelectorAll(sel) || [], each || function(el) {return el}); | |
} | |
// usage: | |
qsa('a[href*="/reports/"], .legend', function(el) { | |
el.style.visibility = 'hidden'; | |
}); |
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 ids = {}; | |
var repeats = []; | |
document.body.innerHTML.replace(/ id="(.+?)"/g, function($0, $1) { | |
if (ids[$1]) repeats.push($1); | |
ids[$1] = true; | |
}); | |
console.log(repeats); | |
// output | |
["carouselitem-2887", "carouselitem-2850", "slider-2887", "slider-2850", "carouselitem-2887", "carouselitem-2850", "carouselitem-2843", "slider-2887", "slider-2850", "slider-2843", "carouselitem-2887", "carouselitem-2850", "carouselitem-2843", "slider-2887", "slider-2850", "slider-2843", "carouselitem-2918", "carouselitem-2924", "carouselitem-2923", "carouselitem-2922", "carouselitem-2919", "carouselitem-2917", "carouselitem-2916", "carouselitem-2913", "carouselitem-2912", "carouselitem-2911", "carouselitem-2909", "carouselitem-2898", "carouselitem-2897", "carouselitem-2896", "carouselitem-2895", "carouselitem-2892", "carouselitem-2887", "carouselitem-2882", "carouselitem-2881", "carouselitem-2874", "slider-2918", "slider-2924", "slider-2923", "slider-2922", "slider-2919", "slider-2917", "slider-2916", "slider-2913", "sli |
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
.ri-image-wrapper { | |
display: none !important; | |
} |
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 | |
$foo = castObject($bar, '\\My\\FooObject'); | |
function castObject($obj, $toClass) { | |
if (is_callable("$toClass::__cast")) { | |
return call_user_func("$toClass::__cast", $obj); | |
} | |
if ($obj instanceof $toClass) { | |
return $obj; |
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
/* | |
# Usage in html template: | |
"xxx | nl2br" | |
<div ng-bind-html=" YourString | nl2br "></div> | |
or: |
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
Benchmarking against 10 iteration(s): | |
--- 1.2MB jpg file --- | |
0.298s - data uri base64_encode() | |
0.701s - data uri urlencode() | |
0.702s - data uri rawurlencode() | |
0.045s - temp file | |
--- 2.5MB jpg file --- | |
0.597s - data uri base64_encode() |
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
.adg3 .ghx-column h2 { | |
text-transform: none; | |
font-size: 13px; | |
color: #2e2e2e | |
} | |
.adg3 .ghx-column-headers .ghx-qty { | |
background-color: #18cb3b; | |
color: white; | |
width: 20px; | |
height: 20px; |