This file contains hidden or 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 node | |
const fs = require("fs"); | |
const readline = require("readline"); | |
const { spawn } = require("child_process"); | |
const path = require("path"); | |
// Parse command line arguments | |
const args = process.argv.slice(2); | |
const options = { | |
reset: args.includes("--reset"), |
This file contains hidden or 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 | |
declare(strict_types=1); | |
namespace Dev\Rector; | |
use Carbon\Carbon; | |
use Carbon\CarbonInterface; | |
use PhpParser\Node; | |
use PhpParser\Node\Arg; |
This file contains hidden or 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
#Requires -RunAsAdministrator | |
# Check if running as administrator | |
if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { | |
Write-Host "Error: This script requires administrator privileges. Please run PowerShell as Administrator." -ForegroundColor Red | |
Exit | |
} | |
Clear-Host | |
Write-Host "Create Custom Admin User Account" -ForegroundColor Cyan |
This file contains hidden or 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 | |
declare(strict_types=1); | |
namespace App\Providers; | |
use GuzzleHttp\Middleware; | |
use GuzzleHttp\Promise\PromiseInterface; | |
use Illuminate\Http\Client\PendingRequest; | |
use Illuminate\Support\Facades\Http; |
This file contains hidden or 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 | |
public function callableToCode(mixed $callable): ?string | |
{ | |
if (is_string($callable) && str_contains($callable, '@')) { | |
$callable = explode('@', $callable); | |
} | |
if (is_array($callable) && count($callable) === 2) { | |
[$class, $method] = $callable; | |
$instance = app($class); |
This file contains hidden or 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\Providers; | |
use App\CustomClipboard; | |
use Illuminate\Cache\ArrayStore; | |
use Illuminate\Support\ServiceProvider; | |
class AppServiceProvider extends ServiceProvider | |
{ |
This file contains hidden or 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 GuzzleHttp\Psr7\Utils; | |
use Illuminate\Support\Facades\Http; | |
$stream = Http::withOptions(['stream' => true]) | |
->get('https://example.com') | |
->toPsrResponse() | |
->getBody(); | |
while ($line = Utils::readLine($stream)) { |
This file contains hidden or 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 Artisan; | |
use Illuminate\Foundation\Testing\RefreshDatabase; | |
use Illuminate\Foundation\Testing\RefreshDatabaseState; | |
use Illuminate\Support\Str; | |
trait LazilyRefreshDatabaseIfNecessary |
This file contains hidden or 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 Deployer; | |
require_once __DIR__.'/vendor/deployer/deployer/recipe/common.php'; | |
add('recipes', ['laravel']); | |
//set('shared_dirs', ['storage']); | |
set('shared_files', ['.env']); |
This file contains hidden or 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\Providers; | |
use GuzzleHttp\Middleware; | |
use Illuminate\Support\Facades\Http; | |
use Illuminate\Support\ServiceProvider; | |
class AppServiceProvider extends ServiceProvider | |
{ |
NewerOlder