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
for i in `git branch -a | grep remote | grep -v HEAD | grep -v master`; do git branch --track ${i#remotes/origin/} $i; done |
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
const print = (obj, log=true) => { | |
let tab = ` `; | |
let tabs = [tab]; | |
let output = ''; | |
const quotify = (value) => typeof value === 'string' ? `"${value}"` : value; | |
const _print = (_obj) => { | |
let output = ''; | |
for (let prop in _obj) { | |
if (!_obj.hasOwnProperty(prop)) continue; |
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
#!/bin/bash | |
service=replace_me_with_a_valid_service | |
if (( $(ps -ef | grep -v grep | grep $service | wc -l) > 0 )) | |
then | |
echo "$service is running!!!" | |
else | |
/etc/init.d/$service start | |
fi |
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 . -name "*.html" -exec bash -c 'cp "$1" "${1/.html/.htm}"' -- {} \; |
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 . -name '*.scss' -exec bash -c 'mv "$1" "${1/.scss/.less}"' -- {} \; |
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 getURLParams () { | |
var params = []; | |
window.location.search.substring(1).split("&").every(function (pair){ | |
var obj = {}; | |
pair = pair.split("="); | |
obj[pair[0]] = pair[1]; | |
params.push(obj); | |
}); | |
return params; | |
} |
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
{"result":"true","errors":[],"data":[["{\"1\":[{\"0\":\"Hunky\"},{\"1\":\"Male\"}],\"2\":[{\"0\":\"Dory\"},{\"1\":\"727455767\"}]}",null,"{\"1\":[],\"2\":[]}"]],"fields":{}} |
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 /> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
</body> | |
</html> |
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
// Replaces all instances of the given substring. | |
String.prototype.replaceAll = function(strTarget, strSubString) | |
{ | |
var strText = this; | |
var intIndexOfMatch = strText.indexOf( strTarget ); | |
// Keep looping while an instance of the target string | |
// still exists in the string. | |
while (intIndexOfMatch != -1){ | |
// Relace out the current instance. |
NewerOlder