Skip to content

Instantly share code, notes, and snippets.

cron13

Block or report user

Report or block cron13

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cron13
cron13 / glide_imageoptimizer.php
Last active Aug 19, 2019
spatie/image-optimizer + spatie/laravel-glide
View glide_imageoptimizer.php
<?php
class Awesome extends League\Flysystem\Adapter\Local {
public function write($path, $contents, League\Flysystem\Config $config) {
$location = $this->applyPathPrefix($path);
$this->ensureDirectory(dirname($location));
if (($size = file_put_contents($location, $contents, $this->writeFlags)) === false) {
return false;
}
View m.js
var libUrl = null;
var scriptTag = Array.prototype.slice
.call(document.getElementsByTagName("script"))
.filter(x => /\?proxy?/.test(x.src));
if (scriptTag.length > 0) {
libUrl = scriptTag[0].src.split("m.js")[0];
} else {
throw new Error("missing '?proxy' query parameter in your proxy url!");
}
You can’t perform that action at this time.