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:

@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 <sebastian@michaelsen.io>
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 / 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\')}'}

"/>

@smichaelsen
smichaelsen / typo3_unit.md
Created November 26, 2014 11:24
Run TYPO3 Core Unit tests
  1. Run the tests from within the VM (if you have one).
  2. cd to the web root
  3. composer install
  4. ./vendor/phpunit/phpunit/phpunit -c typo3/sysext/core/Build/UnitTests.xml
@smichaelsen
smichaelsen / gist:cc53bf4e4a07919101cb
Created December 11, 2014 14:04
git branch slashes
✗ git checkout -b feature/admin-interface/materialize feature/admin-interface
error: unable to resolve reference refs/heads/feature/admin-interface/materialize: Not a directory
fatal: Failed to lock ref for update: Not a directory
<?php
namespace Smichaelsen\MyExtension\ViewHelpers\Format;
use TYPO3\CMS\Core\Utility\ArrayUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
/**
* Usage example
*