This file contains hidden or 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
function findValueThenRemove(value){ | |
var a = ['a','b','c','d']; | |
for(var i = 0 ; i<= a.length-1;i++){ | |
if(a[i] === value){ | |
a.splice(i,1); | |
} | |
} | |
alert(a); | |
} | |
findValueThenRemove('b'); |
This file contains hidden or 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
<script> | |
// Hides mobile browser's address bar when page is done loading. | |
window.addEventListener('load', function(e) { | |
setTimeout(function() { window.scrollTo(0, 1); }, 1); | |
}, false); | |
</script> | |
This file contains hidden or 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 | |
$indicesServer = array('PHP_SELF', | |
'argv', | |
'argc', | |
'GATEWAY_INTERFACE', | |
'SERVER_ADDR', | |
'SERVER_NAME', | |
'SERVER_SOFTWARE', | |
'SERVER_PROTOCOL', | |
'REQUEST_METHOD', |
This file contains hidden or 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
// Pig Latin Translator Project | |
// Created By Faris Rayhan | |
// Copyrgiht 2014 | |
// This function will add the string at the end of string which begin by vocal with "-way" | |
// If begin with consonant the consonant word will be moved at the end of string plus "ay" |
This file contains hidden or 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
/** | |
* Strength Password Class | |
* | |
* Build with full of the love | |
* | |
* Faris Rayhan | |
* | |
* Copyright 2014 | |
*/ |
This file contains hidden or 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
<script> | |
/** | |
* Checktime class | |
* | |
* Faris Rayhan 2014 | |
* | |
* Profitable when dealing with time scope | |
* | |
* @param {Year} as number | |
* @param {Month} as number |
This file contains hidden or 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
//********************************// | |
//********Email Validation********// | |
//********************************// | |
//***************************************************// | |
//********Plese read instruction before using********// | |
//***************************************************// | |
//*This is simple email validation function accept one arguments using regular expression*// |
This file contains hidden or 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
//*************************************************************// | |
//***************************JS CAPTCHA************************// | |
//*************************************************************// | |
//*************************************************************// | |
//*****************Please Read Carefully Before Using**********// | |
//*************************************************************// | |
//This my way when dealing with captcha | |
//I use help of Jquery so you should include jquery at first |
This file contains hidden or 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
//*****************************************************************// | |
/*getRandomint function to return random number in range min and max you supply*/ | |
/*very useful for me when building captcha*/ | |
//*****************************************************************// | |
function getRandomInt (min, max) { | |
return Math.floor(Math.random() * (max - min + 1)) + min; | |
} |
This file contains hidden or 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
//Trim function i usually use this to dismiss space either in the front , back , or middle | |
//very useful when dealing with email input so no space is exist | |
/*this is alternative way , whether you want to use keypress validation that just allow number , character , space , an , backspace | |
its up to you*/ | |
//**********************************// | |
//***********TRIM FUNCTION***********// | |
//**********************************// | |
function trim(str){ | |
return str.replace(/^\s+/g,"").replace(/\s+/g,"") |
NewerOlder