Skip to content

Instantly share code, notes, and snippets.

View sorenmalling's full-sized avatar

Søren Malling sorenmalling

View GitHub Profile
@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
@sorenmalling
sorenmalling / Production.php
Created March 25, 2021 12:37
Example of Surf deployment configuration
<?php
$node = new TYPO3\Surf\Domain\Model\Node('production');
$node
->setHostname('SERVER_IP')
->setOption('username', 'SSH_USERNAME');
$application = new TYPO3\Surf\Application\Neos\Flow('SikkerFaktura Distribution');
$application->setVersion('7.0');
$application
->setOption('keepReleases', 3)
@sorenmalling
sorenmalling / ContentCollection.fusion
Last active April 23, 2020 10:49
ContentCollection without wrapping div in frontend
prototype(Neos.Neos:ContentCollection) < prototype(Neos.Neos:ContentCollectionRenderer) {
@process.wrap = Neos.Fusion:Tag {
tagName = 'div'
attributes = Neos.Fusion:DataStructure
# The following is used to automatically append class attribute with "neos-contentcollection" needed for editing.
# You can disable the following line with:
# prototype(Neos.Neos:ContentCollection) {
# attributes.class.@process.collectionClass >
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" xmlns:bk2k="http://typo3.org/ns/BK2K/BootstrapPackage/ViewHelpers" data-namespace-typo3-fluid="true">
<header id="page-header" class="bp-page-header navbar navbar-mainnavigation navbar-{theme.navigation.style}{f:if(condition:settings.logo.file,then:' navbar-has-image')}{f:if(condition:theme.navigation.type, else:' navbar-top', then:' navbar-{theme.navigation.type} navbar-fixed-{theme.navigation.type}')}">
<div class="container">
<f:if condition="{settings.logo.file}">
<f:then>
<f:link.page pageUid="{rootPage}" class="navbar-brand navbar-brand-image" title="{settings.logo.linktitle}">
<img class="navbar-brand-logo-normal" src="{f:uri.image(src: settings.logo.file)}" alt="{logoAlt}" height="{settings.logo.height}" width="{settings.logo.width}">
<img class="navbar-brand-logo-inverted" src="{f:uri.image(src: settings.logo.fileInverted)}" alt="{logoAlt}" height="{settings
<?php
public function findByPlaceAndRadius(Place $place, $radius, $limit = 15) {
$latitude = $place->getLatitude();
$longitude = $place->getLongitude();
$angleRadius = $radius / 111;
$min_lat = $latitude - $angleRadius;
$max_lat = $latitude + $angleRadius;
$min_lon = $longitude - $angleRadius;
$max_lon = $longitude + $angleRadius;
@sorenmalling
sorenmalling / rule.yaml
Last active May 3, 2017 09:17
First draft of rule configuration
{
"event": {
"type": "UserHasSignedUp"
},
"conditions": [{
"type": "DateRange",
"parameters": {
"startDateAndTime": "01/12/2017",
"endDateAndTime": "21/12/2017"
}