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> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1"/> | |
<title>jQuery Device Orientation</title> | |
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> | |
<script> | |
$.noConflict(); |
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 TO GRAB EMAILADRESSE FROM ANY PLAINTEXT | |
* @param text | |
* @returns {*|Array|{index: number, input: string}} | |
*/ | |
var getEmail = function(text) { | |
return text.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi); | |
} |
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 findUrls( text ) | |
{ | |
var source = (text || '').toString(); | |
var urlArray = []; | |
var url; | |
var matchArray; | |
// Regular expression to find FTP, HTTP(S) and email URLs. | |
var regexToken = /(((ftp|https?):\/\/)[\-\w@:%_\+.~#?,&\/\/=]+)|((mailto:)?[_.\w-]+@([\w][\w\-]+\.)+[a-zA-Z]{2,3})/g; |
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 testurl = http://www.test.com:8082/index.php#tab2?foo=123 | |
// In Javascript: | |
window.location.host www.test.com:8082 | |
window.location.hostname www.test.com | |
window.location.port 8082 | |
window.location.protocol http | |
window.location.pathname index.php |
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
$('a[href$="ABC"]').foobar(); | |
// http://docs.jquery.com/Selectors | |
// For attributes: | |
// = is exactly equal | |
// != is not equal | |
// ^= is starts with | |
// $= is ends with |
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 BrowserDetect = { | |
init: function () { | |
this.browser = this.searchString(this.dataBrowser) || "Other"; | |
this.version = this.searchVersion(navigator.userAgent) || this.searchVersion(navigator.appVersion) || "Unknown"; | |
}, | |
searchString: function (data) { | |
for (var i = 0; i < data.length; i++) { | |
var dataString = data[i].string; | |
this.versionSearchString = data[i].subString; |
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
# Compiled source # | |
################### | |
*.com | |
*.class | |
*.dll | |
*.exe | |
*.o | |
*.so | |
# Packages # |
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
# tar directory | |
tar -czvf Output_File_Name.tar.gz Directory_Name | |
tar -zcvf demo.tar.gz demo | |
# which will create a tar file named "demo.tar.gz" | |
# to untar directory | |
tar -xzvf Input_File_Name.tar.gz |
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
// Numeric only control handler | |
jQuery.fn.ForceNumericOnly = | |
function() | |
{ | |
return this.each(function() | |
{ | |
$(this).keydown(function(e) | |
{ | |
var key = e.charCode || e.keyCode || 0; | |
// allow backspace, tab, delete, enter, arrows, numbers and keypad numbers ONLY |
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
/** | |
* @param $prefix | |
* @param $suffix | |
* @param $size | |
* | |
* @return string | |
*/ | |
private function randomKey($prefix, $suffix, $size) | |
{ | |
$key = ""; |
OlderNewer