Skip to content

Instantly share code, notes, and snippets.

Bernd Ennsfellner uberboom

View GitHub Profile
@uberboom
uberboom / mysqlDateUpdate.sql
Created Jul 15, 2016
MySQL 5.7: Convert “zero dates” to null
View mysqlDateUpdate.sql
update `mytable`
set `created` = null
where cast(`created` as char(20)) = '0000-00-00 00:00:00';
@uberboom
uberboom / Cors.php
Created Sep 22, 2015
Laravel 5.1 Cross-Origin Resource Sharing (CORS) Middleware
View Cors.php
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Contracts\Routing\Middleware;
use Illuminate\Http\Response;
class Cors implements Middleware
{
@uberboom
uberboom / watch.sh
Created Feb 6, 2015
Bash: Watch for changes in SASS files and build the CSS target file (with LiveReload support)
View watch.sh
#!/bin/sh
#
# Configuration
#
# sass source
SASS_SOURCE_PATH="resources/scss"
SASS_SOURCE_FILE="main.scss"
@uberboom
uberboom / CleanSource.php
Last active Mar 29, 2018
TYPO3: Hook to remove the generator meta tag (TYPO3 CMS 6.2)
View CleanSource.php
<?php
namespace Your\Extension\Namespace\Hooks;
/**
* Clean up source
*/
class CleanSource extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
{
/**
@uberboom
uberboom / PageLayoutView.php
Last active Nov 2, 2016
TYPO3: Render a backend preview of custom content elements (TYPO3 CMS 6.2)
View PageLayoutView.php
<?php
namespace Your\Extension\Namespace\Hooks;
class PageLayoutView implements \TYPO3\CMS\Backend\View\PageLayoutViewDrawItemHookInterface
{
/**
* Preprocesses the preview rendering of a content element.
*
You can’t perform that action at this time.