Blogroll

Thursday, December 6, 2012

Get city from lat and lon ( GOOGLE MAP API )

Below is my code : $status = 'OK'; $value = ''; try { $lat = $_GET ['lat']; $lon = $_GET ['lon']; // TODO: validate input + find city name by coord assert ( is_numeric ( $lat ) ); assert ( is_numeric ( $lon ) ); $google_api_link = 'http://maps.googleapis.com/maps/api/geocode/json?latlng=%s&sensor=false'; $lat = filter_input ( INPUT_GET, 'lat' ); $lon = filter_input ( INPUT_GET, 'lon' ); $link = sprintf ( $google_api_link, $lat . "," . $lon ); $content = httpReq ( $link ); $json_object = json_decode ( $content ); if ($json_object->status != 'OK') { $status...
Tuesday, November 27, 2012

Fix cross domain request in IE8 and above

I have problem with IE browser when request other link from my site, From IE8 and above, when request you will be get error "Access is deny or no transport". To fix this , you must implement for IE specific funtion ( don't use Ajax jquery ). Detail link read at here http://www.nczonline.net/blog/2010/05/25/cross-domain-ajax-with-cross-origin-resource-shari...
Thursday, October 18, 2012

emmbed flash to html

This way is most simple and working for all modern browser. code :...
Thursday, September 13, 2012

Fix error bind() fail on sphinx

We should try 2 command before this below guide : the 'init: ... main process ended, respawning' suggests there is something in the init script that sets a watchdog to make sure sphinx doesnt die. Perhaps you need to shutdown sphinx via the init script itself /etc/init.d/sphinxsearch stop or By default, it seems like the debian package will start Sphinx with an additional keepalive process. I was able to stop it successfully with this; sudo service sphinxsearch stop If 2 way above is not success, you should try. using config file '/sphinx/conf/sphinx.conf'... listening on all interfaces, port=9312 bind() failed on 0.0.0.0, retrying... bind()...
Wednesday, September 12, 2012

Simple blog using mongoDb

This is simple blog allow display post , add new post and add comment for post using MongoDb for storage. Note: Download mongDb for php at this link http://www.mongodb.org/display/DOCS/PHP+Language+Center And install mongDb before demotrastion. I pushed source to gitHub att this link https://github.com/bvtuan/blog_mongodb Hope it useful for who learning mongoDb....
Tuesday, September 11, 2012

Install jdk 7 for ubuntu 12.04

Just use some terminal code below : sudo rm /var/lib/dpkg/info/oracle-java7-installer* sudo apt-get purge oracle-java7-installer* sudo rm /etc/apt/sources.list.d/*java* sudo apt-get update sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java7-install...

Installing Sphinx 2.0.4 on Ubuntu 10.04 - Lucid

Description: “Sphinx  is a full-text search engine, distributed under GPL version 2. Commercial license is also available for embedded use. Generally, it’s a standalone search engine, meant to provide fast, size-efficient and relevant fulltext search functions to other applications. Sphinx was specially designed to integrate well with SQL databases and scripting languages. Currently built-in data sources support fetching data either via direct connection to MySQL or PostgreSQL, or using XML pipe mechanism (a pipe to indexer in special XML-based format which Sphinx recognizes). As for the name, Sphinx is an acronym which is officially...
Thursday, August 9, 2012

Install mongodb for windows

Follow some below step: 1. Download lasted version at http://www.mongodb.org/downloads and choose right version for your computer. 2. Extract zip file to somewhere, For me is c:\bin\mongodb. 3.Create folder that save mongodb data, For me is c:\data  4.Open cmd and type cd c:\bin\mongodb\bin 5.Continue and cmd and type mongod --dbpath c:\data to run mongodb as services (c:\data is folder that created before). In this step, mongdb is running, Remember don't close cmd because it's running. To do testing with mongDb, do below step: 6. If have no error appear, It mean you installed mongodb  as services successful. Next test it...

Nodejs with mongodb

Today, I excited to research nodeJs and i find way  how to access db to Mongodb from nodeJS. At first, install module mongodb for node in this link&nbs...
Wednesday, July 25, 2012

Regular express php

Regular express is language to description a group of string pattern. I used to validate url, email, phone, name,,..... Below is table definition some rule for regular expre...
Tuesday, July 17, 2012

Compress html with php

Compress html help you load page with faster speed, delete your html comment. Fist : save out html and call function when page load done. Put below code before show your html cod...
Monday, July 16, 2012

13 useful query for wordpress

Change Siteurl & Homeurl WordPress stores the absolute path of the site URL and home URL in the database. Therefore, if you transfer your WordPress site from the localhost to your server, your site will not load online. This is because the absolute path URL is still pointing to your localhost. You will need to change the site URL and the home URL in order for the site to work. Solution: 1 UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldsiteurl.com', 'http://www.newsiteurl.com') WHERE option_name = 'home' OR option_name = 'siteurl'; ...
Friday, June 15, 2012

Remove new line php

I'll many way to remove new line in php. Some version not working in some code. Below is code almost working well $string = preg_replace('@[\s]{2,}@',' ',$value); $string = trim(str_replace(array("/\n|\r/","\""),array("", "'"), $string)...
Wednesday, May 23, 2012

10 sql tips to speed up your database

On most websites, content is stored in a database and served to visitors upon request. Databases are very fast, but there’s lots of things that you can do to enhance its speed and make sure you won’t waste any server resources. In this article, I have compiled 10 very useful tips to optimize and speed up your website database. Design your database with caution This first tip may seems obvious, but the fact is that most database problems come from badly-designed table structure. For example, I have seen people storing information such as client info and payment info in the same database column. For both the database system and developers...
Wednesday, May 16, 2012

Zend Framework: Accessing Request, Response & Router Object from anywhere

On most websites, content is stored in a database and served to visitors upon request. Databases are very fast, but there’s lots of things that you can do to enhance its speed and make sure you won’t waste any server resources. In this article, I have compiled 10 very useful tips to optimize and speed up your website database. Design your database with caution This first tip may seems obvious, but the fact is that most database problems come from badly-designed table structure. For example, I have seen people storing information such as client info and payment info in the same database column. For both the database system and developers...
Monday, April 23, 2012

RGBa Css with transparent.

Read full article in h...
Friday, April 20, 2012

Detect yahoo online status

Detect yahoo stat...
Monday, April 16, 2012

Solved redirect with zend router

Redirect is the function in zend framework. But i hard to redirect on zend router config. I have some error when use redirect to my router config. Below solved probl...
Wednesday, April 11, 2012

Display Calendar Php Code

One of the website features my customers love to provider their web users is an online dynamic calendar. An online calendar can be used for events, upcoming product specials, memos, and anything else you can think of. I've taken some time to completely rewrite the PHP event calendar so that I may share it with you...
Sunday, April 8, 2012

List category and subcategory in magento

I found below code to list category and subcategory . I can put it everywhere in your websit...
Tuesday, February 21, 2012

lavalamp , Plugin for jquery lover

lavalamp is plugin for enhacement effect your website, it's small and easy to use. Full article at here This is demo lin...

Speed up load page by lazyload

Default, when your website is load, all image tag available in your site will be load all. It make your site load slowly and some picture that you don't show but it will be loaded. That's wasty....
Thursday, February 16, 2012

List files and folders in the folder

This is easy way to read all file and folder to array, this also check allow extestion file to read...
Friday, January 13, 2012

27 Best Photoshop Web Layout Design Tutorials to Design Decent Web Layouts

For beginner web designers – design tutorials really help to understand the basic knowledge about web design!, Here is a collection of 27 layout design tutorials that will help you with designing a decent looking website. Some of them are really good...

Use seclection in css

Something cool that you can do using just CSS is change the selection color when you are range selecting content...
Thursday, January 12, 2012

Create custom hash.

I refer use crypt() instead md5 or sha256, because of crypt proviced many hash method and key to decode is automatic created -> hard to crack...
Wednesday, January 11, 2012

Make auto scroll when page scroll

Link demo  Technique: auto scroll follow window scroll top and set margin-top for scroll element. ...
Page 1 Of 71234567Next