Techy Things

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...

No package 'pciaccess' found 0

No package 'pciaccess' found

checking whether /usr/bin/gcc -std=gnu99 supports -Winline... yes checking whether /usr/bin/gcc -std=gnu99 supports -Wshadow... yes checking which warning flags were supported... -Wall -Wextra -Wsign-compare -Werror-implicit-function-declaration -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wpacked -Wswitch-enum -Wmissing-format-attribute -Wstrict-aliasing=2...

Boost CPU to max speed on Linux/CentOS 0

Boost CPU to max speed on Linux/CentOS

As I was filling up a ticket and pasting my /proc/cpuinfo I realized my CPU were running at 800MHz Solution $> sudo nano /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor It will repeat for each of your Core. Is it useful...

[SOLVED] Adding epel repo to Centos 6.8 0

[SOLVED] Adding epel repo to Centos 6.8

$> su - $> yum update # optional but recommanded $> rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org $> rpm -Uvh https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm  

Install OpenVPN on CentOS 6.8 0

Install OpenVPN on CentOS 6.8

1. Install EPEL Repo http://tech.yipp.ca/linux/adding-epel-repo-centos-6-8/ 2. Install openvpn $> sudo yum install openvpn 3. Find the proper configuration, run VPN client using this command $> sudo openvpn --config myconfig.conf  

Unit tests in Ruby on Rails 0

Unit tests in Ruby on Rails

How to write and run your first unit test for your ruby on rails webapp Fist time setup $ rake db:test:load This will recreate a new test DB based ont the current schema! Tasks...