Skip to content

Instantly share code, notes, and snippets.

View skurfuerst's full-sized avatar
☀️

Sebastian Kurfürst skurfuerst

☀️
View GitHub Profile
@skurfuerst
skurfuerst / 1_ResetClientCallbackUriModule.groovy
Last active August 29, 2015 14:04
Make Pac4j in Ratpack Name-Based-Hosting aware
import com.google.inject.AbstractModule
import com.google.inject.Injector
import org.pac4j.core.client.Client
import ratpack.guice.HandlerDecoratingModule
import ratpack.handling.Handler
import ratpack.handling.Handlers
/**
* Pac4j does not properly support "Name-based Virtual Hosts". After some debugging, I could find the
* root-cause of the issue:
require "cjson"
local dt = require 'date_time'
-- Generic decoder for JSON logs. This will extract all JSON
-- keys and add them to the `Fields` variable of the created
-- Heka message.
--
-- Example use:
--
-- [NginxJsonLogDecoder]
{
"template" : "fusion-log-*",
"settings" : {
"index.refresh_interval" : "5s",
"analysis" : {
"analyzer" : {
"default" : {
"type" : "standard",
"stopwords" : "_none_"
}
@skurfuerst
skurfuerst / gist:33b403422f4fa2bf23f1
Created September 3, 2014 09:19
Neos Package.php - prepopulate content collection
<?php
namespace TYPO3\Neos\NodeTypes;
/* *
* This script belongs to the TYPO3 Flow package "TYPO3.Neos". *
* *
* It is free software; you can redistribute it and/or modify it under *
* the terms of the GNU General Public License, either version 3 of the *
* License, or (at your option) any later version. *
* *
# This stylesheet is only loaded when the Neos UI is shown
page.head.stylesheets.backend = TYPO3.TypoScript:Tag {
tagName = 'link'
attributes {
rel = 'stylesheet'
href = TYPO3.TypoScript:ResourceUri {
package = 'Acme.Demo'
path = 'Styles/Backend.css'
}
}
@skurfuerst
skurfuerst / neos-be-adjustments.css
Created April 30, 2015 08:18
CSS adjustments to a site to play well in Neos Backend
/* General Adjustmens to the Neos Backend - we only do that if "neos-controls" is visible, that is we are NOT in full-screen mode. */
/* Bootstrap gives the "container" specific widths (inside media queries); which breaks the margins Neos adds to the body.
Thus, we need to reset these settings. */
.neos-controls .container {
width: inherit !important;
}
/* The topbar of neos needs some space, so we push the top navigation lower */
.neos-controls .page-topNavigation {
@skurfuerst
skurfuerst / MySiblingsOperation.php
Created July 19, 2015 08:06
T3DD15 Neos Workshop Examples
<?php
/**
* Created by IntelliJ IDEA.
* User: sebastian
* Date: 18.07.15
* Time: 11:19
*/
namespace TYPO3\NeosDemoTypo3Org;
<?php
/**
* Returns the content specified by $locale.
*
* This function tries to return a content object which strictly matches the locale of the given
* context. If no such content exists it will try to find a content object which is suggested by
* the context's fallback strategy.
*
* @param \F3\TYPO3\Domain\Service\ContentContext $contentContext Context the content should match
* @return \F3\TYPO3\Domain\Model\Content\ContentInterface The content object or NULL if none matched the given context
Asdf
sad
fs
sd
dsfs
fdsf
<?php
$controllerObjectName = 'F3\Foo\Bla\Controller\Abc\Xyz\QuuxController';
$controllerObjectName = 'F3\Foo\Service\Rest\V1\QuuxController';
$matches = array();
preg_match('/
^F3
\\\\(?P<packageKey>[^\\\\]+)
(
\\\\Controller