Skip to content

Instantly share code, notes, and snippets.

View manu's full-sized avatar

Manu K Subramanian manu

View GitHub Profile
@manu
manu / nullconsole.js
Last active September 29, 2016 06:17
In heroku dyno console functions are very costly. Thanks to Michel for helping me to identify this http://micheljansen.org/blog/entry/1698. Prepended the following lines in app.js and it increased the speed of the app very much.
/*
* Add this as first line to app.js speed up Heroku nodejs application
*/
if (process.env.NODE_ENV === 'production') {
var nullfun = function () {};
console.log = nullfun;
console.info = nullfun;
console.error = nullfun;
console.warn = nullfun;
}
@manu
manu / cover.php
Last active December 23, 2015 12:18
php code to cover the application from public view while in the development stage
<?php
/*
* To protect the application from public view
* include the file in the first line of your index.php
*/
$coverkey = 'yourprotectionkey';
if (!$_COOKIE['coverkey'] == $coverkey) {
if ($_POST['key'] == $coverkey) {
setcookie('coverkey', $coverkey);
} else {