Games Written in HTML5

Flow Free

URL: http://moh97.us/flow/
Chrome extension: https://chrome.google.com/webstore/detail/flow-free/pbnmelddedlommnmllmfhoephaidddmk
Screen Shot:


Chrome Simon

URL: http://simon.moh97.us/
Chrome extension: https://chrome.google.com/webstore/detail/chrome-simon/ljabnknfodmgjpgcjlbhoodfgbfefhgo
Screenshot:

JavaScript: Convert String to Integer (int)

To convert strings (text) to integer (number) in JavaScript use the parseInt function.

For example:

document.write(parseInt("23 years"));

Will return the number 23, the function ignores the string “years” and return the integer 23 only.

Another common example is:





 

If you enter 4 and 5, the script will return “45”  instead of 9.  To fix use the parseInt function as follows:






 

 

Regular Expressions: Remove Links Hashes & Mentions from Tweet

Use this regular expresion to remove URLs (http://…) hashes (#ahash) and mentions (@amention) from Tweets or any other block of text for that matter.

For PHP code use:

/(@|#|http\:\/\/)([a-zA-z0-9\.\/])+/

 

For JavaScript:

^(@|#|http\:\/\/)([a-zA-z0-9\.\/])+$

 

 

CSS: Style Combo Box

There is no easy way to style a combo box using CSS, the best and easiest alternative I found is using the JQuery UI.

JQuery UI is an amazing library that offers many widgets, interactions, effects and styles.

This is a link to a combo box based on the JQuery UI auto complete library:

http://jqueryui.com/demos/autocomplete/#combobox

You can examine the source code of this combo box on this page

http://jqueryui.com/demos/autocomplete/combobox.html

For themes to use with this combo box, chekc this link out:

http://jqueryui.com/themeroller/

Commenting HTML, CSS, PHP, Javascript, SQL & ASP

Use the tags below to enter comments or notes in your HTML, CSS, PHP, JavaScript or ASP code:


Language Single/Multi-Line Start with End with Example

HTML

Single & Multi-Line

<!–

–>

<!– This is an HTML Comment –>

PHP

Single Line

//

// This is a PHP Comment

PHP

Mutli-Line

/*

*/

/* This is

a PHP Comment */

JavaScript

Single Line

//

// This a JScript Comment

JavaScript

Mutli-Line

/*

*/

/* This is

a JavaScript Comment */

CSS

Single & Multi-Line

/*

*/

/*This is a CSS comment*/

ASP

Single & Multi-Line

‘ This is an ASP Comment

SQL

Single & Multi-Line

{

}

{ This is an SQL Comment }

SQL

Single

— (Two dashes)

— This is an SQL Comment