BloggerAds廣告

相關文章

2014年12月10日 星期三

Joomla installation hangs solusion

For those who hangs during the joomla installation, here is the solution:

at the <your-site-root>/libraries/joomla/filter/input.php
around line 660


// Convert decimal
//$source = preg_replace('/&#(\d+);/me', "utf8_encode(chr(\\1))", $source); // decimal notation
$source = preg_replace_callback('/&#(\d+);/m', function($m){return utf8_encode(chr($m[1]));}, $source); // decimal notation
  
// Convert hex
//$source = preg_replace('/&#x([a-f0-9]+);/mei', "utf8_encode(chr(0x\\1))", $source); // hex notation
$source = preg_replace_callback('/&#x([a-f0-9]+);/mi', function($m){return utf8_encode(chr('0x'.$m[1]));}, $source); // hex notation

font-weight: bold not works in safari

given CSS

@font-face {

 font-family: Frutiger;

 src: url('../fonts/frutiger_ce_45_light.otf'),

   url('../fonts/frutiger_ce_45_light.ttf') format('truetype'),

   url('../fonts/frutiger_ce_45_light.woff') format("woff"),

   url('../fonts/frutiger_ce_45_light.eot') format('embedded-opentype'),

   url('../fonts/frutiger_ce_45_light.eot?#iefix') format('embedded-opentype');

}



.someBoldFont {

 font-family: Frutiger;

}

<span class="someBoldFont">hello world</span>
you'll notice that the word wont bold in Safari


here are the solution


@font-face {

 font-family: Frutiger;



 /* add this 2 style rule */

 font-weight: normal;

 font-style: normal;

 /* end add */



 src: url('../fonts/frutiger_ce_45_light.otf'),

   url('../fonts/frutiger_ce_45_light.ttf') format('truetype'),

   url('../fonts/frutiger_ce_45_light.woff') format("woff"),

   url('../fonts/frutiger_ce_45_light.eot') format('embedded-opentype'),

   url('../fonts/frutiger_ce_45_light.eot?#iefix') format('embedded-opentype');

}

2014年11月24日 星期一

solve safari weird display when resize problem

the image shows the weired layout display at safari when resizing the html page

it looks totally fuxked up, but the HTML are just fine actually when you select any items on the page, because safari just render the graphic wrongly.

the problem causes is that i used negative z-index in my CSS

to solve it, simply change all negative z-index to >=0

2014年10月3日 星期五

php email 標題 主旨 寄件者 亂碼問題

<?php
function emailEncode($str) {
  return "=?UTF-8?B?".base64_encode($str)."?=";
}

$subject = emailEncode("hello world");
$sender = emailEncode("littleshell");
?>

2014年6月11日 星期三

2345 hao123 hijack solusion

小弟早排被萬惡的2345.com 綁架了
2345.com是大陸網站, 還是用中文寫吧

這個一般殺毒是掃不到的

上網看了不下100個所謂解決方法, 沒有一個有用

例如用甚麼軟件掃描
用甚麼anti malware 掃描
重改首頁 (這個可笑, 當然沒效, 那麼強力的hijacker 會那麼輕易讓你更改首頁嗎)
改regedit
裝甚麼修復器
更可笑是重新把瀏覽器捷徑重設, 這個就算成功也只是治標不治本 (聽說2345 是會把你的瀏覽器捷徑換成假的)


以上所有方法通通無用
終於讓我找到一個暴力解決方法 -- 360安全衛士

裝好後, 其他甚麼也不要理, 直接找系統急救箱, 開強力模式

別怕~~反正閣下的電腦本身都好毒, 確定就是~~
掃描好後, restart 電腦, 恭喜~~你所有瀏覽器都康復了~~

然後當然最後就是把360移除~~都康復了, 還留來幹?? 又多廣告又慢

成功的話請給小弟一個留言~~

2014年3月31日 星期一

input password placeholder workaround IE

the workaround solution for using placeholder on IE<10
it works for IE7~10

(credits to http://jsfiddle.net/q8ajJ/)

HTML
<!-- Style = display none for people who dont have javascript -->
<input id="fake_pass" name="fake_pass" style="display: none;" type="text" value="Enter Password:" />
<input id="real_pass" name="real_pass" type="password" />


JS
// On DOM ready, hide the real password
$('#real_pass').hide();

// Show the fake pass (because JS is enabled)
$('#fake_pass').show();

// On focus of the fake password field
$('#fake_pass').focus(function(){
    $(this).hide(); //  hide the fake password input text
    $('#real_pass').show().focus(); // and show the real password input password
});

// On blur of the real pass
$('#real_pass').blur(function(){
    if($(this).val() == ""){ // if the value is empty, 
        $(this).hide(); // hide the real password field
        $('#fake_pass').show(); // show the fake password
    }
    // otherwise, a password has been entered,
    // so do nothing (leave the real password showing)
});

2014年2月7日 星期五

vertical center css

content from http://blog.themeforest.net/tutorials/vertical-centering-with-css/

In this method, we will insert a div above the content element. This will be set to height:50%; and margin-bottom:-contentheight;. The content will then clear the float and end up in the middle.

<div id="floater">
<div id="content">
 Content here
</div>
</div>
#floater {float:left; height:50%; margin-bottom:-120px;}
#content {clear:both; height:240px; position:relative;}

THE GOODS

  • Works in all browsers
  • When there isn’t enough space (ie. the window shrinks) our content will not be cut off, and a scrollbar will appear.

THE BADS

  • Only one I can think of is that it requires an extra empty element (which isn’t that bad, another subjective topic)