if (jQuery('.startseitenslider').length > 0){
jQuery('head').append('<link>');
jQuery('head').children(":last").attr({
rel: "stylesheet",
type: "text/css",
href: "../css/nivo-slider.css"
});
function init_slider(){
//$('#slider').nivoSlider();
}
jQuery.getScript("../js/jquery.nivo.slider.pack.js", function(){
//wait before initialising to prevent intermittent load error
setTimeout(init_slider,250);
});
}jQuery wait
jQuery.fn.wait = function(time, type) {
time = time || 1000;
type = type || "fx";
return this.queue(type, function() {
var self = this;
setTimeout(function() {
jQuery(self).dequeue();
}, time);
});
};Anwendung:
jQuery(SELECTOR).wait().css('display','block');MySQL UTF-8 fix Umlaute
Geht ziemlich schnell Sonderzeichen zu reparieren in MySQL! Scheiß Encoding! ;)
UPDATE `table` set `column`= REPLACE(`column`,"ß", "ß"), `column`= REPLACE(`column`, "ä", "ä"), `column`= REPLACE(`column`, "ü", "ü"), `column`= REPLACE(`column`, "ö", "ö"), `column`= REPLACE(`column`, 'Ä', 'Ä'), `column`= REPLACE(`column`, "Ü", "Ü"), `column`= REPLACE(`column`, "Ö", "Ö"), `column`= REPLACE(`column`, '€', '€');
jquery input title hint
jQuery.fn.inputHints=function() {
// hides the input display text stored in the title on focus
// and sets it on blur if the user hasn't changed it.
// show the display text
jQuery(this).each(function(i) {
jQuery(this).val(jQuery(this).attr('title')).addClass('hint');
});
// hook up the blur & focus
return jQuery(this).focus(function() {
if (jQuery(this).val() == jQuery(this).attr('title')){
jQuery(this).val('').removeClass('hint');
}
}).blur(function() {
if (jQuery(this).val() === ''){
jQuery(this).val(jQuery(this).attr('title')).addClass('hint');
}
});
};
jQuery(document).ready(function() {
jQuery('input[title]').inputHints();
});PHP detect IOS / iPhone / iPad / iPod
Very simple
<?php
function is_ios(){
if (stripos($_SERVER['HTTP_USER_AGENT'],"iPhone") !== false) {
return true;
} elseif (stripos($_SERVER['HTTP_USER_AGENT'],"iPad") !== false) {
return true;
} elseif (stripos($_SERVER['HTTP_USER_AGENT'],"iPod") !== false) {
return true;
}
return false;
}?>
Windows 8 Ruhezustand / Suspend to disk / Hybernate
Leider gibt es inWindows 8 keinen Knopf um Windows in den Ruhezustand zu schicken. Sicherlich startet Windows 8 sehr schnell, aber wenn es darum geht den Zustand von Programmen bei zubehalten, reicht das nicht.
Zum Glück kann man sich eine Verknüpfung auf dem Desktop anlegen: C:\Windows\System32\rundll32.exe powrprof.dll,SetSuspendState Und schon klappt der Ruhezustand wieder :-)
Apache defend CRIME Attack TLS / SSL
SSL Tests like https://www.ssllabs.com/ssltest/index.html show a vulnerability against CRIME Attack. To overcome / defend that with apache you can turn off the SSL compression.
SSLCompression off
That makes it easy to defend it.
jquery ui modal windows ipad not centered
So solve this just add this to your head
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
/dev/null: Permission denied
Das ist mal ein nette Fehlermeldung! Also, wie reparieren?
sudo rm /dev/null sudo mknod -m 0666 /dev/null c 1 3
und schwups geht alles wieder. Bleibt nur die Frage, wieso und wann das kaputt gegangen ist!?
Zend framework mail bounce because of return-path
To solve this use
$tr = new Zend_Mail_Transport_Sendmail('-fmail@example.com');
$_mail = new Zend_Mail('ISO-8859-1');
$_mail->setDefaultTransport($tr);and wooo it works