Posts

Showing posts from May, 2015

missing mcrypt – Fatal Error: Undefined function mcrypt_encrypt()! in Ubuntu 13.10/14.04

I came across this problem when I upgraded my Ubuntu to 14.04. I have used php-mycrypt in one of my project which was working fine until my ubuntu got upgraded and now when I try to access my project I get this Fatal Error Fatal Error: Undefined function mcrypt_encrypt() The solution looks simple but it took me ages to figure out and after a lot of googling around (most of the solution provided didn't help me at all ) so I thought I will share this hoping that you guys end up here quickly and don't have to spend much of your time (like I did ) :):) and hoping this will help you guys. So, without wasting much of your time. Let me begin, First thing to do is see if you have installed php5-mcrypt (like everyone does), you can do that by: sudo apt-get install php5-mcrypt It should install mycrypt and if already installed, you will get the following message: Reading package lists... Done Building dependency tree Reading state information... Done php5-mcrypt is alre

jQuery Best Pratices

 jQuery Files a) Try to use Jquery CDN where possible.                  <script type= "text/javascript"   src= "//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js" ></script> <script>window.jQuery || document.write( '<script src="js/jquery-2.1.1.min.js" type="text/javascript"><\/script>' )</script>     Implement a fallback to locally hosted jQuery file of same version in-case CDN is not working.(as above)  b) DO NOT use jQuery version 2.x if you support Internet Explorer 6/7/8. c) If you are using other libraries like Prototype, MooTools, Zepto etc. that uses `$` sign as well, try not to use `$` for calling jQuery functions and instead use `jQuery` simply or use `$.noConflict()`.    jQuery Variable a) Better to start with  `$`  while  naming jQuery variable so it will be easy to understand and later on manipulate. var $someDiv = $( "#someDiv" );  //