Skip to content

Instantly share code, notes, and snippets.

View platonische's full-sized avatar
🎯
Focusing

platonische platonische

🎯
Focusing
View GitHub Profile
@platonische
platonische / snake-to-camel.php
Created March 15, 2024 04:44 — forked from carousel/snake-to-camel.php
Convert snake to camel case and back with PHP
<?php
function camel_to_snake($input)
{
return strtolower(preg_replace('/(?<!^)[A-Z]/', '_$0', $input));
}
function snakeToCamel($input)
{
return lcfirst(str_replace(' ', '', ucwords(str_replace('_', ' ', $input))));
}
DELETE FROM eav_attribute_option_value
WHERE value_id IN (
SELECT tmp.value_id from (
SELECT value_id
FROM eav_attribute_option_value
GROUP BY option_id, store_id
HAVING COUNT(*) > 1
) as tmp
);
@platonische
platonische / img_alts.js
Created August 28, 2023 08:22
Browsers js / Show SEO matter goods
javascript:void((
function() {
const images = document.querySelectorAll('img');
const missingAlt = [...images].filter(img => !img.hasAttribute('alt') || img.alt === '');
missingAlt.forEach(img => {
img.style.border = '2px solid red';
console.log(img); });
alert("Found wrong alts: "+missingAlt.length);
}
)())
@platonische
platonische / env.php
Last active December 28, 2024 10:13
Override work throught RabbitMQ queues app/etc/env.php
'queue' => [
'amqp' => [
'host' => 'rabbitmq',
'port' => '5672',
'user' => 'magento',
'password' => 'magento',
'virtualhost' => '/',
'ssl' => ''
],