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\App; | |
use Symfony\Component\Uid\Factory\UlidFactory; | |
class ExecutionId implements \Stringable | |
{ | |
private string $id; |
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\Models; | |
use Illuminate\Database\PostgresConnection; | |
use Illuminate\Support\Arr; | |
trait Searchable | |
{ | |
public function scopeSearch( |
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\Services\Telescope\Watchers; | |
use Illuminate\Http\Client\Events\ResponseReceived; | |
use Laravel\Telescope\IncomingEntry; | |
use Laravel\Telescope\Watchers\ClientRequestWatcher as BaseWatcher; | |
use Laravel\Telescope\Telescope; | |
class ClientRequestWatcher extends BaseWatcher |
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; | |
class HighOrderCacheProxy | |
{ | |
protected string $ttl = '15 minutes'; | |
protected array $tags = []; | |
public function __construct( |
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\Contracts\Cache\Repository; | |
class CacheManager | |
{ | |
private ?string $driver = null; |
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
import numpy as np | |
import multiprocessing as mp | |
import random | |
import math | |
threads = mp.cpu_count() | |
points = 100_000_000 | |
def simulate_pi(points): | |
radius = 1 |
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\QueryBuilderCriteria; | |
use App\Contracts\QueryBuilderCriteria; | |
use Illuminate\Database\PostgresConnection; | |
class OrderByPriorityTrendCriterion extends QueryBuilderCriteria | |
{ | |
public function apply($queryBuilder) |
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 Ds\Map; | |
function memo(callable $function): callable | |
{ | |
$cache = new Map(); | |
return function (mixed ...$args) use (&$cache, $function): mixed { | |
if (isset($cache[$args])) { | |
return $cache[$args]; |
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 Tests; | |
use App\User; | |
use Tests\TestCase; | |
use Illuminate\Notifications\Notification; | |
class MyNotification extends Notification | |
{ |
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 tail($fn) | |
{ | |
$underCall = false; | |
$pool = []; | |
return function (...$args) use (&$fn, &$underCall, &$pool) { | |
$result = null; | |
$pool[] = $args; |
NewerOlder