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 getCache = function(cacheKey, expireMinutes) { | |
var value = sessionStorage.getItem(cacheKey); | |
var timestamp = Math.floor(Date.now() / 1000); | |
var expireTime = timestamp - (expireMinutes * 60); | |
var data = null; | |
if (value === null) { | |
return null; | |
} | |
data = JSON.parse(value); | |
if (typeof data !== 'object') { |
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 | |
$scan = new ImageScanner('plaatje2.png'); | |
if ($scan->contains_something_in_edge()) { | |
echo '<font color="red">Image needs bleed</font>'; | |
} else { | |
echo '<font color="green">Image doesn\'t need bleed</font>'; | |
} |
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 | |
use Illuminate\Support\Arr; | |
use Illuminate\Support\Str; | |
use Illuminate\Database\Capsule\Manager as Capsule; | |
/** | |
* Simple YouTube Crawler class for Worpress | |
* | |
* @author Mike van Veenhuijzen <[email protected]> |
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 | |
use BadMethodCallException; | |
trait LinkCheckerTrait { | |
/** | |
* The failed links. | |
* | |
* @var array |
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 | |
Response::macro('streamed', function($type, $size, $name, $callback) { | |
$start = 0; | |
$length = $size; | |
$status = 200; | |
$headers = [ | |
'Content-Type' => $type, | |
'Content-Length' => $size, |