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 Linux | |
Just run these two lines and you are good to go*/ | |
sudo apt-get install libcap2-bin | |
sudo setcap cap_net_bind_service=+ep `readlink -f \`which node\`` |
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
chown -Rf www-data:www-data <path-to-wordpress> |
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 netstat -nlp | grep :<port> |
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
<html class=""><head> | |
<style class="cp-pen-styles">body{ | |
text-align: center; | |
background: lightgrey; | |
font-family: sans-serif; | |
font-weight: 100; | |
} |
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
//SCDGE : Selector of Container containing dynamically generated element | |
//SDGE : Selector of Dynamically Generated elements | |
jQuery(<SCDGE>).on('focus',<SDGE>,function () { | |
var footerHeight = 200; //footerHeight = footer height + element height + buffer | |
var element = $(this); | |
if (element.offset().top - ($(window).scrollTop()) > ($(window).height() - footerHeight)) { | |
$('html, body').animate({ | |
scrollTop: element.offset().top - ($(window).height() - footerHeight) | |
}, 500); |
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
//Usage | |
//jsonSearch(jsonArray,{'key':'value}) | |
var jsonSearch = function(json_array,needle){ | |
return json_array.map(function(d) { return d[Object.keys(needle)[0]]; }).indexOf(needle[Object.keys(needle)[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
[ng\:cloak], | |
[ng-cloak], | |
[data-ng-cloak], | |
[x-ng-cloak], | |
.ng-cloak, | |
.x-ng-cloak { | |
display: none !important; | |
} |
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
$scope.safeApply = function(fn) { | |
var phase = this.$root.$$phase; | |
if (phase == '$apply' || phase == '$digest') { | |
if (fn && (typeof(fn) === 'function')) { | |
fn(); | |
} | |
} else { | |
this.$apply(fn); | |
} | |
}; |
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
$data = file_get_contents("php://input"); |
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 addCommas = function(nStr) { | |
nStr += ''; | |
x = nStr.split('.'); | |
x1 = x[0]; | |
x2 = x.length > 1 ? '.' + x[1] : ''; | |
var rgx = /(\d+)(\d{3})/; | |
while (rgx.test(x1)) { | |
x1 = x1.replace(rgx, '$1' + ',' + '$2'); | |
} | |
return x1 + x2; |
OlderNewer