Skip to content

Instantly share code, notes, and snippets.

View codyphobe's full-sized avatar
🏍️
Chasing the sunset

Cody codyphobe

🏍️
Chasing the sunset
View GitHub Profile
@Dan-Q
Dan-Q / _no_code_page_.php
Last active December 28, 2023 18:01
Hacky PHP to produce a "blank" web page which somehow has content when viewed in Firefox. Sample page at https://danq.me/wp-content/no-code-webpage/, explanation at https://danq.me/nocode
<?php
// half-hearted CSS minification
$css = preg_replace(
array('/\s*(\w)\s*{\s*/','/\s*(\S*:)(\s*)([^;]*)(\s|\n)*;(\n|\s)*/','/\n/','/\s*}\s*/'),
array('$1{ ','$1$3;',"",'} '),
file_get_contents('linked.css')
);
// embed as a data: uri
$base64css = rtrim(strtr(base64_encode($css), '+/', '-_'), '=');
@niklaskorz
niklaskorz / Caddyfile
Created November 19, 2022 12:24
rheinneckar.social caddy config
www.rheinneckar.social {
redir https://rheinneckar.social{uri}
}
rheinneckar.social {
encode zstd gzip
reverse_proxy /api/v1/streaming* 127.0.0.1:4000
reverse_proxy 127.0.0.1:3000
}
@elijahmanor
elijahmanor / .zshrc
Last active May 5, 2023 17:26
ghpr function
function ghpr() {
GH_FORCE_TTY=100% gh pr list | fzf --query "$1" --ansi --preview 'GH_FORCE_TTY=100% gh pr view {1}' --preview-window down --header-lines 3 | awk '{print $1}' | xargs gh pr checkout
}
# awesome!
@PhiloNL
PhiloNL / .env
Last active August 17, 2023 20:21
Simple, fast, and resilient open-source WebSockets server using Soketi with SSL in less than 5 minutes
PUSHER_HOST=socket.yourdomain.com
PUSHER_APP_ID=unlock
PUSHER_APP_KEY=123
PUSHER_APP_SECRET=456
PUSHER_PORT=443
PUSHER_SCHEME=https
@viezel
viezel / Readme.md
Last active May 30, 2023 22:51
Invoker Docker support

Use Invoker with Docker

composer require viezel/dock --dev
php artisan dock:install

Now publish the docker-compose

@gwleuverink
gwleuverink / progress-bar.blade.php
Last active April 9, 2024 10:31
Progress bar blade component
@props([
'percentage' => 0,
'failed' => false
])
@php
$done = $failed || $percentage == 100;
@endphp
<div {{ $attributes->merge(['class' => ' space-y-1'])->whereDoesntStartWith('wire:poll') }}
@mpociot
mpociot / composer.json
Last active January 20, 2021 05:00
Simple ReactPHP chat server - connect to it: nc laracon.beyondco.de 8000
{
"require": {
"react/event-loop": "^1.1",
"react/stream": "^1.1",
"react/promise": "^2.8",
"react/socket": "^1.6",
"react/http": "^1.2",
"nubs/random-name-generator": "^2.2"
}
}
@gabriel-nsiqueira
gabriel-nsiqueira / CooldownButton.cs
Last active January 19, 2021 18:00
CooldownButton for AmongUs mod
//In HudManager.Start, Initialize the class
//HudManager.Update, call CooldownButton.HudUpdate
public class CooldownButton
{
public static List<CooldownButton> buttons = new List<CooldownButton>();
public KillButtonManager killButtonManager;
private Color startColorButton = new Color(255, 255, 255);
private Color startColorText = new Color(255, 255, 255);
public Vector2 PositionOffset = Vector2.zero;
public float MaxTimer = 0f;
@fourstacks
fourstacks / TestCase.php
Created September 9, 2020 08:25
Example TestCase using Laravel 8 model factories
<?php
namespace Tests;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
use Illuminate\Support\Str;
abstract class TestCase extends BaseTestCase
{
@drupol
drupol / parse-commit-log.php
Last active September 19, 2020 11:11
Parse commit log with loophp/collection
<?php
declare(strict_types=1);
include 'vendor/autoload.php';
use loophp\collection\Collection;
use loophp\collection\Contract\Collection as CollectionInterface;
$commandStream = static function (string $command): Generator {