Skip to content

Instantly share code, notes, and snippets.

View frayhan32's full-sized avatar

Faris Rayhan frayhan32

View GitHub Profile
@frayhan32
frayhan32 / PHPS_SERVER
Created July 20, 2014 09:59
PHP S_SERVER
<?php
$indicesServer = array('PHP_SELF',
'argv',
'argc',
'GATEWAY_INTERFACE',
'SERVER_ADDR',
'SERVER_NAME',
'SERVER_SOFTWARE',
'SERVER_PROTOCOL',
'REQUEST_METHOD',
@frayhan32
frayhan32 / js_strength_password
Last active December 23, 2015 05:49
Strength password
/**
* Strength Password Class
*
* Build with full of the love
*
* Faris Rayhan
*
* Copyright 2014
*/
@frayhan32
frayhan32 / js_check_time
Last active December 23, 2015 04:09
Check time
<script>
/**
* Checktime class
*
* Faris Rayhan 2014
*
* Profitable when dealing with time scope
*
* @param {Year} as number
* @param {Month} as number
@frayhan32
frayhan32 / js_email_Valid
Created September 16, 2013 08:51
Email Validation
//********************************//
//********Email Validation********//
//********************************//
//***************************************************//
//********Plese read instruction before using********//
//***************************************************//
//*This is simple email validation function accept one arguments using regular expression*//
@frayhan32
frayhan32 / js_captcha
Created September 15, 2013 07:43
js_captcha
//*************************************************************//
//***************************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
@frayhan32
frayhan32 / js_trim
Last active December 23, 2015 02:39
Trim Function
//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,"")
@frayhan32
frayhan32 / js_rand_int
Last active December 23, 2015 02:39
Random int
//*****************************************************************//
/*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;
}
@frayhan32
frayhan32 / js_daytot_thismonth
Last active December 23, 2015 02:39
How Many Day This Month
//****************************************************************************//
//************************How many day this month*****************************//
//****************************************************************************//
//****************************************************************************//
//********************Result Also Depend On Your Time Setting System**********//
//****************************************************************************//
function dayThisMonth(year,month){
@frayhan32
frayhan32 / gist:6567300
Last active December 23, 2015 02:29
SORTTABLE FOR JS
//Copyright 2013 FARIS RAYHAN adapted from WROX.com
//No warranty given . Free distributed are encouraged
//Below the sorttable function i usuallay used in my work
//applied exactly on thead of table on event click
//Generally we have 3 associatied function here
/=====================================================/
/1.===============CONVERT FUNCTION ====================/
/=====================================================/
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');