| name | description | license |
|---|---|---|
laravel-comments |
Format Laravel config file comments using the cascading style. Use when writing or fixing comments in config/*.php files. |
MIT |
This file contains hidden or 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
| document.addEventListener('alpine:init', () => { | |
| Alpine.magic('form', el => () => { | |
| return Alpine.reactive({ | |
| processing: false, | |
| recentlySuccessful: false, | |
| errors: {}, | |
| submit() { | |
| return axios.post(el.action, el).then(response => { | |
| this.errors = {}; | |
| this.recentlySuccessful = true; |
| name | description |
|---|---|
Logging Best Practices |
Use before implementing logs in a medium to large scale production system. |
This skill is adpated from "Logging sucks. And here's how to make it better. by Boris Tane.
When helping with logging, observability, or debugging strategies, follow these principles:
This file contains hidden or 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
| // Controller method... | |
| public function download() | |
| { | |
| return response()->streamDownload(function () use ($invoice) { | |
| $token = config('services.cloudflare.api_token'); | |
| $accountId = config('services.cloudflare.account_id'); | |
| $cloudflareApi = 'https://api.cloudflare.com/client/v4'; | |
| echo Http::withToken($token) | |
| ->post($cloudflareApi.'/accounts/'.$accountId.'/browser-rendering/pdf', [ |
This file contains hidden or 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\Listeners; | |
| use Exception; | |
| use Throwable; | |
| use Illuminate\Support\Facades\DB; | |
| use Illuminate\Support\Facades\Cache; | |
| use Illuminate\Support\Facades\Redis; | |
| use Illuminate\Support\Facades\Process; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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) |
NewerOlder