Articles
18 June 2013 | Category:
Accessibility, Browsers
| Comments (0)
If you do your element clickable then add attribute role="button" to tell screen reader that the element is a button. This is useful especially for element A where we want to tell that this is a button, not a link. Read more on MDN.
Note: Windows Narrator on Windows 7 doesn’t read web content inside the browsers.
2 June 2013 | Category:
General
| Comments (0)
During my work I had to frequency cleanse the history, cookies and temporary files of Internet Explorer. Doing it manually it’s just annoying. There is a better way: use command line. So, create a clearie.bat file with commands:
:: Clear IE history
START RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1
:: Clear IE Cookies
START RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2
:: Clear IE Temp files
START RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8
START command enables a user to start a separate window in Windows from the Win[......]
Read more about post Clearing IE history, cookies and temporary files from command line
26 May 2013 | Category:
Server Side
| Comments (0)
If you want to check Apache configuration file syntax then use simple httpd.exe -t command. Run it from place where your Apache is installed, eg. C:\wamp\bin\apache\apache2.2.22\bin>. If everything is fine then you’ll see:
Syntax OK
28 April 2013 | Category:
Server Side
| Comments (0)
If you want to redirect from URL without www (example.com) to URL with www (www.example.com) then this can be done easy be adding following rules to .htaccess:
RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Benefits
- Include HTTP and HTTPS protocol.
- Makes all URL-s consistent.
- Prevent from duplicate content that search engines will not collect same data more that once.
26 April 2013 | Category:
JavaScript
| Comments (0)
During some tests I found at least 3 ways to check if object “is empty”. I mean, do not contains any enumerable properties. Assuming we have an object:
var obj = {};
Then we can use:
if(JSON.stringify(obj) == '{}'){
// object is "empty"
}
or
if(Object.keys(obj).length == 0){
// object is "empty"
}
or
var isObjectEmpty = function (obj) {
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
return false;
}
}
return true;
};
if(isObjectEmpty([......]
Read more about post 3 ways to check if object do not contains any properties (is “empty”)
20 April 2013 | Category:
Browsers, Optimizing
| Comments (0)
Why use Expires header?
Expires header tell the browser whether a resource needs to be requested from the source (server), or if it can be fetched from the browser’s cache. When we set an Expires header for a resource, such as all images, JavaScript files, or CSS, or whatever file we want, the browser will store those resources in its cache. The next time the visitor comes back to the page it will load faster, as the browser will already have those contents available in its cache, and will not need to download them from the server.
Benefi[......]
Read more about post Don’t forget about “Expires” header
19 April 2013 | Category:
Browsers, Tools
| Comments (0)
I wanted to changed my UI language of Thunderbird and looked for some solution. I got it. However, there is a nice extension to Thunderbird named “Quick Locale Switcher” which allows you to quickly switch to a different language (User Interface, Spell Checker Dictionary and Website content) in your Mozilla application..
Works very well.
19 April 2013 | Category:
General
| Comments (0)
I like it:
Being a good developer means compromise. It means sometimes doing things one way for one project, and another way for another. It means balancing the needs of your stakeholders with your ideals. Sometimes they’re not always going to match up, but that doesn’t mean you should stomp the ground with your feet and have a tantrum when things don’t go your way.
The real key? Strong opinions, weakly held.
With that alone, you’ll go far.
Source: dlo.me
1 April 2013 | Category:
Tools
| Comments (0)
Sometimes our network connection is too fast for measure eg. “how my website is loaded”. In that case would be good to slow down our download / upload connection and test our loading website using slower connection. I use NetLimiter – Ultimate Bandwidth Shaper which provide me option for download and upload streaming.
Note: above software is designed only for Windows OS.
17 March 2013 | Category:
PHP, WordPress
| Comments (0)
Why script (eg. JavaScript) needs to be put at the bottom of html code is nicely described in article High Performance Web Sites: Rule 6 – Move Scripts to the Bottom. So now I will not explain here why.
Let’s focus on how to move any scripts in WordPress to the bottom of html code. Let’s say we want to move mycode.js file (which is located in /js/ directory in our theme directory) with our code that depend on jQuery in our WordPress theme. Open header.php and insert the code just before any html code:
and also in footer.php just befor[......]
Read more about post Moving jQuery and other script code to the bottom of html code in Worpdress
Older Posts »