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
path=$1 | |
user=$2 | |
host=$3 | |
cat $1 | ssh $2@$3 'cat>> ~/.ssh/authorized_keys' |
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
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d;/^linux-\(headers\|image\)/!d' | |
after this command remove the listed packages with: | |
sudo apt-get -y purge <package> |
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 parseUrl(uri) { | |
// @source http://jsperf.com/url-parsing/34 | |
var matches = /^(((([^:\/#\?]+:)?(?:(\/\/)((?:(([^:@\/#\?]+)(?:\:([^:@\/#\?]+))?)@)?(([^:\/#\?\]\[]+|\[[^\/\]@#?]+\])(?:\:([0-9]+))?))?)?)?((\/?(?:[^\/\?#]+\/+)*)([^\?#]*)))?(\?[^#]+)?)(#.*)?/.exec(uri); | |
return { | |
href: uri || '', | |
host: matches[10] || '', | |
hash: matches[17] || '', | |
port: matches[12] || '', | |
origin: (matches[4] || '') + (matches[5] || '') + (matches[10] || ''), | |
search: matches[16] || '', |
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 forEach(list, callback) { | |
var keys = Object.keys(list); | |
var index = -1; | |
var length = keys.length >>> 0; | |
while (++index < length) { | |
callback(list[keys[index]], keys[index], list); | |
} | |
} |
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 forEach(list, callback) { | |
var index = -1; | |
var length = list.length >>> 0; | |
while (++index < length) { | |
callback(list[index], index, list); | |
} | |
} |
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 functionArguments(fn) { | |
if (fn.length > 0) { | |
var fnString = Function.prototype.toString.call(fn); | |
var firstIndex = fnString.indexOf('('); | |
var lastIndex = fnString.indexOf(')'); | |
if (firstIndex > -1 && lastIndex > firstIndex) { | |
firstIndex++; | |
return fnString.substr(firstIndex, lastIndex - firstIndex).replace(/\s+/g, '').split(','); |
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 stacktrace() { | |
var stack; | |
function trace(fn) { | |
return (typeof fn !== 'function') | |
? [] | |
: trace(fn.caller).concat([fn.toString().split('(')[0].substring(9)]); | |
} | |
try { |
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 bind(fn, context) { | |
var givenArguments = []; | |
for (var _i = 2; _i < arguments.length; _i++) { | |
givenArguments[_i - 2] = arguments[_i]; | |
} | |
if (typeof Function.prototype.bind == "function") { | |
return Function.prototype.bind.apply(fn, Array.prototype.concat.apply([context], givenArguments)); | |
} |
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 stacktrace() { | |
var stack; | |
function trace(fn) { | |
return (typeof fn !== 'function') | |
? [] | |
: trace(fn.caller).concat([fn.toString().split('(')[0].substring(9)]); | |
} | |
try { |
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 getFunctionName(fn) { | |
if (typeof fn.name === 'string') { | |
return fn.name; | |
} | |
var fnString = fn.toString(); | |
var firstBracket = fnString.indexOf('('); | |
return fnString.substr(9, (firstBracket - 9)); | |
} |
OlderNewer