Monthly Archive: May 2017

npm not found when under sudo 0

npm not found when under sudo

[dev@squarepants www]$ sudo npm install -g bbb sudo: npm: command not found Solution You have probably like me installed node with nvm (node version manager). This installs node locally for the user and root...

jQuery prevent uploading too large file in Frontend 0

jQuery prevent uploading too large file in Frontend

afterRender:       // Only works on HTML5       $('#file').on('change', function() {         $("#upload-package").prop("disabled",  false);         var sizeLimit = 90;         if (this.files && this.files.length && this.files[0].size > sizeLimit*1024*1024) {           notifier.error_x("File size exceeds limit...

Mousewheel prevent body scroll on modal 0

Mousewheel prevent body scroll on modal

Solution #1   // prevent background of modal from scrolling   // DOMMouseScroll for Firefox equivalent   $(document).on("mousewheel DOMMouseScroll", ".modal-backdrop, .modal-body", function(event) {     event.stopPropagation();     event.preventDefault();   });   // prevent background of...

Build a Slim PHP 3 webapp with social logins and emails 0

Build a Slim PHP 3 webapp with social logins and emails

Prerequisites PHP 5.6+ Edit php.ini always_populate_raw_post_data = -1 Uncomment extension=php_curl.dll extension=php_mbstring.dll extension=php_mysql.dll extension=php_mysqli.dll extension=php_pdo_mysql.dll extension=php_openssl.dll Composer Linux> curl -sS https://getcomposer.org/installer | php Windows> Download & Install Composer-Setup.exe Development Cycle Windows> php -S 127.0.0.1:8080 -t...