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
{ | |
"B": "Burgenland", | |
"K": "Kärnten", | |
"N": "Niederösterreich", | |
"O": "Oberöstereich", | |
"S": "Salzburg", | |
"St": "Steiermark", | |
"T": "Tirol", | |
"V": "Vorarlberg", | |
"W": "Wien" |
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
//lsauer.com, 2012 lo sauer | |
//description: intervalCall binds a function to a declared scope and invokes it after 'tm' milliseconds | |
//@param scope: scope in which the function should be invoked | |
//@param fn: the function to be invoked | |
//@param tm: timeout in milliseconds | |
//[@param fntimes]: Optional. A function to control the number of invocations of 'fn', i.e. to declare events / triggers based on the invocation-count | |
// fntimes is passed an integer Number-counter, starting at 1; | |
function intervalCall(scope, fn, tm, fntimes) | |
{ |
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
//lsauer.com, 2012 lo sauer | |
//description: intervalCallNtimes; counter after nth time clearinterval; bind a function to a certain scope using 'intervalCall' | |
//requires: intervalCall, see: https://gist.github.com/lsauer/cf70e65c208cc311ce97 | |
//@param fntimes: an integer-Number or function to control the number of invocations of the callback-counter-function:'fntimes' | |
// fntimes is passed an integer Number-counter, starting at 1; | |
//@param fn: the function to be invoked | |
//@param tm: timeout in milliseconds | |
//@param scope: scope in which the function should be invoked | |
//-> examples are provided below | |
function intervalCallNtimes(fntimes, fn, tm, scope){ |
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
/** | |
* lsauer, 2013 | |
* Lean handler for exception reporting; stdout is set by default to console.log | |
* @param {exc} exc an Exception instance of Error, containing a message and stack property | |
* @param {exc} stdOut A variadic function for error reporting. By default: console.log | |
* @return undefined | |
*/ | |
var exceptionHandler = function(exc, stdOut){ | |
var stdOut = stdOut || function() { console.log.apply(console, arguments) }; | |
if(stdOut instanceof Function){ |
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
"use strict"; | |
if(!this.hasOwnProperty('globalScope')){ | |
var globalScope; | |
try { | |
globalScope = Function('return this')(); | |
}catch(ex){ | |
//extend else-if cases for other globalObject-names as needed... | |
if(this && this.hasOwnProperty && this.hasOwnProperty('window')){ | |
globalScope = window; | |
}else{ |
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
/** | |
L. Sauer,2011 | |
license: public domain | |
http://xhr2.blogspot.com/2011/09/php-arraymerge-by-value-or-array-merge.html | |
*/ | |
function array_merge_values_explode(){ | |
$args = func_get_args(); | |
$elem = array(); | |
$delim = strlen(end($args))<=2 ? array_pop($args) : ','; |
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
//L.Sauer 2011; Public Domain | |
//renders code even without SyntaxHighlighter present | |
//see http://xhr2.blogspot.com/2011/09/alexgorbatchevcom-down-changing.html | |
//dp is the typical SyntaxHighlighter object; | |
//use the class 'shFallback' for styling the fallback <pre>-tag | |
if(typeof dp === 'undefined' ){ | |
(function(){ | |
var els = document.getElementsByTagName('script'); | |
var elClass = null; //or e.g. class 'shFallback' | |
for(var i in els) { |
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
( a >= 0 && ~a >= 0 ) | |
First statement ensures that the variable is positive, the second ensures that no sign-bit is flipped. |
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 j2timer(e){ | |
window.tdiff || (window.tdiff = []); | |
window.tdlog || (window.tdlog = []); | |
window.fnred || (window.fnred = function(a,b){return a-b;}); | |
//toogle statement | |
if( (tdiff.length+1) % 2){ | |
tdiff.push( Date.now()); | |
return; | |
} |
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
The following code will do just what you would expect (a css rule for the element's id is applied). | |
<input id="searchCmpnd" onClick="this._originalWidth = this.style.width; this.style.width='50%';" onBlur="this.style.width = this._originalWidth;" /> | |
However when the onClick is changed to onKeyUp, onKeyPress, onKeyDown it will expand but not retract. This is because the element is not marked focused, or because the event order got messed up (in Chrome >12). | |
Include this.focus(); | |
<input id="searchCmpnd" onClick="this._originalWidth = this.style.width; this.focus(); this.style.width='50%';" onBlur="this.style.width = this._originalWidth;" /> |
OlderNewer