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

Keybase proof

I hereby claim:

  • I am smichaelsen on github.
  • I am smichaelsen (https://keybase.io/smichaelsen) on keybase.
  • I have a public key whose fingerprint is 6DAE 2A04 601A 1C8B EC7A B5C5 5F5D 89D0 55B4 51E0

To claim this, I am signing this object:

<?php
namespace Smichaelsen\Gist\Mail;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext;
/**
* This class represents an email which can be rendered with fluid.
* You can use all the possibilities of TYPO3's MailMessage but instead of
@smichaelsen
smichaelsen / gitlab_ci
Created September 6, 2014 07:12
Gitlab CI nginx settings
# GITLAB CI
# Maintainer: @randx
# App Version: 2.0
upstream gitlab_ci {
server unix:/home/gitlab_ci/gitlab-ci/tmp/sockets/gitlab-ci.socket;
}
server {
listen gitlab-ci.app-zap.de:443 ssl;
@smichaelsen
smichaelsen / application.yml
Created September 6, 2014 07:20
Gitlab CI application.yml
defaults: &defaults
allowed_gitlab_urls:
# Replace with your gitlab server url
- 'https://gitlab.app-zap.de/'
## Gitlab CI settings
gitlab_ci:
## Web server settings
host: gitlab-ci.app-zap.de
port: 443
@smichaelsen
smichaelsen / update_dns_hosteurope.sh
Created September 22, 2014 21:01
poor man's dyndns for host europe
#!/bin/sh
KUNDENNR=XXXXXX
PASSWORD=XXXXXX
IP=$(wget -qO- ifconfig.me/ip)
UPDATEIP=false
if [ -f /var/run/current.ip ]
@smichaelsen
smichaelsen / quarkstrudel.yaml
Created October 20, 2014 09:33
Quarkstrudel ohne Ei
---
recipe: Quarkstrudel ohne Ei
date: 2014-10-28
author: Sebastian Michaelsen <[email protected]>
defaults:
ingredients:
amount: 1
unit: g
ingredient_groups:
- name: Teig
@smichaelsen
smichaelsen / extbase_properties.md
Last active August 29, 2015 14:08
Extbase: Modifying properties via request

Extbase: Modifying properties via request

An extbase problem and my solution

Problem

A client contacted me and told me that his extbase extension ceases to work when upgrading from TYPO3 4.5 to 6.2. AJAX requests that aimed to modify a certain model ended in exceptions.

The request looked similar to this:

@smichaelsen
smichaelsen / pdo_test.php
Created November 6, 2014 07:48
PDO: prepared statement problem
<?php
$dbhost = '127.0.0.1';
$dbname = 'dname';
$dbuser = 'dbuser';
$dbpass = '123';
$dsn = sprintf('mysql:host=%s;dbname=%s', $dbhost, $dbname);
$connection = new \PDO($dsn, $dbuser, $dbpass);
@smichaelsen
smichaelsen / check_regex.php
Last active January 25, 2025 05:35
PHP: Check if string is valid regular expression
<?php
function isRegularExpression($string) {
set_error_handler(function() {}, E_WARNING);
$isRegularExpression = preg_match($string, "") !== FALSE;
restore_error_handler();
return isRegularExpression;
}
@smichaelsen
smichaelsen / fluid_inline_viewhelper.md
Created November 13, 2014 09:54
TYPO3 Fluid inline viewhelper in array

I regularly fail to remember the correct syntax to do this. So here it is:

<f:form.select
 property="gender"
 id="user_gender"
 options="{1: '{f:translate(key: \'orderform.customer_data.gender.w\')}', 2: '{f:translate(key: \'orderform.customer_data.gender.m\')}'}

"/>