Skip to content

Instantly share code, notes, and snippets.

View denvit's full-sized avatar
🎯
Focusing

Denis Veg denvit

🎯
Focusing
  • Gornja Radgona, Slovenia
  • 06:59 (UTC +02:00)
View GitHub Profile
@jakwinkler
jakwinkler / ghosts.sh
Created May 13, 2025 05:26
Remove Ghost Indexes From ElasticSuite - Magento Open Source
#!/bin/bash
ES_HOST="http://localhost:9200" # Replace with your ES host
INDEX_PATTERN="magento2_default_catalog_product_*"
# Get all aliases (used indexes) ===
echo "Fetching all aliases in use..."
USED_INDEXES=$(curl -s "$ES_HOST/_cat/aliases?h=index" | sort | uniq)
# Get all indexes matching the pattern ===
@fongreecss
fongreecss / slider.js
Last active February 7, 2020 17:19
Slider
export default class Slider {
constructor(sliderWrapper) {
// wrapper, so it can handle multiple on the same page
this.sliderWrapper = document.querySelector(sliderWrapper);
if (! this.sliderWrapper) return;
// prev next buttons
this.prev = this.sliderWrapper.querySelector('.x-slider__prev');
this.next = this.sliderWrapper.querySelector('.x-slider__next');
@mpociot
mpociot / CanBeReplicated.php
Created June 12, 2019 12:32
Add the ability to replicate Laravel models to other models.
<?php
use Illuminate\Support\Arr;
trait CanBeReplicated
{
public function replicateTo(string $model, array $with = null, array $except = null)
{
$defaults = [
$this->getKeyName(),
@rhukster
rhukster / sphp.sh
Last active March 30, 2024 10:41
Easy Brew PHP version switching (Now moved to https://github.com/rhukster/sphp.sh)
#!/bin/bash
# Creator: Phil Cook
# Modified: Andy Miller
#
# >>> IMPORTANT: Moved to: https://github.com/rhukster/sphp.sh
# >>> Kept here for legacy purposes
#
osx_major_version=$(sw_vers -productVersion | cut -d. -f1)
osx_minor_version=$(sw_vers -productVersion | cut -d. -f2)
osx_patch_version=$(sw_vers -productVersion | cut -d. -f3)
@2E0PGS
2E0PGS / linux-usb-file-copy-fix.md
Last active July 3, 2025 12:52
Fix Ubuntu and other Linux slow/hanging file copying via USB.

If your running a x64 bit Ubuntu or other Linux and find USB transfers hang at the end apply this fix:

echo $((16*1024*1024)) > /proc/sys/vm/dirty_background_bytes
echo $((48*1024*1024)) > /proc/sys/vm/dirty_bytes

I suggest you edit your /etc/rc.local file to make this change persistant across reboots.

sudo nano /etc/rc.local

@dotnetCarpenter
dotnetCarpenter / Kernel.php
Last active April 2, 2020 21:50
`./artisan server` for Lumen 5.3. Kernel.php is in app/Console/ and ServeCommand should be created in app/Console/Commands/
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Laravel\Lumen\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
@dtomasi
dtomasi / default
Last active July 28, 2025 13:14
Brew Nginx PHP7
server {
listen 80;
server_name localhost;
root /Users/YOUR_USERNAME/Sites;
access_log /Library/Logs/default.access.log main;
location / {
include /usr/local/etc/nginx/conf.d/php-fpm;
}
@odan
odan / xampp_php7_xdebug.md
Last active July 27, 2025 19:06
Installing Xdebug for XAMPP
@ygotthilf
ygotthilf / jwtRS256.sh
Last active July 27, 2025 19:45
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@michaeldyrynda
michaeldyrynda / Envoy.blade.php
Last active June 12, 2025 07:14
Laravel 5 Envoy deploy configuration
@servers([ 'remote' => 'server.example.com', ])
@setup
if ( ! isset($repo) )
{
throw new Exception('--repo must be specified');
}
if ( ! isset($base_dir) )
{