Skip to content

Instantly share code, notes, and snippets.

View simonschaufi's full-sized avatar
👨‍💻

Simon Schaufelberger simonschaufi

👨‍💻
View GitHub Profile
@spoonerWeb
spoonerWeb / .gitlab-ci.yml
Last active October 1, 2024 08:23
GitLab CI for building and deploying TYPO3 websites with deployer
cache:
paths:
- /cache/composer
stages:
- composer
- deploy
build:
stage: composer
@julrich
julrich / lib.navSidebar.ts
Last active August 4, 2020 12:51
Fully cached TYPO3 HMENU navigation example with expAll and 'active', 'current' states
#
# Main navigation in Sidebar
#
# General idea: Don't render & cache 'active' and 'current' states in 'expAll' menu, so it becomes cacheable
# over all pages. To regain 'active' and 'current' states, the result of the cached menu is parsed by
# 'stdWrap.replacement', utilizing specific information about the resulting menu item markup to insert them.
# Use COA to decouple the stdWrap ('lib.navSidebar.stdWrap.replacement') needed for RegExp replacement from
# the cached menu ('lib.navSidebar.10'). This way the complete menu can be generically cached without current
@t3easy
t3easy / Readme.md
Created May 4, 2018 12:32
Lock composer packages for a specific php version
composer config platform.php 7.0.30 # Fake PHP 7.0.30
composer update --with-all-dependencies symfony/* # Update symfony to the latest 7.0.30 compatible version
composer config --unset platform.php # Remove the faked PHP (or remove the entire config section if its empty)
composer update --lock # Rewrite the composer.lock to remove the platform-override and recalculate the hash
@simonw
simonw / awesomplete-ajax.html
Created April 27, 2018 06:47
Awesomplete ajax example.
<link rel="stylesheet" href="http://leaverou.github.io/awesomplete/awesomplete.css">
<script src="http://leaverou.github.io/awesomplete/awesomplete.js"></script>
<script>
document.addEventListener('DOMContentLoaded', () => {
const input = document.querySelector('input.blah');
const awesomplete = new Awesomplete(input);
input.addEventListener("awesomplete-selectcomplete", (ev) => console.log(ev.text));
input.addEventListener('keyup', (e) => {
var code = (e.keyCode || e.which);
if (code === 37 || code === 38 || code === 39 || code === 40 || code === 27 || code === 13) {
@BryanSchuetz
BryanSchuetz / cachebust.rb
Created February 17, 2018 16:19
CSS Cache Bust Jekyll Plugin
module Jekyll
module CacheBust
class CacheDigester
require 'digest/md5'
attr_accessor :file_name, :directory
def initialize(file_name:, directory: nil)
self.file_name = file_name
self.directory = directory
# This is a sample build configuration for Other.
# Check our guides at https://confluence.atlassian.com/x/5Q4SMw for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image:
name: pxdeployment/pipelines
username: $DOCKERHUB_USER_ALT
password: $DOCKERHUB_PASS_ALT
email: xxx@xxx.de
@eyecatchup
eyecatchup / powermailtracking.js
Last active March 5, 2026 14:04
Universal event tracking solution for TYPO3 Powermail XHR submissions.
// Universal event tracking for TYPO3 Powermail XHR submissions.
//
// Note: As of version 4.2.0, Powermail sends a custom event on submit;
// see https://github.com/einpraegsam/powermail/blob/develop/Documentation/Faq/Index.rst#how-can-i-add-a-callback-function-on-ajax-submit
document.addEventListener("DOMContentLoaded", function(event) {
// Step 1
// Attach an onsubmit handler to all powermail ajax forms, which will
// make the powermail form id available in the window object on submit.
var forms = document.querySelectorAll('form');
for (var i in forms) {
@ohartwig
ohartwig / cli_dispatch.phpsh
Created November 10, 2017 07:11
Use of cli_dispatch.phpsh with helhum/typo3-secure-web
#!/usr/bin/env php
<?php
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
@fabulator
fabulator / moment-locale-resolver.js
Last active December 21, 2021 08:52
Resolve best locale for moment
import moment from 'moment';
import {
LocaleResolver,
NavigatorDetector,
FallbacksTransformer,
DefaultLocaleTransformer,
} from 'locales-detector';
// moment locales are in lowercase, need it change en-GB to en-gb
class LowerCaseTransformer {
@koehnlein
koehnlein / .gitlab-ci.yml
Last active December 1, 2021 15:21
simple deployment based on TYPO3 Surf and Gitlab CI
stages:
- deploy
# use caching
cache:
key: "$CI_BUILD_REF_NAME/$CI_BUILD_STAGE"
paths:
- .caches/
variables: