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
#!/bin/bash | |
set -eu | |
CLOUDFLARE_FILE_PATH=/etc/nginx/cloudflare | |
echo "# Cloudflare" > $CLOUDFLARE_FILE_PATH; | |
echo "" >> $CLOUDFLARE_FILE_PATH; |
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
#!/bin/bash | |
set -eu | |
# Get the Cloudflare IPs. | |
curl -s https://www.cloudflare.com/ips-v4 -o /tmp/cloudflare_ips | |
echo "" >> /tmp/cloudflare_ips | |
curl -s https://www.cloudflare.com/ips-v6 >> /tmp/cloudflare_ips | |
# Reset the firewall to clean stuff. |
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 | |
/** | |
* Class Duration | |
* Represents a time span with microsecond precision, similar to Dart's Duration class. | |
*/ | |
class Duration | |
{ | |
/** | |
* @var int Total duration in microseconds. |
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
/** | |
* Query SQL databases using CSS (mysql, sqlite, postgresql). | |
* | |
* Syntax: sql("<dsn>", "<query>", "<jsonpath>") | |
* | |
* @example #userName::before { | |
* content: sql("mysql://user:password@host:port/database", "SELECT * FROM users WHERE id = 1", "$.0.name"); | |
* } | |
*/ | |
module.export = { |
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
function getContrastYIQ(string $hexColor): string | |
{ | |
$hex = str_replace('#', '', $hexColor); | |
$r = hexdec(substr($hex, 0, 2)); | |
$g = hexdec(substr($hex, 2, 2)); | |
$b = hexdec(substr($hex, 4, 2)); |
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 | |
function parse_http_request(string $request): array | |
{ | |
[$rawHeaders, $rawBody] = mb_split('\r\n\r\n', $request, 2); | |
$rawHeaders = mb_split('\r\n', $rawHeaders); | |
$requestLine = array_shift($rawHeaders); |
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\Listeners; | |
use Exception; | |
use Throwable; | |
use Illuminate\Support\Facades\DB; | |
use Illuminate\Support\Facades\Cache; | |
use Illuminate\Support\Facades\Redis; | |
use Illuminate\Support\Facades\Process; |
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\Models; | |
use App\Enums\ConnectionProviderType; | |
use Illuminate\Database\Eloquent\Model; | |
use Database\Factories\ConnectionFactory; | |
use Illuminate\Database\Eloquent\Relations\BelongsTo; | |
use Illuminate\Database\Eloquent\Factories\HasFactory; |
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\Support\Synthesizers; | |
use Akaunting\Money\Currency; | |
use Livewire\Mechanisms\HandleComponents\Synthesizers\Synth; | |
class CurrencySynthesizer extends Synth | |
{ | |
public static string $key = 'currency'; |
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
name: Deploy to Servers | |
on: | |
push: | |
branches: | |
- production | |
jobs: | |
production-deploy: | |
runs-on: ubuntu-latest |
NewerOlder