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 Graph = function () { | |
this.vertices = {}; | |
this.edges = []; | |
this.length = 0; | |
}; | |
Graph.Vertex = function (name, value) { | |
this.name = name; | |
this.edges = []; | |
this.value = value; |
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
/** | |
* Tests whether a path is a directory or possibly a file reference. | |
* | |
* @param {string} path | |
* @returns {boolean} | |
*/ | |
isUnixDirectory: function (path) { | |
return (/(^\.+$)|(\/$)/).test(path); | |
} |
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
/** | |
* This function ensures that the event object always has pageX and pageY irrespective of the | |
* browser. Older IE browsers do not support pageXY. | |
* | |
* @param {MouseEvent} event | |
* @returns {MouseEvent} This function updates the events `pageX` and `pageY` properties when | |
* they're missing and also returns the same event for the sexy programming styles. | |
*/ | |
var getEventCoordinate = (function () { | |
var PAGEX = 'pageX', |
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
/** | |
* Get layerX and layerY of an event across all browsers without | |
* using the deprecated layerX of webkit. | |
* It stores `targetX` and `targetY` in the event, to act like `layerY` | |
* and `layerY` respectively. | |
*/ | |
getElementPosition = (function () { | |
var body = window.document.body || window.document.documentElement; | |
return function (event) { |
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
echo -n "ACT Data Usage Info:"; | |
# Fetch Url, locate line with quota and remove HTML tags | |
curl --silent --url "http://portal.acttv.in/index.php/mypackage" | grep 'Quota' | sed -e 's/<[^>]*>//g' -e 's/\ /\ /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 getClipboardDataAsText = (function () { | |
if (window.clipboardData && window.clipboardData.getData) { // Browsers with global handler | |
return function () { | |
return window.clipboardData.getData('Text') || E; | |
}; | |
} | |
// For event specific paste supported browsers | |
return function (referenceEvent) { | |
return e.clipboardData && e.clipboardData.getData && e.clipboardData.getData('text/plain') || E; | |
}; |
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
/** | |
* Check whether an object is Array or not | |
* @type Boolean | |
* @param {object} subject is the variable that is | |
* tested for Array identity check | |
*/ | |
var isArray = (function () { | |
// Use browser's own `isArray` when available | |
if (Array.isArray) { | |
return Array.isArray; |
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
aws ec2 associate-address --instance-id $1 --public-ip $(aws ec2 allocate-address --output text --query 'PublicIp') |
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
/** | |
* Returns unique GUID on every call as per pseudo-number RFC4122 standards. | |
* | |
* @type {function} | |
* @returns {string} | |
*/ | |
module.exports = (function() { | |
var E = '', | |
H = '-', |
OlderNewer