This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @params string - a string containing a file name | |
// @return string - the file extension (with no period) if it has one, otherwise false | |
function getFileExtension(string) { | |
if (typeof(string) === 'string' && (string.indexOf(".") !== -1)){ | |
var dot=string.indexOf("."); | |
return string.substring(dot+1, i.length) | |
} else { | |
return false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* static - default | |
* fixed - scrolls with the page | |
* absolute - top left is starting point | |
* relative - same as absolute, but starting from static position; Parent elements remain as they are. | |
* inherit - not well for older IE | |
*/ | |
body { | |
background: #f6f6f6; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Fluid box with inner box on the bottom in the middle</title> | |
<style type="text/css"> | |
.outer { | |
background: #ccc; | |
border: 1px solid red; | |
position: relative; | |
height: 250px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Form Class | |
* | |
* Responsible for building forms | |
* | |
* @param array $elements renderable array containing form elements | |
* | |
* @return void |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Start this script at newly installed Ubuntu 12.04 LTS | |
# The script will install all necessary software for setting up a web development environment | |
# | |
# Ubuntu fixes | |
# - Install the package to fix missing skype icon on toolbar | |
# | |
# LAMP environment | |
# - apache2 | |
# - php5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Validates if the input for password field matches requirements for password strength | |
* @returns {void} | |
*/ | |
function validatePassword() { | |
var inputValue; | |
var requirement = new RegExp("(^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[@#$%*]).{8,}$)"); | |
// clear previous | |
jQuery(".reg-validate-message").remove(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Validates if the input for email field matches requirements and if it's a valid email | |
* @returns {void} | |
*/ | |
function validateEmail() { | |
var inputValue; | |
// clear previous | |
jQuery(".reg-validate-email").remove(); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<!--[if lt IE 7 ]> <html dir="ltr" lang="en-US" class="no-js ie6"> <![endif]--> | |
<!--[if IE 7 ]> <html dir="ltr" lang="en-US" class="no-js ie7"> <![endif]--> | |
<!--[if IE 8 ]> <html dir="ltr" lang="en-US" class="no-js ie8"> <![endif]--> | |
<html lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7" /> | |
<title>Resizable user info bar</title> | |
<style type="text/css"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* equivalent to li:nth-child(1) */ | |
#mainNav ul li:first-child a { | |
background: #1b77af; | |
width: 236px; | |
text-align: center; | |
margin-right: 10px; | |
} | |
/* equivalent to li:nth-child(2) */ | |
#mainNav ul li:first-child + li a { | |
background: #33a0ff; |
OlderNewer