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 | |
$src = 'foo { border-radius: 4px; } | |
bar { box-shadow: 5px 0 0 rgba(0, 0, 0, .5); | |
baz { background-image: url(img/baz.png); } | |
quux { background-image: url(img/quuz.png#!); }'; | |
preg_match_all('/url\((.*\.png)\)/U', $src, $matches); | |
foreach ($matches[1] as $match) { | |
$src = str_replace($match, 'data:image/png;base64,' . base64_encode(file_get_contents($match)), $src); |
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
// Thanks to this “nifty” script, async GA tracking on amsterdam.nl | |
// links makes sure you have to click certain links twice if you | |
// block trackers and stuff. Yay. | |
$.fn.analyticsPushEventClick = function(obj, href, category, async) { | |
$(this).on("click", function(event) { | |
return analyticsPushEvent(event, obj, href, category, async); | |
}); | |
}; | |
analyticsPushEvent = function(event, obj, href, category, async) { |