Determine Snippets

11 May, 2017   

The following code uses bitwise operators to determine if an unsigned integer, x, is a power of two.

12 February, 2015   

JS sniffer detects browser and OS.

08 October, 2014   

JavaScript code to detect browser and OS.

02 August, 2014   

JavaScript code to detects browser and OS

This will return the number of seconds between now and when the time field was inserted.

09 November, 2013   

Use this snippet to determine the size of an open window. Can be used in many different situations, e.g., for setting the size of a div.

30 August, 2011   

This snippet to show how to use the Last-Modified and the ETag header to optimize the caching of a website. If used correctly this will speed up your page loads.

The .NET Framework doesn't support automatic detection of character encoding in the default file I/O methods. This is a quick function that returns True in the specified file is Unicode.

Example code for a short BubbleSort algoritm for Integer Arrays

Java code example to create thumbnail of an image

26 December, 2011   

Allows for the creation of calendars in HTML pages

Two objects are included here, a reader and a parser. All you need to do is instantiate the xmlParser object and let it do the job for you. nextToken() will return the next token, which can be a tag or the text between 2 tags. the isTag() will determine if this is a tag so you can do something smart with it. Lastly you can jumpTo($tagname) if...

21 December, 2013   

Great page for testing the style guide for a website.