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
| /** | |
| * Searching Eloquent models with Relations | |
| * | |
| * Example Post::whereLike(['name', 'text', 'author.name', 'tags.name'], $searchTerm)->get(); | |
| */ | |
| Builder::macro('whereLike', function ($attributes, string $searchTerm) { | |
| $this->where(function (Builder $query) use ($attributes, $searchTerm) { | |
| foreach (\Arr::wrap($attributes) as $attribute) { | |
| $query->when( | |
| str_contains($attribute, '.'), |
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
| 1. Download the `.AppImage` file and an icon you would like to register it with | |
| 2. Move the `.AppImage` file to the path `/bin`, e.g. `sudo mv ~/Downloads/Vemto.AppImage /bin/` | |
| 3. Make it executable with `sudo chmod +x /bin/Vemto.AppImage` | |
| 4. Save the icon under `/usr/share/icons/custom/vemto.png` e.g. `sudo mkdir --parents /usr/share/icons/custom && sudo mv ~/Downloads/vemto.png /usr/share/icons/custom/` | |
| 5. Create a `.desktop` file under `~/.local/share/applications/vemto.desktop` | |
| 6. Paste the following content into it (make sure to remove the comments): | |
| ``` | |
| [Desktop Entry] | |
| Name=Vemto |
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.setReactivityEngine({ | |
| reactive: Vue.reactive, | |
| effect: Vue.effect, | |
| release: Vue.stop, | |
| raw: Vue.toRaw | |
| }) | |
| }) |
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('livewire:init'), () => { | |
| Livewire.hook('component.init', ({ component }) => { | |
| const errors = {} | |
| component.ephemeral.$errors = Object.assign({}, errors) | |
| component.reactive.$errors = Object.assign({}, errors) | |
| }) | |
| Livewire.hook('commit.prepare', ({ component }) => { | |
| delete component.ephemeral.$errors | |
| delete component.reactive.$errors |
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 | |
| # Install necessary packages | |
| sudo apt update | |
| sudo apt install -y cpufrequtils tlp | |
| # Set CPU governor to powersave | |
| echo "Setting CPU governor to powersave..." | |
| for cpu in /sys/devices/system/cpu/cpu[0-9]*; do | |
| echo powersave | sudo tee $cpu/cpufreq/scaling_governor > /dev/null |
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 | |
| public function boot(): void | |
| { | |
| URL::forceHttps(); | |
| URL::useOrigin('https://' . request()->header('X-Forwarded-Host')); | |
| } |
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
| # Gradia - Make your screenshots ready for the world. | |
| flatpak install flathub be.alexandervanhee.gradia |
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/sh | |
| # | |
| # git-find-parent.sh | |
| # Find the most likely parent branch for a given feature branch. | |
| # | |
| branch="$1" | |
| # If no branch passed, use current branch | |
| if [ -z "$branch" ]; 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 | |
| # This script sets up the RedPlanetHQ/core memory agents for Claude. | |
| # It creates the necessary agent files and provides instructions for final configuration. | |
| echo "π Setting up CORE memory agents for Claude..." | |
| # Define the agent directory and create it if it doesn't exist | |
| AGENT_DIR=".claude/agents" | |
| mkdir -p "$AGENT_DIR" |
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
| # Tailwind CSS v4 | |
| > Tailwind CSS v4 is a utility-first CSS framework that scans source files for complete class name strings and generates only the CSS that is actually used, with zero runtime overhead. Version 4 is a full rewrite: JavaScript config files are replaced by CSS-native `@theme` blocks, all colors move to the OKLCH color space, Lightning CSS handles transforms and browser prefixes automatically, and the entry point changes from three `@tailwind` directives to a single `@import "tailwindcss"`. The recommended integration is a dedicated Vite plugin (`@tailwindcss/vite`). Minimum browser support: Chrome 111, Safari 16.4, Firefox 128. An automated upgrade tool (`npx @tailwindcss/upgrade`) handles roughly 90% of the v3-to-v4 migration. | |
| **Breaking changes LLMs frequently get wrong when generating v4 code:** | |
| - Shadow, blur, rounded, and ring size names shifted one step down β `shadow` β `shadow-sm`, `shadow-sm` β `shadow-xs`, `rounded` β `rounded-sm`, `blur` β `blur-sm`, etc. | |
| - The `!important` modifi |
OlderNewer