Skip to content

Instantly share code, notes, and snippets.

@ajdinmore
ajdinmore / index.html
Created August 21, 2024 13:58
HTML emoji icon
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22>
<text y=%221.2em%22 font-size=%2296%22>🚧</text></svg>">
@ajdinmore
ajdinmore / full-cache-clear.sh
Last active February 28, 2024 18:21
Clear all Symfony cache pools
#!/bin/bash
bin/console cache:pool:list | head -n -2 | tail -n +4 | xargs bin/console cache:pool:clear
@ajdinmore
ajdinmore / docker-compose.yaml
Created September 19, 2023 15:39
Docker Compose/Stack Placeholder Template Examples
#file: noinspection SpellCheckingInspection
# https://docs.docker.com/engine/reference/commandline/service_create/#create-services-using-templates
# https://docs.docker.com/config/containers/logging/awslogs/#tag
# https://docs.docker.com/config/containers/logging/log_tags/
# https://forums.docker.com/t/example-usage-of-docker-swarm-template-placeholders/73859
services:
service:
image: busybox
command: env
hostname: '{{.Task.Name}}-{{.Node.Hostname}}'
export GPG_TTY=$(tty)
export DOCKER_BUILDKIT=1
@ajdinmore
ajdinmore / apps-install.sh
Last active August 30, 2023 14:29
Laptop apps install script (work in progress)
#!/bin/bash
if [ "$(id -u)" -ne 0 ]; then
sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker
xdg-open ~/Downloads &> /dev/null &
xdg-open 'https://www.gitkraken.com/download/linux-deb' &> /dev/null &
xdg-open 'https://www.jetbrains.com/toolbox-app/download/download-thanks.html?platform=linux' &> /dev/null &
xdg-open 'https://slack.com/intl/en-gb/downloads/linux' &> /dev/null &
<?php
declare(strict_types=1);
/**
* Plugin Name: WooCommerce Import Fix 2022-10-05
* Description: Fixes importing variable product drafts.
*/
add_filter('woocommerce_product_importer_formatting_callbacks', function (array $callbacks, \WC_Product_Importer $importer) {
$key = array_search('published', $importer->get_mapped_keys());
if (false !== $key && isset($callbacks[$key])){
@ajdinmore
ajdinmore / docker-compose.yaml
Last active August 24, 2022 17:02
Quick-start PHP project Docker setup
version: '3.8'
services:
php:
image: ajdinmore/php:8.1-dev
hostname: php
tty: true
volumes:
- ./:/app
- ${COMPOSER_HOME:-~/.composer}:/composer
environment:
@ajdinmore
ajdinmore / DevController.php
Last active September 15, 2022 19:25
Symfony Dev Controller Template
<?php /** @noinspection PhpMultipleClassesDeclarationsInOneFile */
declare(strict_types=1);
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
cd "$(dirname "$(readlink -f "$0")")" || (echo "Failed to change directory." && exit 1)
@ajdinmore
ajdinmore / .bash_aliases
Last active October 1, 2024 12:10
Bash Aliases
#/bin/bash
function kt {
(&>/dev/null kate "$@" & exit)
}
function dolp {
(&>/dev/null dolphin "${@:-.}" & exit)
}