Archive for June, 2014

29 Jun 2014

detect the ie version on the client side

14:17 | web trick | 449 views

Goal: feature specific ie version detection I’ve found somewhere a tricky solution for this problem. Here is a little bit modified version of that: The isIE variable will be the version number if we have an internet explorer in other cases this variable will be . The original method not working above ie9, that’s why […]

28 Jun 2014

mshtml InvalidCastException issue

10:57 | .net | 357 views

Goal: to solve mshtml issue When I use a webBrowser control in my .net application and I try to work with the control, sometimes I’ve got the following error. System.InvalidCastException: Unable to cast COM object of type ‘System.__ComObject’ to mshtml. … May be the message will be different but the reason is the same. The […]

26 Jun 2014

simple geo location

11:09 | html5 | 559 views

Goal: how can I use the geo location This is a simple code copy from: click to visit I’ve modified the code to put a marker to the center: … and you will see a blue marker at the ecenter of the map… Show my location

25 Jun 2014

php multiline strings in the code

10:24 | php | 346 views

Goal: use multiline strings in the code I have a simple select statement. I want to store it in a variable but I want to forget the concatenation. We can use the heredoc syntax. $query =

24 Jun 2014

Get the client country based on ip address

18:05 | php, web trick | 611 views

Goal: find the client on the map I was supprised when I examined my server’s stat. There were many client from unknown country. This is not too good. I remember an old solution depends on ip2c database. This is nice and easy, but to keep the database updated not too confortable. 1. database solution I […]

23 Jun 2014

simple browser detection on server side with php

19:20 | php | 361 views

Goal: extract basic information from user agent string To follow the user agent strings is like tilting at windmills. My suggestion is a simple way. just implement the minimum and forget the details. Let’s focus on the main browsers and the main operating systems. The first step will be this. Later we will see what […]

21 Jun 2014

switch on php debug mode

12:18 | php | 295 views

Goal: get all error message from the server Just put the following 2 lines to the start of your code.

19 Jun 2014

no more cache – force the reload based on the file date

8:17 | php, web trick | 352 views

Goal: avoid cache in case of changed files The cache is our friend in case of old files. With this code I can use the cache based on my file date. the result is In a little bit friendly shape: Shorter, smarter… Call the no_cache class like

18 Jun 2014

stylesheet easy swap method

11:07 | css, tricky | 375 views

Goal: tricky way of stylesheet change on a page I’ve read many blogs about this theme, but I’m not satisfied. Here is my way. Short and effective. My blog has a cloudy design, but I have an other image in my head with a golf ball. I don’t want to drop the first one and […]

18 Jun 2014

simple cookie manager class

0:18 | javascript | 297 views

Goal: to create a simple js class for manage cookies I’ve written a simple class to manage cookies. var cookies = new function(){ return { get: function(name){ var r = document.cookie.split(‘; ‘); if(name){ for(var i = 0, l = r.length; i < l; i++){ if(r[i].indexOf(name + '=') == 0){ return r[i].split('=')[1]; } } } else{ […]

#sidebar a { color:#fff; } #sidebar ul ul li { color: #DEF585; } #sidebar h2 { color: #fff; } #sidebar ul p, #sidebar ul select { color: #BEDDBE; } #backfly { background: url(images/golfBallWallPaper.jpg) left bottom fixed repeat-x #65a51d; }