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 | |
namespace Core; | |
use Closure; | |
use Exception; | |
use ReflectionClass; | |
/** | |
* Class Container |
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 | |
define('EOL', PHP_SAPI == 'cli' ? PHP_EOL : '<br>'); | |
$min = 1; | |
$max = 10; | |
$range = [$min, $max]; | |
foreach (range(...$range) as $i) { |
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
# Using curl: | |
curl -sSL https://finagin.github.io/ttl | sh | |
# Or wget: | |
wget -qO- https://finagin.github.io/ttl | sh |
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 | |
function f($number, $recursive = false, $dec = 10) | |
{ | |
if (!is_int($dec)) { | |
throw new \Exception('dec must integer'); | |
} elseif ($dec < 2) { | |
throw new \Exception('dec must be >= 2'); | |
} |
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 | |
class Str | |
{ | |
public static function split(string $str): array | |
{ | |
$words = preg_split('/(?:(?=[A-Z])|[-_\s])/', $str, -1, PREG_SPLIT_NO_EMPTY); | |
return array_map('strtolower', $words); | |
} |
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 | |
if (!function_exists('optional')) { | |
function optional($instance, $default = null) | |
{ | |
return new class($instance, $default = null) | |
{ | |
private $instance; | |
private $default; |
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 ($) { | |
function Shelf(value) { | |
var _value = value; | |
this.getValue = function () { | |
return _value; | |
}; | |
this.setValue = function (value) { | |
_value = value; | |
}; |
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 | |
namespace App\Support; | |
use \Illuminate\Support\Facades\Log as Logger; | |
/** | |
* Class Log | |
* | |
* @method static emergency($message, array $context = []) |
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
#!/usr/bin/env php | |
<?php | |
$domain = 'amobeeline'; | |
$nginx = <<<CONF | |
server { | |
listen 80; | |
listen 443 ssl; |