Skip to content

Instantly share code, notes, and snippets.

View helhum's full-sized avatar
💭
I may be slow to respond.

Helmut Hummel helhum

💭
I may be slow to respond.
View GitHub Profile
@helhum
helhum / ClassLoader.php
Created September 2, 2013 13:05
Simple PSR-0 class loader for one extension
<?php
namespace Bitmotion\NawSecuredl\Core;
/***************************************************************
* Copyright notice
*
* (c) 2013 Helmut Hummel (helmut.hummel@typo3.org)
* All rights reserved
*
* This script is part of the Typo3 project. The Typo3 project is
@helhum
helhum / ImageController.php
Last active August 29, 2015 13:59
Extbase Reflection
<?php
namespace Helhum\Example\Controller;
/***************************************************************
* Copyright notice
*
* (c) 2014 Helmut Hummel
*
* All rights reserved
*
@helhum
helhum / index.html
Created April 20, 2014 09:16
Correctly (HTML) encoded values can lead to XSS when re-used in JavaScript context
// Value = <h1>Hello</h1>
<!-- Assuming {Value} will be correctly encoded for HTML attribute context -->
<a href="/foo" id="foo" title="{Value}">{Value}</a>
<div id="targetEl"></div>
<script>
// This kind of JS can still lead to XSS
@helhum
helhum / .htaccess
Created May 7, 2014 16:05
Hosting your own Fluid XSD schemas
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule .* /index.php [L]
@helhum
helhum / keybase.md
Created June 26, 2014 12:34
Keybase verification

Keybase proof

I hereby claim:

  • I am helhum on github.
  • I am helhum (https://keybase.io/helhum) on keybase.
  • I have a public key whose fingerprint is B367 F506 636E E4BA 5A20 0D30 D267 B02C 5A83 969C

To claim this, I am signing this object:

@helhum
helhum / YoutubeProcessing.php
Created July 11, 2014 08:56
FAL Processing
<?php
namespace Helhum\ProcessingServices\Resource\Processing;
use TYPO3\CMS\Core\Utility;
class YoutubeProcessing {
/**
* @var \TYPO3\CMS\Core\Resource\Processing\LocalImageProcessor
*/
protected $processor;
@helhum
helhum / UsingAjaxUrl.html
Last active September 27, 2018 09:08
Using TS rendering
{namespace t=Helhum\TyposcriptRendering\ViewHelpers}
<button class="ajax-button" data-ajaxUri="{t:uri.ajaxAction(action: 'foo', controller: 'bar') -> f:format.htmlentities()}">
Click Me
</button>
<script type="text/javascript">
jQuery.ajax(
jQuery(".ajax-button").data("ajaxUri")
).done(
@helhum
helhum / class_alias_test.php
Created August 4, 2014 13:06
Class Alias Test
<?php
error_reporting(E_ALL);
class request {}
class_alias('request', 'old_request');
interface foo {
public function baz(\request $request);
}
@helhum
helhum / git-search-commit-message
Created September 12, 2014 15:06
Git command to show (remote) branches and tags that contain a commit with a specified commit message
#!/bin/bash
function search-branches() {
for sha1 in `git log --oneline --all --grep "$1" | cut -d" " -f1`
do
git branch -r --contains $sha1
done
}
function search-tags() {
for sha1 in `git log --oneline --all --grep "$1" | cut -d" " -f1`
do
@helhum
helhum / FormErrorsPartial.html
Created October 21, 2014 15:28
Ordered validation results
<f:form.validationResults for="{propertyPath}">
<f:if condition="{validationResults.flattenedErrors}">
<ul>
<f:for each="{validationResults.flattenedErrors}" as="errors">
<li>
<ul>
<f:for each="{errors}" as="error"><li>{error}</li></f:for>
</ul>
</li>
</f:for></ul>