Skip to content

Instantly share code, notes, and snippets.

View wilsenhc's full-sized avatar
💻
Looking for work

Wilsen Hernández wilsenhc

💻
Looking for work
View GitHub Profile
<?php
namespace Tools\Rector\Rules;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\Relation;
use Illuminate\Database\Query\Builder as QueryBuilder;
use PhpParser\Node;
@evgenyneu
evgenyneu / setup_cursor_ubuntu.md
Last active May 12, 2025 10:54
Install Cursor AI code editor on Ubuntu 24.04 LTS

Install Cursor AI editor on Ubuntu 24.04

  1. Use the Download button on www.cursor.com web site. It will download the NAME.AppImage file.

  2. Copy the .AppImage file to your Applications directory

cd ~/Downloads
mkdir -p ~/Applications
mv NAME.AppImage ~/Applications/cursor.AppImage
@nullthoughts
nullthoughts / MacroServiceProvider.php
Last active February 22, 2025 19:29
Convert Laravel Scout query to Eloquent query (Macro)
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Laravel\Scout\Builder;
class MacroServiceProvider extends ServiceProvider
{
/**
@andrebrait
andrebrait / keychron_linux.md
Last active May 13, 2025 04:22
Keychron keyboards on Linux + Bluetooth fixes

Here is the best setup (I think so :D) for K-series Keychron keyboards on Linux.

Note: many newer Keychron keyboards use QMK as firmware and most tips here do not apply to them. Maybe the ones related to Bluetooth can be useful, but everything related to Apple's keyboard module (hid_apple) on Linux, won't work. As far as I know, all QMK-based boards use the hid_generic module instead. Examples of QMK-based boards are: Q, Q-Pro, V, K-Pro, etc.

Most of these commands have been tested on Ubuntu 20.04 and should also work on most Debian-based distributions. If a command happens not to work for you, take a look in the comment section.

Make Fn + F-keys work (NOT FOR QMK-BASED BOARDS)

Older Keychron keyboards (those not based on QMK) use the hid_apple driver on Linux, even in the Windows/Android mode, both in Bluetooth and Wired modes.

@dimasch
dimasch / redis-clear
Last active April 8, 2025 15:56
Clear a redis cache in Docker
docker exec -it container-name redis-cli FLUSHALL