Skip to content

Instantly share code, notes, and snippets.

View bmoex's full-sized avatar

Benjamin Serfhos bmoex

View GitHub Profile
@bmoex
bmoex / qualtrics_graphic_uploader.py
Created February 16, 2026 20:27
Upload graphic into Qualtrics with Python
"""
Qualtrics Graphic Uploader
This gist provides classes for uploading graphics to Qualtrics surveys.
It supports uploading from both local files and remote URLs, with built-in
caching to avoid re-uploading the same graphics.
The module implements a singleton pattern for each uploader type to ensure
a single instance per application lifetime.
"""
@bmoex
bmoex / AGENTS.md
Last active February 17, 2026 12:30
DDEV local development guidelines

DDEV local development

  • A project can run inside DDEV Docker containers if ./.ddev/ folder is in project root.
  • You MUST execute all commands through DDEV when available.
  • ALWAYS check if DDEV is available in the current project folder FIRST with ddev --version before attempting any commands.
  • Only use DDEV if the .ddev folder exists in the current project.
  • Prioritize running ddev describe to check service status BEFORE running ddev start.
    • Use ddev describe to validate if services are running
    • Only run ddev start if services are not running or if explicitly needed
  • Stop services using ddev stop.
@bmoex
bmoex / TitleTagViewHelper.php
Last active September 11, 2019 09:01
The PageTitle API of TYPO3 CMS: how to use it in a ViewHelper?
<?php
namespace My\Extension\ViewHelpers;
use Closure;
use My\Extension\PageTitle\ViewHelperPageTitleProvider;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
@bmoex
bmoex / MenuProcessor.php
Created April 11, 2019 09:32
MenuProcessor that handle shortcuts for active/inactive state
<?php
namespace Your\Namespace\DataProcessing;
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
use TYPO3\CMS\Frontend\Page\PageRepository;
/**
* Data Processor: Menu Processor
* Correctly define menu states for all possible types
@bmoex
bmoex / StoreInUrlCacheHook.php
Created April 25, 2018 10:57
Extend RealURL to store cHash when not already calculated
<?php
namespace Serfhos\RealurlCacheHashGeneration\Cache;
use DmitryDulepov\Realurl\Cache\UrlCacheEntry;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Frontend\Page\CacheHashCalculator;
/**
* RealURL Hook: StoreInUrlCache
@bmoex
bmoex / MailFormDataUpdate.php
Last active April 26, 2019 10:48
Migration from "old" mailforms to "new" form extension
<?php
// Location: EXT:yourextension/Classes/Install/Updates/MailFormDataUpdate.php
namespace Serfhos\OldMailMigration\Install\Updates;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\MailUtility;
/**
* Migrate "mailform" data to new 7.6 ext:form