Skip to content

Instantly share code, notes, and snippets.

View Caffe1neAdd1ct's full-sized avatar
💻
Working on multiple projects

Kevin Andrews Caffe1neAdd1ct

💻
Working on multiple projects
View GitHub Profile
@normykinz
normykinz / laravel_make_typed_collection_command
Last active March 7, 2023 14:52
Lavel Typed Collection Make Command
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Filesystem\Filesystem;
class CollectionCommand extends Command
{
protected $signature = 'make:collection {model}';
@normykinz
normykinz / laravel_model_getters and setters
Created March 7, 2023 13:33
VsCode Laravel Model Setters and Setters
{
"Lavavel Model Getter and Setter": {
"prefix": "lgs",
"body": [
"public function get$1(): $2 {",
"\treturn $$this->attributes['$3'];",
"}\n",
"public function set$1($2 $$value): void {",
"\t$$this->attributes['$3'] = $$value;",
"}"
@nidgetgod
nidgetgod / icu-install.sh
Last active May 2, 2024 02:20 — forked from siffash/icu-install.sh
Install ICU from source and build php-intl with the specific version of ICU
#!/usr/bin/env bash
if [[ -x $(which php) ]]; then
PHP_ICU_VERSION=$(php -r 'echo defined("INTL_ICU_VERSION") ? INTL_ICU_VERSION : "none";')
echo "PHP ICU version: $PHP_ICU_VERSION"
else
echo 'WARNING: PHP not installed'
PHP_ICU_VERSION=none
fi
@antfroger
antfroger / README.md
Last active March 2, 2024 15:47
Using xdebug with Windows 10, WSL2, Docker and VS Code

Configuring xdebug to work with Windows 10 (WSL2), Docker and VS Code

Configuring your dev environment to be able to use xdebug when you're working on Windows 10 (with WSL2) and Docker with VS Code can be (a bit) tricky.
This is a quick reminder of how I've done that.

Configuring the environment

  1. Install and configure xdebug in Docker

Install xdebug according to the Docker image you're using

@warlord0
warlord0 / template.sh
Last active October 21, 2021 09:01
Bash Script Template
#!/bin/bash
EXAMPLE="example default"
# Plugin variable description
PROGNAME=$(basename $0)
RELEASE="Revision 1.0.0"
AUTHOR="(c) 2020 Warlord0"
# Functions plugin usage
@chrispian
chrispian / woocommerce-filter-related-categories-by-taxonmy-term.php
Last active February 26, 2022 16:01
Only shows related products from the primary category set by Yoast
@endurtech
endurtech / wordpress-permissions-fixer.php
Last active September 12, 2023 23:22
Simple php script sets correct directory and file permissions on WordPress and others. Directories are 755, files are 644, .htaccess and wp-config.php is 444.
<?php
/*
** Plugin Name: WordPress Permissions Fixer
** Plugin URI: https://endurtech.com/how-to-fix-wordpress-file-and-folder-permissions/
** Description: Simple php script sets correct directory and file permissions on WordPress and others. Directories are 755, files are 644, wp-config.php is 444.
** Author: Manuel Rodrigues
** Author URI: https://endurtech.com
** Version: 1.1
** Tags: wordpress, php, script, directory, directories, file, files, wp-config.php, chmod, fix
** License: GPL-2.0+
@Pandry
Pandry / Firewalld GeoIP firewall script
Last active May 2, 2024 20:18
Block countries IPs via Firewalld
#!/bin/bash
##
# Name: GeoIP Firewall script
# Author: Pandry
# Version: 0.1.1
# Description: This is a simple script that will set up a GeoIP firewall blocking all the zones excecpt the specified ones
# it is possible to add the whitelisted zones @ line 47
# Additional notes: Usage of [iprange](https://github.com/firehol/iprange) is suggested
# for best performances
@anisur3036
anisur3036 / .bablerc
Last active December 20, 2020 11:15
Tailwindcss with Gulp
{
"presets": ["env"]
}
@rragundez
rragundez / args_script_template.sh
Created June 21, 2017 09:11
Template of bash script with mandatory and optional arguments
#!/bin/bash
set -e
usage="$(basename "$0") [-h] [-i PROJECT] [-v VM] [-p PYTHON] [-d NOTEBOOKS]
Make a user provide SSH key and jupyter notebooks (in roles/bootstrap/files/notebooks) to each user listed in var/common.yml
where:
-h show this help text
-i google cloud project id
-v name of instance/virtual machine
-p python path