Skip to content

Instantly share code, notes, and snippets.

View stmllr's full-sized avatar
🏴‍☠️

Steffen Müller stmllr

🏴‍☠️
View GitHub Profile
@stmllr
stmllr / download.php
Last active February 17, 2023 06:41
PHP script to download a file from files/ directory. Warning: no authorization or security checks implemented.
<?php
// You need to create the files/ directory inside your document root to put your files.
if (substr($_SERVER['REQUEST_URI'], 0, 7) !== '/files/') {
die('not allowed');
}
$absolutePath = $_SERVER['DOCUMENT_ROOT'] . $_SERVER['REQUEST_URI'];
@stmllr
stmllr / Greylog2Writer.php
Created May 15, 2013 14:22
Experimental implementation of a greylog2 LogWriter for TYPO3 CMS >= 6.x
<?php
namespace T3node\Graylog2Writer\Log\Writer;
/***************************************************************
* Copyright notice
*
* (c) 2013 Steffen Müller <typo3@t3node.com>
*
* All rights reserved
*
@stmllr
stmllr / takeScreenshotAfterFailedStep.php
Last active December 16, 2015 11:49 — forked from fbrnc/gist:4550079
Take screenshot after a step failed in Behat/Mink using Selenium WebDriver
<?php
class FeatureContext extends MinkContext {
/**
* Take screenshot when step fails. Works only with Selenium2Driver.
* Screenshot is saved at [Date]/[Feature]/[Scenario]/[Step].jpg
*
* @AfterStep @javascript
*/
@stmllr
stmllr / DeprecationWriter.php
Created April 1, 2013 01:18
Prove of concept for a Deprecation LogWriter for TYPO3.
<?php
namespace TYPO3\CMS\Core\Log\Writer;
/***************************************************************
* Copyright notice
*
* (c) 2013 Steffen Müller (typo3@t3node.com)
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
@stmllr
stmllr / gist:4082423
Created November 15, 2012 23:41
Poll song name from remote service using jQuery
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.js"></script>
<div id="song">Loading song...</div>
$(document).ready(function() {
$.post(
'http://example.com/get/song',
function(data) {
if (data.song !== '') {
$('#song').text(data.song);
}