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
function validateEmail(e){var t=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return t.test(e);} | |
if(validateEmail($('#emailinput').val())){ | |
// do something | |
} |
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
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ){ | |
// do something for mobile browsers | |
} |
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
function fb_share(url,tittel) {u=url;t=tittel;window.open('https://www.facebook.com/sharer/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');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
var intMax = 140; | |
$('textarea').live('keydown blur' , function(){ | |
var innerhtml = $(this).val(); | |
if(innerhtml.length >= intMax ){ | |
$(this).val( innerhtml.substring(0,intMax) ); | |
} | |
}); |
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
function validate(evt) { | |
var theEvent = evt || window.event; | |
var key = theEvent.keyCode || theEvent.which; | |
key = String.fromCharCode( key ); | |
var regex = /[0-9]|\./; | |
if( !regex.test(key) ) { | |
theEvent.returnValue = false; | |
if(theEvent.preventDefault) theEvent.preventDefault(); | |
} | |
} |
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 | |
function formatUrlsInText($strInput){ | |
$strInput = ereg_replace( "www\.", "http://www.", $strInput ); | |
$strInput = ereg_replace( "http://http://www\.", "http://www.", $strInput ); | |
$strInput = ereg_replace( "https://http://www\.", "https://www.", $strInput ); | |
$reg_exUrl = "/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/"; | |
preg_match_all($reg_exUrl, $strInput, $matches); | |
$usedPatterns = array(); | |
foreach($matches[0] as $pattern){ |
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
<style> | |
.spin { | |
border: 8px solid rgba(0, 0, 0, .1); | |
border-top: 8px solid rgba(100, 0, 0, .4); | |
border-radius: 100%; | |
height: 20px; | |
width: 20px; | |
animation: rot 1s infinite linear; | |
} |
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
try{ FB.XFBML.parse(); }catch(ex){} |
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
var mLock = true; | |
$(window).scroll(function(){ | |
if (document.body.scrollHeight <= document.body.scrollTop + window.innerHeight + 90 ){ | |
if(mLock){ | |
mLock = false; | |
doSomeFunction(); | |
} | |
} | |
}); |
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 | |
// https://mysecureserver.com/path_to_this_script/?url=[base64 encoded image link]* | |
$file = base64_decode(@$_GET['url']); | |
$aFile = end(explode('.' , $file)); | |
if($aFile == 'jpg' or $aFile == 'jpeg'){ | |
header('Content-Type: image/jpeg'); | |
}elseif($aFile == 'png'){ | |
header('Content-Type: image/png'); | |
}elseif($aFile == 'gif'){ |
OlderNewer