Skip to content

Instantly share code, notes, and snippets.

@uberboom
uberboom / mysqlDateUpdate.sql
Created July 15, 2016 06:24
MySQL 5.7: Convert “zero dates” to null
update `mytable`
set `created` = null
where cast(`created` as char(20)) = '0000-00-00 00:00:00';
@uberboom
uberboom / Cors.php
Created September 22, 2015 13:16
Laravel 5.1 Cross-Origin Resource Sharing (CORS) Middleware
<?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 February 6, 2015 15:02
Bash: Watch for changes in SASS files and build the CSS target file (with LiveReload support)
#!/bin/sh
#
# Configuration
#
# sass source
SASS_SOURCE_PATH="resources/scss"
SASS_SOURCE_FILE="main.scss"
@uberboom
uberboom / CleanSource.php
Last active December 17, 2019 15:01
TYPO3: Hook to remove the generator meta tag (TYPO3 CMS 6.2)
<?php
namespace Your\Extension\Namespace\Hooks;
/**
* Clean up source
*/
class CleanSource extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
{
/**
@uberboom
uberboom / PageLayoutView.php
Last active January 30, 2020 19:17
TYPO3: Render a backend preview of custom content elements (TYPO3 CMS 6.2)
<?php
namespace Your\Extension\Namespace\Hooks;
class PageLayoutView implements \TYPO3\CMS\Backend\View\PageLayoutViewDrawItemHookInterface
{
/**
* Preprocesses the preview rendering of a content element.
*