Skip to content

Instantly share code, notes, and snippets.

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

Cody Scott codyphobe

🏍️
Chasing the sunset
  • Oregon, USA
  • 06:43 (UTC -08:00)
View GitHub Profile
@Dan-Q
Dan-Q / _no_code_page_.php
Last active October 12, 2024 16:49
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 7, 2024 20:19
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
@vi
vi / interesting_crates.md
Last active October 19, 2025 22:28
List of crates that improves or experiments with Rust, but may be hard to find

Let's list here crates that enhance Rust as a language.

It not "batteries" like in stdx, but Rust-specific crates for workarounds for various missing features and experimental ideals from non-accepted/postponed RFCs, or just hacky tricks.

The list is supposed to contain (mostly) crates that are internal to Rust, not ones for making Rust deal with "external world" like other languages bindings, file formats, protocols and so on.

Primary focus should be on crates that are not easy to find by conventional means (e.g. no algorithm name, format or protocol to search for).

Note that quality of the listed crates may vary from proof-of-concept to stable-and-widely-used.

@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 July 10, 2025 21:05
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
{