Skip to content

Instantly share code, notes, and snippets.

View kaystrobach's full-sized avatar
🎯
Focusing

Kay Strobach kaystrobach

🎯
Focusing
View GitHub Profile
@kaystrobach
kaystrobach / automation_for_remote.yaml
Created March 2, 2023 16:16
Remote automation for typical dimmer switch with home assistant
alias: "Arbeitszimmer: Rollo"
description: ""
trigger:
- device_id: 98e90028cce28707c8ae4eccd5923d88
domain: zha
platform: device
type: remote_button_short_press
subtype: button_1
id: top
- device_id: 98e90028cce28707c8ae4eccd5923d88

title: Using hugo with gitlab CI including review apps in gitlab pages author: Kay Strobach layout: post date: 2022-07-29T10:56:01+00:00 categories:

  • Nützliches
  • WebDev
  • Gitlab
  • hugo
@kaystrobach
kaystrobach / CreateBarCode.php
Last active May 20, 2022 07:01
Convert UUIDs into BigInt with ramsey/uuid
<?php
// needs picqer/php-barcode-generator
$generator = new \Picqer\Barcode\BarcodeGeneratorPNG();
$barcode = $generator->getBarcode($data, $generator::TYPE_CODE_128, 3, 100, [0,0,0]);
// ensure the char count is even for CODE_128_C
$barcodeData = (strlen($data) % 2) === 0 ? $data : '0' . $data;
$generator = new \Picqer\Barcode\BarcodeGeneratorPNG();
@kaystrobach
kaystrobach / .htaccess
Created June 7, 2019 10:49
.htaccess für allinkl.com
php_flag log_errors on
php_value error_log "/www/htdocs/w018dcee/logs/phplog-typo3.log"
RewriteEngine On
RewriteRule ^typo3$ - [L]
RewriteRule ^typo3/.*$ - [L]
RewriteRule ^fileadmin$ - [L]
RewriteRule ^fileadmin/.*$ - [L]
@kaystrobach
kaystrobach / bash.sh
Last active May 4, 2016 09:03
Gitlab Important Mattermost commands ...
#raise user rights
cd /opt/gitlab/embedded/service/mattermost/i18n
sudo -u mattermost /opt/gitlab/embedded/bin/mattermost -config="/var/opt/gitlab/mattermost/config.json" -assign_role -team_name="..." -email="..." -role="system_admin"
#delete team
cd /opt/gitlab/embedded/service/mattermost/i18n
sudo -u mattermost /opt/gitlab/embedded/bin/mattermost -config="/var/opt/gitlab/mattermost/config.json" -permanent_delete_team=true -team_name="..."
@kaystrobach
kaystrobach / FormErrors.html
Created November 19, 2013 08:47
#TYPO3 #FLOW Translated Form Errors
<f:form.validationResults for="{for}">
<f:if condition="{validationResults.flattenedErrors}">
<div class="alert alert-danger alert-dismissable">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true" title="Schließen">&times;</button>
<p>
Leider waren einige Eingaben im Formular nicht korrekt.
</p>
<f:for each="{validationResults.flattenedErrors}" key="propertyPath" as="errors">
<div class="row">
<div class="col-md-3">
@kaystrobach
kaystrobach / Alternative as AOP Aspect.php
Last active December 28, 2015 12:19
Shows how to integrate Symfony console as proof of concept
<?php
namespace KayStrobach\Project\Aspects;
use TYPO3\Flow\Annotations as Flow;
/**
* Wraps around the \TYPO3\Flow\Cli\Response
*
* @Flow\Aspect
@kaystrobach
kaystrobach / Doctrine Markdown
Last active December 23, 2015 18:29
FLOW Documentation
Doctrine in TYPO3 FLOW ORM/* {#doctrine}
===================================
Einfache Datentypen (Attribute)
-------------------------------
@code
class Blog {
/**
* @var string
public function findAllByCoordinatesDistance($coordinates, $distance) {
$earthRadius=6367.41;
if($distance[strlen($distance)-1] = 'm'){
$earthRadius=$earthRadius/1.609;
$distance = intval($distance);
}
// prepare for injections
$distance = floatval($distance);
@kaystrobach
kaystrobach / GetRecordAsViewHelper.php
Created September 17, 2015 09:47
An ugly viewHelper to get a record from the database ...
<?php
namespace Vendor\Extension\ViewHelpers;
use TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper;
class GetRecordAsViewHelper extends AbstractViewHelper {
/**
* @param string $table