Skip to content

Instantly share code, notes, and snippets.

View bjrnqprs's full-sized avatar

Björn Kuipers bjrnqprs

View GitHub Profile
@econic
econic / Foo
Created November 4, 2013 13:47
How to ignore the enablefields in an extbase 1:1 relation
<?php
namespace Example\Key\Domain\Model;
class Foo {
/**
* BarRepository
*
* @var \Example\Key\Domain\Repository\BarRepository
@danielbachhuber
danielbachhuber / gist:7126249
Last active December 21, 2021 15:46
Include posts from authors in the search results where either their display name or user login matches the query string
<?php
/**
* Include posts from authors in the search results where
* either their display name or user login matches the query string
*
* @author danielbachhuber
*/
add_filter( 'posts_search', 'db_filter_authors_search' );
function db_filter_authors_search( $posts_search ) {
@maddy2101
maddy2101 / ext_tables.php
Last active July 30, 2021 12:16
integrate Flexform in TYPO3 6.0/6.1 Plugin
<?php
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
$_EXTKEY,
'ObjectRandom',
'Object Trailer'
);
$pluginSignature = str_replace('_', '', $_EXTKEY) . '_objectrandom';
$TCA['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue($pluginSignature, 'FILE:EXT:' . $_EXTKEY . '/Configuration/FlexForm/AbstractObject/Flexform.xml');
@barryvdh
barryvdh / _ide_helper.php
Last active May 6, 2024 07:45
Laravel IDE Helper for Netbeans / PhpStorm / Sublime Text 2 CodeIntel, generated using https://github.com/barryvdh/laravel-ide-helper
<?php
/**
* A helper file for Laravel 5, to provide autocomplete information to your IDE
* Generated for Laravel 5.5.13 on 2017-09-28.
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
namespace {
exit("This file should not be included, only analyzed by your IDE");
@damienalexandre
damienalexandre / tool.php
Created October 3, 2011 09:47
Download large file from the web via php
<?php
/**
* Download a large distant file to a local destination.
*
* This method is very memory efficient :-)
* The file can be huge, PHP doesn't load it in memory.
*
* /!\ Warning, the return value is always true, you must use === to test the response type too.
*
* @author dalexandre
@michaelcontento
michaelcontento / demo.sql
Created June 20, 2011 08:32
MySQL: Insert utf8 via latin1-connection into utf8
--
-- First we create the table with charset=utf8
--
mysql> create table utf8 (msg varchar(10)) default charset=utf8;
Query OK, 0 rows affected (0.00 sec)
--
-- This is out demo-character (remember the hex value!)
--