Skip to content

Instantly share code, notes, and snippets.

View ziadoz's full-sized avatar

Jamie York ziadoz

View GitHub Profile
ziadoz / macos-ms-teams-audio-driver-issues.txt
Last active November 13, 2023 09:31
macOS Microsoft Teams Audio Driver Issues
View macos-ms-teams-audio-driver-issues.txt
In the middle of a Zoom call my audio in/out devices changed to “Microsoft Teams Audio Devices”, despite no longer having Microsoft Teams installed.
It turns out Teams leaves its audio driver on your system running, and it occasionally decides to make itself the default.
I had to delete: /Library/Audio/Plug-Ins/HAL/MSTeamsAudioDevice.driver in the end to fix it:
sudo rm -rf /Library/Audio/Plug-Ins/HAL/MSTeamsAudioDevice.driver
ziadoz / old-reddit-regex.txt
Last active November 1, 2023 09:56
StopTheMadness Old Reddit Redirect Regular Expression
View old-reddit-regex.txt
Redirect from New Reddit to Old Reddit, but ignoring media links, which break and point to a Lady Gaga nice hat page.
ziadoz /
Created September 26, 2023 11:28
Debugging Dusk/Codeception and ChromeDriver

Start ChromeDriver with logging enabled:

/usr/bin/chromedriver --url-base=/wd/hub --allowed-ips="" --port=9515 --log-level=INFO --log-path=/tmp/chromedriver.log

Run Dusk/Codeception:

php artisan dusk
ziadoz /
Created September 21, 2023 09:40
Test PHP Projects Using Docker
docker run --rm --interactive --tty --volume $PWD:/app composer install
docker run -it --rm --name laravel-dusk -v "$PWD":/usr/src/myapp -w /usr/src/myapp php:8.2-cli php vendor/bin/phpunit
ziadoz / DuskServiceProvider.php
Created September 19, 2023 14:41
Laravel Dusk - Asset Elements Count, Greater Than, Less Than
View DuskServiceProvider.php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Laravel\Dusk\Browser;
use PHPUnit\Framework\Assert as PHPUnit;
use PHPUnit\Framework\Constraint\Count;
class DuskServiceProvider extends ServiceProvider
ziadoz / readme.txt
Created August 27, 2023 12:58
Call Of Duty - Broken Communication Opt Out Form
View readme.txt
Visit communication opt Out website:
Check all unsubcribe checkboxes and click "Submit" button.
A 500 error appears in the JavaScript console to the URL:
{"requestURL":"","errorMessage":"org.springframework.web.client.HttpClientErrorException$BadRequest: 400 Bad Request: [{\"error\": {\"name\": \"Error:ClientError:InvalidRequest:QueryStringInvalid\", \"msg\": \"Request parameters validation failed, see context for more details.\", \"context\": [{\"name\": \"Error:ClientError:InvalidRequest:ParameterInvalid\", \"msg\": \"Either the 'emails', 'phones', 'unoIDs', 'userNames', 'firstNames', 'lastNames' or 'fullNames' parameter must be provided\", \"code\": 212000}], \"code\": 211000}}]","exceptionClass":"UnoRuntimeException","stackTrace":" org.springframework.web.client.HttpClientErrorException$BadRe
ziadoz / menu-icons.txt
Created July 25, 2023 15:53
Menu Icons
View menu-icons.txt
Hamburger Menu (☰)
Meatball Menu (⋯)
ziadoz / readme.txt
Last active July 25, 2023 15:54
Register UT99 UMod Extension
View readme.txt
Replace path to UT99 with your install path, then run the .reg file.
ziadoz / raw_sql.php
Last active September 21, 2023 09:41
Laravel - QueryExecuted To Raw SQL
View raw_sql.php
// Before Laravel 10.15.0
function prepareQuery(QueryExecuted $query): string
return count($query->bindings) > 0
? vsprintf(str_replace(['%', '?'], ['%%', '%s'], $query->sql), array_map(fn ($value) => (is_numeric($value) ? $value : "'" . $value . "'"), $query->bindings))
: $query->sql;
ziadoz / MyCommand.php
Created July 5, 2023 13:58
Laravel - Keep Database Connection Alive in Artisan Commands
View MyCommand.php
namespace App\Console\Commands;
class MyCommand extends Command
protected $signature = 'app:my-command';
public function handle(): int