Skip to content

Instantly share code, notes, and snippets.

View smichaelsen's full-sized avatar
🥋
Changing the world in code

Sebastian Michaelsen smichaelsen

🥋
Changing the world in code
View GitHub Profile
<?php
declare(strict_types = 1);
namespace Smichalsen\Gist;
use FluidTYPO3\Fluidpages\Provider\PageProvider;
use FluidTYPO3\Fluidpages\Service\ConfigurationService;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Object\ObjectManager;
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
var loadScript = function (url, callback) {
// Adding the script tag to the head as suggested before
var head = document.getElementsByTagName('head')[0];
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = url;
// Then bind the event to the callback function.
// There are several events for cross browser compatibility.
if (callback) {
@smichaelsen
smichaelsen / phpstorm_shortcuts.md
Created March 31, 2017 12:11
PhpStorm Shortcuts

PhpStorm Shortcuts

Find / Open / Navigate

  • ⌘ + O: Open Class (append :42 to jump to a certain line)
  • ⌘ + ⇧ + O: Open File
  • ⌘ + Alt + O: Open Symbol
  • ⇧, ⇧: Search Everywhere
  • ⌘ + E: Recent files
  • ⌘ + ⇧ + E: Recently edited files
@smichaelsen
smichaelsen / _requirements.md
Last active December 13, 2017 12:35
Anforderungen an Projekt- und Buchhaltungssoftware

Muss:

  • Onlinelösung (Zugriff per Browser und/oder App)
  • Zeiterfassung oder Möglichkeit der direkten Anbindung von mite oder toggl
  • Kunden- und Projektverwaltung
  • Angebote und Rechnungen schreiben
  • Eingangsbelege erfassen und in Buchhaltungskonten buchen
  • Kontenabgleich per HBCI
  • Zuordnen von Belegen zu Bankkonto-Transaktionen (doppelte Buchführung)
  • Unterstützt Soll-Besteuerung
@smichaelsen
smichaelsen / howto.md
Last active February 21, 2019 13:23
TYPO3 on php dev server

How-to develop TYPO3 projects locally with the built-in PHP dev server

You can develop TYPO3 projects locally without MAMP, Vagrant or Docker.

This how-to is targeted for TYPO3 developers who want to run and develop their projects on their Mac. This solution might work in a similar way on other operating systems. Feel free to add helpful information in the comments.

Prerequesite: Switchable PHP versions

One time setup

@smichaelsen
smichaelsen / limits.md
Last active April 27, 2018 07:59
Limitations of PHP's built-in web server - UPDATE: Workaround available

Since about a year we're mostly using PHP's built-in web server for TYPO3 projects.

I've posted a how-to run TYPO3 on PHP dev server with switchable PHP versions.

The built-in server "is not intended to be a full-featured web server" however it brings everything you need for running most PHP applications - including TYPO3. Yesterday I learned one of its limitations the hard way.

When trying to index a page onto a Apache Solr search server using the solr TYPO3 extension - the indexing took forever and produced timeout error messages.
After hours(!) of debugging, I found the reason: PHP's built-in web server is single threaded. That means that while it is processing one request it can not start another one.
Why is that a problem? When indexing a page the solr extension fires requests to the frontend to retreive a fully r

#!/bin/bash
# Creator: Phil Cook
# Email: [email protected]
# Twitter: @p_cook
brew_prefix=$(brew --prefix | sed 's#/#\\\/#g')
brew_array=("5.6","7.0","7.1","7.2")
php_array=("[email protected]" "[email protected]" "[email protected]" "[email protected]")
valet_support_php_version_array=("[email protected]" "[email protected]" "[email protected]" "[email protected]")
php_installed_array=()
@smichaelsen
smichaelsen / l10n_ws_fields.md
Created August 9, 2018 14:13
Localization and workspace related TYPO3 database fields

Localization and Workspaces SQL fields Cheat Sheet

Localization

sys_language_uid

Contains a uid pointing to the sys_language table and indicates which language the record is in. 0 means default language. -1 means this record should be used for all languages.

l10n_parent

@smichaelsen
smichaelsen / CategoryUtility.php
Created April 29, 2019 16:06
Files with code examples of ~mixed~ quality
<?php
namespace MyVendor\MyExtension\Utility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
/**
* Class MediaWallUtility
*
* @package MyVendor\MyExtension\Utility
@smichaelsen
smichaelsen / classList.bem.js
Last active April 16, 2022 15:20
Add/Remove BEM Modifier with classList
DOMTokenList.prototype.getFullModifierClassName = function (modifier) {
if (this.length === 0) {
return '';
}
return this.item(0) + '--' + modifier;
};
DOMTokenList.prototype.addModifier = function (modifier) {
this.add(this.getFullModifierClassName(modifier));
};