Skip to content

Instantly share code, notes, and snippets.

View DanielWeitenauer's full-sized avatar

Daniel Weitenauer DanielWeitenauer

  • studio ahoi
  • Hamburg
View GitHub Profile
@DanielWeitenauer
DanielWeitenauer / ErrorPages.yaml
Created December 28, 2020 23:28 — forked from josefglatz/ErrorPages.yaml
Local Error Handler for TYPO3 (works also if your TYPO3 website is behind a basic auth)
errorHandling:
-
errorCode: '404'
errorContentSource: 't3://page?uid=316'
errorHandler: PHP
errorPhpClassFQCN: B13\AnyProject\PageErrorHandler\LocalPageErrorHandler
@DanielWeitenauer
DanielWeitenauer / LocalPageErrorHandler.php
Created November 14, 2020 21:51 — forked from bmack/LocalPageErrorHandler.php
Local Error Handler for TYPO3
<?php
namespace B13\AnyProject\PageErrorHandler;
/*
* This file is part of a b13 extension.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
@DanielWeitenauer
DanielWeitenauer / css-compress.php
Created July 30, 2020 14:10 — forked from manastungare/css-compress.php
On-the-fly CSS Compression
<?php
/**
* On-the-fly CSS Compression
* Copyright (c) 2009 and onwards, Manas Tungare.
* Creative Commons Attribution, Share-Alike.
*
* In order to minimize the number and size of HTTP requests for CSS content,
* this script combines multiple CSS files into a single file and compresses
* it on-the-fly.
*
@DanielWeitenauer
DanielWeitenauer / image_xml_sitemap.php
Created July 30, 2020 14:09 — forked from gherkins/image_xml_sitemap.php
Create Google (Image) XML Sitemaps using PHP
header("Content-type: text/xml; charset=utf-8");
//create your XML document, using the namespaces
$urlset = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" /><!--?xml version="1.0" encoding="UTF-8"?-->');
//iterate over your sites pages or whatever you like
foreach (getMyPagesOrWhatEver() as $item):
//add the page URL to the XML urlset
IM HEAD
############
<script>
var elricco = {};
elricco.funcs = [];
</script>
MODULAUSGABE
############
<?php if (!rex::isBackend()): ?>
<?php
if( "REX_VALUE[2]" != "" )
{
// Im Backend den Link zur Quelle anzeigen
if(rex::isBackend())
{
$master = rex_article::get(REX_LINK[id=1 output=id]);
@DanielWeitenauer
DanielWeitenauer / PostMessageToSlackChannel.php
Created July 9, 2017 11:53 — forked from nadar/PostMessageToSlackChannel.php
Post a message to a slack channel with PHP
<?php
/**
* Send a Message to a Slack Channel.
*
* In order to get the API Token visit: https://api.slack.com/custom-integrations/legacy-tokens
* The token will look something like this `xoxo-2100000415-0000000000-0000000000-ab1ab1`.
*
* @param string $message The message to post into a channel.
* @param string $channel The name of the channel prefixed with #, example #foobar