• Mbstring not found error while installing mailparse PHP extension

    Today I had to install mailparse via PEAR. On installing I came across one of the errors: mbstring not found despite of it was right there. One of the simplest option to fix it is given below. Though I am working on MAMP but it will work with anyone since it’s part of PHP Source. Go to your PHP Source Library. In my case it is: /Applications/MAMP/bin/php/php7.0.8/include/php/ext/mbstring/libmbfl/mbfl and add following lines in mbfilter.h #undef HAVE_MBSTRING #define HAVE_MBSTRING 1 and then run PEAR command again pear install pecl/mailparse If all goes well it should give something like: Build process completed successfully Installing '/Applications/MAMP/bin/php/php7.0.8/lib/php/extensions/no-debug-non-zts-20151012/mailparse.so' install ok: channel://pecl.php.net/mailparse-3.0.1 configuration option "php_ini" is not set to…

  • Currently Reading – Chrome extension about social book reading

      I love reading books, in fact lots of books. I’am sure many of you read books as well. Books on different topics and subjects help you to expand the horizon of knowledge and creativity. Often it happens that you extract an idea from a book and you give your own touch in it and produce a product which people love to use. In the age of social media when people love to let others know about their daily activities by updating a status, it ‘s not surprising that there are such social sites available which let your friends know about what you’re reading. Goodreads is one of them which…

  • Online JSON Diff Viewer

    Just came across this awesome tool to compare JSON. Yeah, at time it’s needed to compare them. Check this out(http://json-diff.com/) The thing I like most was the interface.

  • Develop your first Facebook messenger bot in PHP

    (Credit: Independent.co.uk) Facebook recently announced a Bot platform for it’s Messenger which provides businesses and individuals another way to communicate with people. What is a Chat bot? A computer program designed to simulate conversation with human users, especially over the Internet. Chat bot in PHP When I heard of it, my very first thought was to a bot in PHP. I started to find some SDK in this regard released by Facebook but none was present. I headed over to documentation which provided good information for starters. Ok! so without wasting further time, let’s build our first Bot Timebot In order to create an Fb bot you will need two things to…

  • How to remove local git branches?

    If you are working on a project having lots of feature branches, you’d like to remove all of once your deployment is done and all feature branches merge into master.  Following simple command can help you to get rid of them. git branch | grep 'DB-' | xargs git branch -d Here DB- is prefix of your feature branch. So, if you have branches like DB-1, DB-2; it will run grep branch and then grep all strings match DB- and then will remove them. xargs rule!

  • Laravel: How to avoid redirecting to home after login?

    If you are working on a Laravel 5.1 based project and using Auth class for authentication purpose, chances are you would have faced issue of redirecting to home after login. While docs say that you can override the behaviour by setting the $redirectedPath value. Thing is it will still not work. After wasting a reasonable time, I figured out the issue. By default Auth constructor is defined as:   public function __construct() { $this->middleware('guest', ['except' => 'getLogout']); } This middleware actually calls  RedirectIfAuthenticated trait. If you go to definition you will find:   public function handle($request, Closure $next) { if ($this->auth->check()) { return redirect('/home'); } return $next($request); } Hardcoded right.…

  • Tool to make inline CSS

    If you are going to send a CSS-based HTML mail aka Email Templates, chances are you are embedding CSS in <style> tag and end up having a bad experience of not having a properly rendered page. The issue is that web clients like Gmail etc strip markup tags. Specially <head><script> and <style> for security reasons. The only way is left to make HTML content with inline CSS. But.. making inline CSS is a pain in the neck and it’s not easy especially when are now used to making external CSS files or style blocks. Thankfully, Mailchimp provides a tool that takes your CSS and HTML and make it online. Try…

  • Templates in Laravel 5

    This post is part of LxD Series in which I share my learning process about different technologies. Learn more about LxD here. Ok you saw earlier the design we are going to use for our application. Now it’s time to integrate that design in our Laravel 5 application. Before I go further, let me tell directory structure of Laravel to integrate our design.   Layouts are actually part of views hence they reside in views folder. You have option to put all of your layouts within views->layouts folder or manage it better by dividing it into folders based on your site modules. For instance, Admin, Emails, Site etc. For my sake I created…