Skip to content

Instantly share code, notes, and snippets.

Avatar

Jamie York ziadoz

View GitHub Profile
@ziadoz
ziadoz / human-list.html
Created Apr 7, 2022
CSS Only Human Readable List
View human-list.html
<style>
ul.human-list {
list-style: none;
}
ul.human-list li {
display: inline-block;
}
ul.human-list li:not(:last-child):after {
@ziadoz
ziadoz / prs.sh
Last active Mar 30, 2022
GitHub - Get All Your PRs As JSON
View prs.sh
#!/usr/bin/env bash
# Install GH CLI client
brew install gh
# Configure organisation and username variables
ORG="orgname"
USER="username"
# Retrieve pull request JSON
@ziadoz
ziadoz / NoLockScreen.reg
Created Jan 30, 2022
Disable Windows 10 Lock Screen
View NoLockScreen.reg
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization]
"NoLockScreen"=dword:00000001
@ziadoz
ziadoz / mp3-2-m4a.sh
Created Jan 25, 2022
FFMPEG: MP3 to M4A
View mp3-2-m4a.sh
#!/usr/bin/env bash
for file in *.mp3; do ffmpeg -i $file -c:a aac -vn ${file%.mp3}.m4a; done
@ziadoz
ziadoz / git-rename-ext.sh
Created Dec 22, 2021
Git Rename File Extensions
View git-rename-ext.sh
#!/usr/bin/env bash
for file in `find templates -name "*.oldext" -type f -print`; do
git mv "$file" ${file%.oldext}.newext;
done
@ziadoz
ziadoz / fix-nvme-missing-win-10.txt
Created Nov 23, 2021
Fix NVME M.2 Drive Not Showing In Windows 10 (B550, AMD, ASUS)
View fix-nvme-missing-win-10.txt
The Issue
=========
I had an issue on my B550 AMD motherboard where my NVME M.2 (GEN3) drive would show up in the BIOS, but was missing in Windows 10 intermittently. For example, when I first boot the computer up, the drive isn't in Windows, but if I restart Windows the drive appears.
I tried the solutions here, but none of them worked:
- https://www.techpowerup.com/forums/threads/nvme-ssd-not-showing-up-in-windows-on-amd-system.264448/
- https://linustechtips.com/topic/1063692-m2-ssd-showing-up-in-bios-but-not-in-windows-10/
- https://forums.tomshardware.com/threads/m-2-ssd-recognized-but-not-showing-up.2604341/
@ziadoz
ziadoz / google-search-spam-domains.txt
Last active Nov 17, 2021
Google Search Spam Domains
View google-search-spam-domains.txt
Stack Overflow:
- https://newbedev.com/
- https://www.titanwolf.org/
- https://easysavecode.com/
- https://www.codegrepper.com/
- https://www.py4u.net/
- https://lefred.be/
- https://bountify.co/
- https://coderedirect.com/
- https://pretagteam.com/
@ziadoz
ziadoz / LogConsole.php
Created Nov 5, 2021
Automatically Log Laravel Artisan Console Output
View LogConsole.php
<?php
// @see: https://stackoverflow.com/questions/48167834/how-to-remove-all-formatting-from-the-output-of-a-console-command-written-in-php
use Illuminate\Console\Events\CommandFinished;
use Illuminate\Support\Facades\{Event, Log};
use Symfony\Component\Console\Helper\Helper;
Event::listen(function (CommandFinished $event) {
Log::info(
Helper::removeDecoration(
@ziadoz
ziadoz / MemberOfMacro.php
Created Nov 5, 2021
MySQL 8.0 JSON MEMBER OF Laravel Eloquent Macro
View MemberOfMacro.php
<?php
use Illuminate\Database\Query\Builder;
$memberOf = function ($value, string $column, string $path = '$', $boolean = 'and') {
return $this->whereRaw(
sprintf(
'? MEMBER OF(JSON_EXTRACT(%s, "%s"))',
$this->getGrammar()->wrap($column),
$path
),
@ziadoz
ziadoz / fixchars.sh
Last active Oct 29, 2021
Remove Special Characters From macOS Filenames
View fixchars.sh
#!/usr/bin/env bash
# @see: https://superuser.com/questions/617517/remove-all-illegal-characters-from-all-filenames-in-a-given-folder
# The 's/[\:?\\]//g' regular expression removes ?, : and \ characters.
# Dry Run:
find "/path/to/files" -type f -exec rename -n 's/[\:?\\]//g' {} \;
# Execute:
find "/path/to/files" -type f -exec rename 's/[\:?\\]//g' {} \;