Skip to content

Instantly share code, notes, and snippets.

View Sekiphp's full-sized avatar

Luboš Hubáček Sekiphp

View GitHub Profile
@midlan
midlan / download_adminer.sh
Last active July 13, 2020 08:40
Download latest adminer-mysql-en.php
wget -q -O - https://api.github.com/repos/vrana/adminer/releases/latest | jq -r '.assets[] | select((.name | endswith("-mysql-en.php")) and (.name | startswith("adminer"))) | .browser_download_url' | xargs wget -q -O - > adminer.php
@midlan
midlan / bookmarklet_inject_script_to_page.js
Last active February 16, 2024 13:32
Bookmarklet to inject script by url to page, e.g. jquery.
javascript: (function() {
var url = prompt('URL of script to inject:', 'https://code.jquery.com/jquery-3.4.1.min.js');
if (url) {
console.log('Script inject request URL:', url);
var script = document.createElement('script');
script.src = url;

[POLL] Custom attributes in Magento GraphQL Schema

Magento GraphQL endpoints must support EAV entities such as Products. GraphQL specification requires all complex types eventually to be represented as structures of scalar types. Mixed/any types are not supported.

We have couple options to choose from and would be glad to hear your opinion on that.

Option 1: Custom attributes container

Schema

@luisciphere
luisciphere / Bootstrap Table CSS
Last active August 29, 2023 06:06
Bootstrap tables only css
.table {
width: 100%;
max-width: 100%;
margin-bottom: 1rem;
}
.table th,
.table td {
padding: 0.75rem;
vertical-align: top;
@kazuho
kazuho / sockaddr_cmp.c
Last active April 9, 2022 18:05
compare sockaddr
/*
* As of May 25 2021, this code is provided as CC0 / public domain (Kazuho Oku)
*
* Copyright (c) 2014 Kazuho Oku
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
@werdan
werdan / Magento cron lister
Last active July 2, 2021 22:15
This script lists all Magento cronjobs in the following way: # php listAllCrons.php Job name m h dom mon dow Object::Method to execute enterprise_giftcardaccount_generage_codes_pool 30 * * * * enterprise_giftcardaccount/pool::applyCodesGeneration enterprise_logging_rotate_logs 1 2 * * * enterprise_logging/observer::rotateLogs enterprise_page_cac…
<?php
// shell/listAllCron.php
require_once 'abstract.php';
class Mage_Shell_CronLister extends Mage_Shell_Abstract
{
public function run()
{
$cronJobs = Mage::app()->getConfig()->getNode('crontab/jobs');