This file contains 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 | |
# Function to display usage information | |
usage() { | |
echo "Usage: $0 /path/to/input.mp4 [ /path/to/output_directory ]" | |
exit 1 | |
} | |
# Check if at least one argument (input file) is provided | |
if [ $# -lt 1 ]; then |
This file contains 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 | |
# Script to update a firewall rule in a Hetzner Firewall with your current IP address. | |
# Good if you would like to restrict SSH access only for your current IP address (secure). | |
################# | |
# WARNING: This script will overwrite all rules in the firewall rules, so make sure you | |
# added all the required rules. | |
# I use a separate firewall rule just for SSH access. | |
################# |
This file contains 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 declare(strict_types = 1); | |
namespace ShipMonk\Rules\PHPStan\Rule; | |
use PhpParser\Node; | |
use PHPStan\Analyser\Scope; | |
use PHPStan\Node\InClassNode; | |
use PHPStan\Rules\IdentifierRuleError; | |
use PHPStan\Rules\Rule; | |
use function gc_collect_cycles; |
This file contains 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 | |
/* | |
* NOTES: | |
* | |
* - This was designed for my personal use and could be more robust. | |
* - Make sure to update the tables you want to import into. | |
* - Make sure to update the website url you want to import from. | |
* - Customize as needed. I had very few posts and no media. | |
* | |
*/ |
This file contains 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
# SETUP # | |
DOMAIN=example.com | |
PROJECT_REPO="[email protected]:example.com/app.git" | |
AMOUNT_KEEP_RELEASES=5 | |
RELEASE_NAME=$(date +%s--%Y_%m_%d--%H_%M_%S) | |
RELEASES_DIRECTORY=~/$DOMAIN/releases | |
DEPLOYMENT_DIRECTORY=$RELEASES_DIRECTORY/$RELEASE_NAME | |
# stop script on error signal (-e) and undefined variables (-u) |
This file contains 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
# GitHub Action that will run prettier on the whole repo and commit the changes to the PR. | |
name: Prettier | |
on: | |
pull_request: | |
branches: [main] | |
jobs: | |
prettier: | |
runs-on: ubuntu-latest |
This file contains 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 | |
# Check if ffmpeg is installed | |
if ! command -v ffmpeg &> /dev/null; then | |
echo "Error: ffmpeg is not installed or not in the PATH." >&2 | |
echo "Please install ffmpeg to use this script." >&2 | |
exit 1 | |
fi | |
interval=3 |
This file contains 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
/** | |
* Lazy Man's Saloon Fake | |
* | |
* This will record every request that you make in your application and store it in a folder | |
* based on the name of the test. This is incredibly powerful, but I wouldn't recommend it | |
* for every request if you are doing the same things over as it will waste API calls. | |
* | |
* @return void | |
*/ | |
function lazyFakeSaloon(): void |
This file contains 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\Livewire\Attributes; | |
use Attribute; | |
use Livewire\Features\SupportAttributes\Attribute as LivewireAttribute; | |
use function Livewire\store; | |
#[Attribute(Attribute::IS_REPEATABLE | Attribute::TARGET_CLASS | Attribute::TARGET_METHOD)] |
This file contains 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 | |
// Reading | |
CsvReader::read($path)->each(function(array $row) { | |
// Do something with $row | |
}); | |
// Writing | |
return CsvWriter::for($data)->writeToHttpFile(); |
NewerOlder