Skip to content

Instantly share code, notes, and snippets.

View HinchK's full-sized avatar

.: HinchK :. HinchK

View GitHub Profile
@HinchK
HinchK / wp-hooks-filter.php
Created February 2, 2025 12:04 — forked from bueltge/wp-hooks-filter.php
Instruments Hooks for a Page of WordPress. Outputs during the Shutdown Hook after add get-params: ?instrument=hooks
<?php
/*
Plugin Name: Instrument Hooks for WordPress
Plugin URI: http://bueltge.de/
Description: Instruments Hooks for a Page. Outputs during the Shutdown Hook after add get-params <code>?instrument=hooks</code>.
Version: 0.0.1
Author: Frank B&uuml;ltge
Author URI: http://bueltge.de/
*/
@HinchK
HinchK / script-template.sh
Created October 7, 2023 20:25 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@HinchK
HinchK / upload-github-release-asset.sh
Created June 13, 2023 06:42 — forked from stefanbuck/upload-github-release-asset.sh
Script to upload a release asset using the GitHub API v3.
#!/usr/bin/env bash
#
# Author: Stefan Buck
# License: MIT
# https://gist.github.com/stefanbuck/ce788fee19ab6eb0b4447a85fc99f447
#
#
# This script accepts the following parameters:
#
# * owner
@HinchK
HinchK / auth-hook.sh
Last active January 21, 2022 15:18 — forked from li0nel/ssl_certificates.sh
Let's Encrypt certificates
aws route53 wait resource-record-sets-changed --id \
$(aws route53 change-resource-record-sets --hosted-zone-id \
"$(aws route53 list-hosted-zones-by-name --dns-name $2. \
--query HostedZones[0].Id --output text)" \
--query ChangeInfo.Id \
--output text \
--change-batch "{ \
\"Changes\": [{ \
\"Action\": \"$1\", \
\"ResourceRecordSet\": { \
@HinchK
HinchK / laravel-best-practices.md
Last active December 4, 2022 23:09
laravel-best-practices.md

0-to-Cheatsheet: Laravel Best Practices

Author: alexeymezenin

Github:laravel-best-practices

It's not a Laravel adaptation of SOLID principles, patterns etc. Here you'll find the best practices which are usually ignored in real life Laravel projects.

Contents

@HinchK
HinchK / .php_cs.laravel.php
Created November 19, 2019 03:26 — forked from laravel-shift/.php-cs-fixer.php
PHP CS Fixer - Laravel Coding Style Ruleset
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
'operators' => ['=>' => null]

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@HinchK
HinchK / gist:443f426bbe7e916c762b28931315c449
Created March 23, 2019 18:42 — forked from rikh42/gist:efad95142b1be3429a94
Laravel Homestead XDebug Nginx and Composer config changes

Laravel Homestead XDebug Nginx and Composer config changes

/etc/nginx/fastcgi_params

Update nginx config to support a longer timeout to prevent it dropping the connection when trying to debug in PHP Storm

fastcgi_read_timeout 600; # Set fairly high for debugging
@HinchK
HinchK / DeleteFromList.php
Created March 15, 2019 13:07
Snipe-IT API Sample "Delete Users from a list of their ids"
<?php
/*
* Deleting users, from a file that is just a one-column, \n separated. list of ids
Useing the
_ _ _
(_) (_) |
___ _ __ _ _ __ ___ ___ _| |_
/ __| '_ \| | '_ \ / _ \___| | __|
\__ \ | | | | |_) | __/ | | |_
|___/_| |_|_| .__/ \___| |_|\__| API
@HinchK
HinchK / hinchk_local_docker.env
Created October 19, 2018 23:29
a single environment file example for snipe/snipe-it & docker-compose
# Mysql Parameters
MYSQL_ROOT_PASSWORD=secret
MYSQL_DATABASE=snipedocker
MYSQL_USER=root
MYSQL_PASSWORD=secret
# Email Parameters
# - the hostname/IP address of your mailserver
MAIL_PORT_587_TCP_ADDR=smtp.example.com
#the port for the mailserver (probably 587, could be another)