This file contains hidden or 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 getURLParameter(name) { | |
| return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20'))||null; | |
| } |
This file contains hidden or 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
| /** | |
| * Send data to the given URL via a POST request. Or GET if specified. | |
| * | |
| * Origially from Rakesh Pai & Yuck: http://stackoverflow.com/a/133997/440643 | |
| * | |
| * @param string path | |
| * @param object params | |
| * @param string method | |
| */ | |
| function postToURL(path, params, method) { |
This file contains hidden or 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); |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |