Skip to content

Instantly share code, notes, and snippets.

@shyim
shyim / pkce.py
Created September 9, 2026 16:45
Shopware OAuth authorization code + S256 PKCE example (Python 3 stdlib only), including bearer verification via /api/_info/me
#!/usr/bin/env python3
"""Browser login example using only Python 3.9+ standard-library modules.
Usage: python3 pkce.py https://shop.example.com
Requires Shopware's authorization-code grant and the default shopware-cli client.
Progress and verified user info go to stderr; tokens go to stdout after verification.
Tokens are credentials.
Use HTTPS outside local development. Nothing is saved to disk by this script.
"""
<?php
namespace Deployer;
require 'recipe/common.php';
set('bin/console', '{{bin/php}} {{release_or_current_path}}/bin/console');
set('default_timeout', 3600); // Increase when tasks take longer than that.
// These files are shared among all releases.
{
"ignition": { "version": "3.0.0" },
"passwd": {
"users": [
{
"name": "shyim",
"sshAuthorizedKeys": [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBuZPgjmIp/dZ0HzRpoFDLsAqFwRGuFBwJiu9qk22tHP"
],
"groups": [
@shyim
shyim / op-wsl-run
Created November 12, 2023 14:35
1Password WSL Wrapper, populate environment variables in Shell and run Linux programs like with op run
#!/usr/bin/env bash
envFile=$1
# drop first argument
shift
IFS=$'\n'
for line in $(op inject -i $envFile)
do

Plugin Create Command

To improve the Developer experience we want to improve the already existing plugin:create command and invest some more love there.

The tasks here are:

  • Make the composer.json configureable using Command flags / ask the user
  • Create a services.yaml instead of services.xml and enable Autowire by default for the Plugin.

Task Create an Symfony Command to create apps

  • Create a Symfony Command app:create
  • The command should create a manifest.xml like described here https://developer.shopware.com/docs/guides/plugins/apps/app-base-guide
    • The user should be asked to define the name etc.
  • Add a optional flag --theme
    • This adds a theme.json to add a theme as app. Look into documentation
  • Add unit tests to test your command
@shyim
shyim / Shopware6TinkerwellDriver.php
Last active August 10, 2022 06:25
Shopware6TinkerwellDriver.php
<?php
use Composer\InstalledVersions;
use Shopware\Core\Framework\DataAbstractionLayer\DefinitionInstanceRegistry;
use Shopware\Core\Framework\Plugin\KernelPluginLoader\DbalKernelPluginLoader;
use Shopware\Core\Kernel as CoreKernel;
use Symfony\Component\Dotenv\Dotenv;
use Tinkerwell\ContextMenu\Label;
use Tinkerwell\ContextMenu\Submenu;
use Tinkerwell\ContextMenu\SetCode;
@shyim
shyim / process.patch
Created July 14, 2022 14:40
Fix unpack symlink issue
--- process.c
+++ process.c
@@ -1751,6 +1751,12 @@ int process_cdir_file_hdr(__G) /* ret
= (G.crec.general_purpose_bit_flag & (1 << 11)) == (1 << 11);
#endif
+#ifdef SYMLINKS
+ /* Initialize the symlink flag, may be set by the platform-specific
+ mapattr function. */
+ G.pInfo->symlink = 0;
@shyim
shyim / build-administration.sh
Created July 14, 2021 18:53
Install node_modules of Shopware extensions automatically
#!/usr/bin/env bash
CWD="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"
set -e
export PROJECT_ROOT="${PROJECT_ROOT:-"$(dirname "$CWD")"}"
ADMIN_ROOT="${ADMIN_ROOT:-"${PROJECT_ROOT}/vendor/shopware/administration"}"
# build admin