Skip to content

Instantly share code, notes, and snippets.

View mneuhaus's full-sized avatar

Marc Neuhaus mneuhaus

View GitHub Profile
@mneuhaus
mneuhaus / ext_localconf.php
Created February 17, 2012 00:38
Backend Layout Condition for TypoScript
<?php
function user_beLayout($layout) {
if($GLOBALS["TSFE"]->page["backend_layout"] > 0 && $GLOBALS["TSFE"]->page["backend_layout"] == $layout)
return true;
foreach ($GLOBALS["TSFE"]->rootLine as $page)
if($page["backend_layout_next_level"] > 0 && $page["backend_layout_next_level"] == $layout)
return true;
@mneuhaus
mneuhaus / composer.json
Created October 8, 2012 09:00
Famelo.Sandbox
{
"name": "famelo/sandbox",
"description" : "My Basic sandbox to work on stuff without Neos",
"license": "GPL-3.0+",
"homepage": "https://gist.github.com/3851521",
"repositories": [
{
"type": "composer",
"url": "http://ci.typo3.robertlemke.net/job/composer-packages/ws/repository/"
}
@mneuhaus
mneuhaus / Configuration.Environment.php
Created October 12, 2012 10:01
Shared hosting Environmentshandling
<?php
$conditions = array(
"SCRIPT_FILENAME" => array(
"/kunden/350350_33330/flow/package-catalog/flow" => array(
"FLOW_CONTEXT" => "Production",
"FLOW_ROOTPATH" => "/kunden/350350_33330/flow/package-catalog/"
)
),
"HTTP_HOST" => array(
"package-catalog.flow.famelo.com" => array(
@mneuhaus
mneuhaus / Index.html
Created November 3, 2012 16:49
Flow: Security/User Kickstart
<f:layout name="Default" />
<f:section name="Content">
<div class="content">
<section class="body">
<f:form action="authenticate" method="post">
<fieldset>
<legend></legend>
<div class="row username">
<label id="usernameLabel" for="username" class="placeholder"><span><f:translate package="TYPO3.Flow">Username</f:translate></span></label>
@mneuhaus
mneuhaus / Policy.yaml
Created November 4, 2012 11:11
Flow: Policy to disallow everything except the LoginController
# #
# Security policy for the TYPO3 package #
# #
resources:
methods:
ADU: 'method(Famelo\ADU\(?!.*Login).*->.*())'
roles:
Administrator: [ Editor ]
prototype(TYPO3.Expose:Schema:Famelo.ADU.Domain.Model.Branch) < prototype(TYPO3.Expose:Schema) {
properties {
name {
label = 'Name'
}
branch {
label = 'Übergeordnete Niederlassung'
}
}
@mneuhaus
mneuhaus / FileDiffs.sublime-settings
Created November 9, 2012 10:00
Use Changes.app as Diff tool in SublimeText
{
// Preferences -> Package Settings -> FileDiffs -> Settings - User
"open_in_sublime": false,
"cmd": ["chdiff", "$file1", "$file2"]
}
@mneuhaus
mneuhaus / unpick.sh
Created November 20, 2012 09:28
Command to remove a specific commit from a git branch
git filter-branch --commit-filter '
if [ "$GIT_COMMIT" = "8daa495e5a6d1677334d6a29be353652dc3324e7" ];
then
skip_commit "$@";
else
git commit-tree "$@";
fi' 8daa495e5a6d1677334d6a29be353652dc3324e^1..HEAD
@mneuhaus
mneuhaus / autoconf213
Created December 2, 2012 10:13 — forked from msonnabaum/gist:1306569
install xhprof on mamp for php 5.3.*
require 'formula'
class Autoconf213 < Formula
url 'http://ftp.gnu.org/gnu/autoconf/autoconf-2.13.tar.gz'
homepage 'http://www.gnu.org/software/autoconf/'
md5 '9de56d4a161a723228220b0f425dc711'
def install
system "./configure", "--program-suffix=213",
"--prefix=#{prefix}",
@mneuhaus
mneuhaus / Caching.md
Created December 3, 2012 11:47
Caching

The Caching API currently is quite low-level. Tagging is useful to flush specific parts, but the tagging and flushing itself must still completly be implemented manually.

I think there are a few usecases that could be simplefied through some api love:

  • cache-entry for specific conditional arguments
  • cache-entry conditionally based on current user roles
  • cache-entry based on one or all entities of a specific type, maybe even a specific property
  • cache-entry based on directory/path changes

I could imagine to do this with a 'cacheEntry' API layer above the current Caching API: