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 | |
/* | |
* 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="git@github.com: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
<?php | |
/** | |
* Below is an the extended Filament resource your tenant panel resources | |
* will have to extend so that the queries are scoped properly. | |
*/ | |
namespace App\Filament; | |
use Filament\Resources\Resource; |
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\Helper; | |
trait WpTrait | |
{ | |
/** | |
* Replaces double line-breaks with paragraph elements. |
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
/** | |
* Validates if a string conforms to a valid Romanian Fiscal Code. | |
* | |
* See Romanian Law no. 359 from 8 September 2004. | |
* @param v {string} input string to be validated | |
* @returns {string|boolean} `true` if the input is a valid CIF or an error message, | |
* describing where validation failed | |
*/ | |
function validateRomanianCIF (v) { | |
if (typeof v !== 'string') { |
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
exiftool -r -d %s -tagsfromfile "%d/%F.json" "-GPSAltitude<GeoDataAltitude" "-GPSLatitude<GeoDataLatitude" "-GPSLatitudeRef<GeoDataLatitude" "-GPSLongitude<GeoDataLongitude" "-GPSLongitudeRef<GeoDataLongitude" "-Keywords<Tags" "-Subject<Tags" "-Caption-Abstract<Description" "-ImageDescription<Description" "-DateTimeOriginal<PhotoTakenTimeTimestamp" "-FileCreateDate<PhotoTakenTimeTimestamp" -ext "*" -overwrite_original -progress --ext json . |
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
user www-data; | |
http { | |
## | |
# Basic Settings | |
## | |
sendfile on; | |
tcp_nopush on; |
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 | |
// needs picqer/php-barcode-generator | |
$generator = new \Picqer\Barcode\BarcodeGeneratorPNG(); | |
$barcode = $generator->getBarcode($data, $generator::TYPE_CODE_128, 3, 100, [0,0,0]); | |
// ensure the char count is even for CODE_128_C | |
$barcodeData = (strlen($data) % 2) === 0 ? $data : '0' . $data; | |
$generator = new \Picqer\Barcode\BarcodeGeneratorPNG(); |
NewerOlder