This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Clears the cache based on the command $cacheCmd. | |
* | |
* $cacheCmd='pages': Clears cache for all pages. Requires admin-flag to | |
* be set for BE_USER. | |
* | |
* $cacheCmd='all': Clears all cache_tables. This is necessary if | |
* templates are updated. Requires admin-flag to be set for BE_USER. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* @var $cacheHash \TYPO3\CMS\Frontend\Page\CacheHashCalculator */ | |
$cacheHash = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Page\\CacheHashCalculator'); | |
$result = $cacheHash->generateForParameters($_SERVER['QUERY_STRING']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Function for performing replaces on strings that allows for the specification of a limit | |
* on the number of occurrences of $search to replace. | |
* | |
* @see http://www.php.net/manual/en/function.str-replace.php#108239 | |
* | |
* @param $search | |
* @param $replace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace VENDOR\ExtName\Command; | |
class CmdNameCommandController extends \TYPO3\CMS\Extbase\Mvc\Controller\CommandController { | |
public function fooCommand($bar) { | |
echo "foo\n"; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Source: http://stackoverflow.com/a/14823315/440643 | |
var _show = $.fn.modal.Constructor.prototype.show; | |
$.fn.modal.Constructor.prototype.show = function() { | |
_show.apply(this, arguments); | |
//Do custom stuff here | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
if($.fn.typeahead != 'undefined') { | |
var _show = $.fn.typeahead.Constructor.prototype.show; | |
$.fn.typeahead.Constructor.prototype.show = function() { | |
if(typeof this.options.onshow == 'function') { | |
this.options.onshow(); | |
} | |
// Call parent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery.extend({ | |
getObjectLength: function(obj){ | |
var length = 0; | |
if(typeof obj == 'object') { | |
if(Object.keys) { | |
length = Object.keys(obj).length; | |
} else { | |
var i; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Replace favicon for your development sites | |
// @namespace http://itinko.nl/ | |
// @version 1.0 | |
// @description All urls starting with dev. or ending in .dev will have a changed favicon. Slightly altered version of http://userscripts.org/scripts/show/42247. Icon from: http://www.favicon.cc/?action=icon&file_id=350544 | |
// @match http://*.dev/* | |
// @match http://dev.*/* | |
// @copyright 2013+, Björn Kuipers | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Setup multi-language/domain config | |
* | |
* NOTE: Multiple domains for a single language will not work. | |
* The first defined domain is used in that case. | |
*/ | |
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DOMAINS'] = array( | |
'encode' => array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env php | |
<?php | |
// Resolve Short URL | |
function resolveShortURL($url) { | |
$ch = curl_init($url); | |
curl_setopt($ch, CURLOPT_HEADER, false); | |
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); | |
curl_setopt($ch, CURLOPT_NOBODY, true); | |
$yy = curl_exec($ch); | |
$endUrl = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL); |
OlderNewer