Skip to content

Instantly share code, notes, and snippets.

View albe's full-sized avatar
:octocat:

Alexander Berl albe

:octocat:
View GitHub Profile
17:31:00: compiletime: Check if site locked.
17:31:00: compiletime: Site not locked.
17:31:00: compiletime: Try to lock site.
17:31:00: locked site.
17:31:00: compiletime: Locked site.
17:31:09: compile command started.
17:31:12: compile command finished.
17:31:19: released flock.
17:31:19: unlocked site.
/* @var $collectionElement CollectionElementType */
foreach ($this->getCollectionPropert() as $collectionElement) {
... // Have proper $collectionElement type hinting in IDE
}
@albe
albe / LocalizationService.php
Last active July 25, 2017 14:06
A LocalizationService Utility class for Neos Flow 4.x that fetches localization data from the CLDR
<?php
namespace Acme\Foo\Service;
use Neos\Flow\Annotations as Flow;
use Neos\Flow\I18n\Cldr\CldrModel;
/**
* A service for localization purposes
*
* @Flow\Scope("singleton")
/**
* @test
*/
public function resourceCanBeUpdatedViaRestCall()
{
$arguments = array(
'resource' => array(
'title' => 'Foo'
)
@albe
albe / DetectLanguageComponent.php
Created March 1, 2017 10:18
A Flow HTTP component for multilanguage
<?php
namespace Acme\Foo\Http;
use TYPO3\Flow\Annotations as Flow;
use TYPO3\Flow\Http\Component\ComponentContext;
use TYPO3\Flow\Http\Component\ComponentInterface;
use TYPO3\Flow\I18n\Detector;
use TYPO3\Flow\I18n\Locale;
/**
@albe
albe / AbstractRestController.php
Created May 30, 2017 08:28
Automagic RESTful API for https://github.com/neos/flow Framework Aggregates (incomplete)
<?php
namespace Acme\Api\Controller;
use Acme\Api\Domain\Repository\ResourceRepository;
use Acme\Api\Utility\AggregateReflectionHelper;
use Acme\Api\Utility\ResourceTypeHelper;
use Acme\Api\Utility\ViewConfigurationHelper;
use Doctrine\Common\Inflector\Inflector;
@albe
albe / update.php
Created August 8, 2017 11:07
pimcore update cli
<?php
chdir(__DIR__);
include_once("startup.php");
echo "\n";
try {
$opts = new \Zend_Console_Getopt(array(
@albe
albe / ndjson.js
Created July 3, 2018 15:21
ndjson fetch API transformer
const parseLine = (line) => {
try {
return JSON.parse(line);
} catch (e) {
}
};
const ucasefirst = (str) => str.charAt(0).toUpperCase() + str.slice(1);
@albe
albe / input.txt
Created December 1, 2018 12:29
Advent of Code 2018 - Day 1
-12
-6
-12
+1
+3
+3
-1
+10
-8
-9
@albe
albe / gist:c7d71b949399308b48c6d25c14cd9925
Created March 26, 2020 11:02
JS Console jitsi failure after second person joins
Test:19 (TIME) index.html loaded: 214.33500002603978
VM226 lib-jitsi-meet.min.js:6 2020-03-26T10:26:04.508Z [modules/browser/BrowserCapabilities.js] <new t>: This appears to be chrome, ver: 80.0
VM227 app.bundle.min.js:117 2020-03-26T10:26:05.484Z [index.web] <HTMLDocument.<anonymous>>: (TIME) document ready: 1430.4649999830872
VM227 app.bundle.min.js:117 2020-03-26T10:26:05.573Z [modules/UI/videolayout/VideoLayout.js] <Object.changeUserAvatar>: Missed avatar update - no small video yet for undefined
o @ VM227 app.bundle.min.js:117
VM227 app.bundle.min.js:117 2020-03-26T10:26:05.585Z [features/base/media] Start muted:
VM227 app.bundle.min.js:117 2020-03-26T10:26:05.591Z [features/base/media] Start audio only set to false
VM227 app.bundle.min.js:117 2020-03-26T10:26:05.596Z [features/analytics] Error creating analytics handler: Error: Failed to initialize Amplitude handler, no APP key
o @ VM227 app.bundle.min.js:117
VM227 app.bundle.min.js:117 2020-03-26T10:26:05.679Z [modules/UI/videolayout/SmallVideo.j