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
git remote -v | |
git remote set-url origin new_url_to_repo.git |
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
sudo docker ps -a | grep Exited | cut -d ' ' -f 1 | xargs sudo docker rm |
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
sed -i 's/replacementString/stringToReplace/g' /path/to/filename |
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
fetch(url) | |
.then(response => response.json()) | |
.then(data => console.log(data)) | |
.catch(err => console.log(err)) |
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
git diff --name-only master | xargs cat | grep "keyword" |
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
kill $(ps aux | grep SEARCH_PATTERN | awk '{print $2}') |
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
eval $(cat ~/.bash_history | grep curl | head -1 | awk '{print}') |
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 findKey(obj, predicate) { | |
for (var prop in obj) { | |
if(obj.hasOwnProperty( prop ) ) { | |
if (predicate(obj[prop])) { | |
return prop; | |
} | |
} | |
} | |
} |
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 the querystring key value pairs | |
// eg. http:www.example.com/document?a=1&b="2"&c=JavaScript_%D1%88%D0%B5%D0%BB%D0%BB%D1%8B | |
// will return {a: "1", b: "2", c: "JavaScript_шеллы"} | |
var params = (function getURLParams(qs) { | |
var pairs = {}; | |
qs.forEach(function(param) { | |
var pair = param.split('='); | |
pairs[pair[0]] = decodeURIComponent(pair[1].replace(/\"/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
function maybe(fn) { | |
return function () { | |
var args = Array.prototype.slice.call(arguments); | |
if (!args.length) { | |
return; | |
} | |
for (var index = 0, length = args.length; index < length; index += 1) { | |
if (args[index] == null) { | |
return; | |
} |