Skip to content

Instantly share code, notes, and snippets.

View sorenmalling's full-sized avatar

Søren Malling sorenmalling

View GitHub Profile
<f:layout name="Default" />
<f:section name="Body">
<f:for each="{posts}" as="post">
<div class="post bg-white rounded-md shadow-sm mb-4 p-4 grid grid-cols-6 gap-4" id="post-{post.data.uid}">
<div>
<div class="flex items-center flex-col border p-4 rounded-lg">
<span class="text-2xl">
<f:format.date date="@{post.data.published_from}" format="d.m.Y" />
</span>
</div>
@sorenmalling
sorenmalling / ModifyDocumentSiteHash.php
Created February 20, 2024 12:24
Setting document sitehash based on the requested site
<?php
namespace Vendor\Solr\EventListener;
use ApacheSolrForTypo3\Solr\Event\Indexing\BeforeDocumentsAreIndexedEvent;
final class ModifyDocumentSiteHash
{
public function __invoke(BeforeDocumentsAreIndexedEvent $event): void
{
@sorenmalling
sorenmalling / Services.yaml
Created October 24, 2023 10:58
TYPO3 TAG ContentObject
services:
_defaults:
autowire: true
autoconfigure: true
public: false
TagContentObject\:
resource: '../Classes/*'
TagContentObject\ContentObject\TagContentObject:
tags:
<?php
$queryResult = new QueryResult();
foreach ($queryResult as $result) {
$data[] = $result;
}
return json_encode($result);
<?php
declare(strict_types=1);
namespace Dafis\Application\Middleware;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
@sorenmalling
sorenmalling / .platform.app.yaml
Created October 28, 2021 07:06
TYPO3 11 Platform.sh configuration
name: app
type: php:7.4
dependencies:
php:
composer/composer: '^2'
runtime:
extensions:
name: app
type: php:7.4
dependencies:
php:
composer/composer: '^2'
runtime:
extensions:
name: app
type: php:7.4
dependencies:
php:
composer/composer: '^2'
runtime:
extensions:
@sorenmalling
sorenmalling / package.json
Created September 24, 2021 08:38
package.json
{
"name": "application",
"version": "1.0.0",
"scripts": {
"build": "webpack --progress --color --mode production",
"start": "webpack-dev-server --mode development",
"watch": "webpack --progress --color --watch --mode development"
},
"keywords": [],
"author": "",
@sorenmalling
sorenmalling / motionsensor.ino
Created April 29, 2021 09:59
Motion Sensor
int nudgingLedPin = 13; // choose the pin for the LED
int pushButtonPin = 9;
int greenLedPin = 11; // choose the pin for the LED
int inputPin = 2; // choose the input pin (for PIR sensor)
int pirState = LOW; // we start, assuming no motion detected
int val = 0; // variable for reading the pin status
int push = 0;
void setup() {
pinMode(nudgingLedPin, OUTPUT); // declare LED as output