Skip to content

Instantly share code, notes, and snippets.

View azeemhassni's full-sized avatar

Azeem Hassni azeemhassni

View GitHub Profile
@azeemhassni
azeemhassni / MinutesToTimeString.php
Created June 19, 2014 10:26
Convert Minuts to Time String
<?php
function timeToString($time) {
$t = $time / 60;
$t = number_format($t, 2);
// Result 1.5;
$__t = explode('.', $t);
$m = "0.".$__t[1];
$m * 60;
$m = $m*60;
@azeemhassni
azeemhassni / wp_is_tmpl.php
Last active August 29, 2015 14:02
Recognize wordpress template .
<?php
/**
* @param : $template_name
* @Author : Azi Baloch
* Description : this function will recognize that is the wordpress current page
* using N template or not .
* eg . i want to add body id depending on template then i can use this function
* to check the currently being used template
**/
@azeemhassni
azeemhassni / script.js
Last active August 29, 2015 14:01
Email Validation Regular Expression
// ^([0-9a-zA-Z\._])+@([a-zA-Z0-9])+\.([0-9A-Za-z]){2,4}([\.a-zA-Z0-9]){0,3}+$
// example : (jQuery) Javascript
function validateEmail(email){
var pattren = new RegExp("^([0-9a-zA-Z\._])+@([a-zA-Z0-9])+\.([0-9A-Za-z]){2,4}([\.a-zA-Z0-9]){0,3}+$");
if(pttren.test(email)){
return true;
} else