Skip to content

Instantly share code, notes, and snippets.

@pappelt
pappelt / JavaScript-File with URL-Params
Created January 14, 2013 15:55
Hand over params into js-files via URL
Put this into the file, where you want to use the params:
function parseQuery ( query ) {
var Params = new Object ();
if ( ! query ) return Params; // return empty object
var Pairs = query.split(/[;&]/);
for ( var i = 0; i < Pairs.length; i++ ) {
var KeyVal = Pairs[i].split('=');
if ( ! KeyVal || KeyVal.length != 2 ) continue;
var key = unescape( KeyVal[0] );
@pappelt
pappelt / datetime.php
Created November 2, 2012 15:14
PHP DateTime
$dateformat = 'Y-m-d\TH:i';
$timezone = 'Europe/Berlin';
$_sPickupDateTimeObj = new DateTime('now + 1 day', new DateTimeZone($timezone));
$_sPickupDateTime = $_sPickupDateTimeObj->format($dateformat);
@pappelt
pappelt / AjaxRequest-Indicator
Created November 21, 2011 08:55
Show if Ajax-Requests are send/running/stopped
//needs a div with id='log' in the DOM.
$(document).ajaxStart(function() {
$('#log').text('Ajax-Request started');
});
$(document).ajaxStop(function() {
$('#log').text('Ajax-Request stopped');
});
$(document).ajaxComplete(function() {