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
find . -type f -exec chmod 644 {} \; && find . -type d -exec chmod 755 {} \; |
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
# 1. create rule to limit bandwidth to X kbps | |
sudo ipfw pipe 1 config bw 40KByte/s | |
# 2. enable rule | |
sudo ipfw add 1 pipe 1 src-port 80 | |
# 3. When you're finished, remember to delete the rule to restore your internet connection to normal speed | |
sudo ipfw delete 1 |
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 memoizeTailored (fn, params) | |
{ | |
var cache = (fn.memoize = fn.memoize || {}), | |
stringifyJson, | |
sliceArray; | |
// return original general purpose script if no detail can be provided to cut the memoizer's workload | |
if (!params || !('args' in params) || params.args < 1 || params.args > 3 || params.usesObjects === true) { | |
stringifyJson = JSON.stringify; | |
sliceArray = Array.prototype.slice; |
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
javascript:(function(oSubject){var%20key,arr%20=%20[],obj%20=%20{},i;for%20(key%20in%20oSubject){arr.push([key,%20oSubject[key]]);}arr.sort();for%20(i%20=%200;%20i%20<%20arr.length;%20i++){obj[arr[i][0]]%20=%20arr[i][1];}console.log(obj);}%20(eval(prompt(%27Enter%20reference%20to%20Object%27))));void(0); |
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
/*global _*/ | |
function httpGetUrl (sUrl) | |
{ | |
sUrl = new String(sUrl || window.location.href); | |
var oUrlParams = {} | |
, aSplitUrl = sUrl.split('?') | |
, sUrlRoot = aSplitUrl[0] | |
, sUrlParams = aSplitUrl[1]; |
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 {Function} fAll Delegate for attr(); | |
* @param {Function} fKey Delegate for attr('some_key'); | |
* @param {Function} fCollection Delegate for attr({some_key:'some_value', some_other_key:'some_other_value'}); | |
* @param {Function} fKeyAndValue Delegate for attr('some_key', 'some_value'); | |
* @param {String|Array|Object} accessor A string referring to a key name, an array of key names, or an object of key/value pairs | |
* @param {Mixed} value A value normally used to set a property to | |
*/ | |
function attrPattern (fAll, fKey, fCollection, fKeyAndValue, accessor, 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
if (typeof console == "undefined") | |
{ | |
window.console = { | |
log: function() {} | |
, group: function() {} | |
, groupEnd: function() {} | |
, groupCollapsed: function() {} | |
}; | |
} |
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 utility extends functionObject and is used for hiding a (normally asynchronous) implementation behind chainable methods. | |
* | |
* @augments functionObject | |
* @see functionObject | |
* @returns {Function} | |
* | |
* @example | |
* | |
* // definition |
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 escapedRx (text, flags) | |
{ | |
return new RegExp(text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), flags || ''); | |
} |
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 randomColour () | |
{ | |
return "#" + Math.random().toString(16).slice(2, 8); | |
} |