Create Global gitconfig and Setup git alias

Developers using GIT as their Source Version Control know the troubles in setting it up for new projects. Getting more productive needs setting up of user credentials, alias’ and other git configurations for every new project. But what if you could have a global git configuration to avoid redundant tasks? That’s where global gitconfig comes in. Git does not automatically create the global .gitconfig file during installation. This file is …read more

Top 15 Commonly Used Regex

Regular Expressions aka Regex are expressions that define a search pattern. They are widely used for validation purposes, like email validation, url validation, phone number validation and so on. Forming Regex: A regex is written between two forward slashes (/) delimiters. These delimiters are essential only for certain Regex engines (JS,PHP..). It is then followed by 2 flags: i : Ignore case Flag, ignores the case(uppercase/lowercase) of the input string …read more

Smart search using Twitter Typeahead and Bloodhound

One of the basic things users would want to do, is search the content on a website. Having a crisp, fast and smart search that displays suggestions as one types, is something that everyone would love to have on their website! The twitter typeahead library does just that! And when typeahead is used in conjunction with Bloodhound, it makes the the search experience even better! But…. What exactly is Bloodhound? …read more

Creating click to call, click to sms links

Almost every developer is pretty familiar with the mail-to scheme to send an email via a link. Today I would like to introduce two less used schemes – click to call and click to sms that will allow your users to call or sms using a link. These schemes are fully supported by all the modern browsers. Before diving deep into the know-how’s, lets go over the format for 1. …read more

13 Killer Ways to Center elements with CSS

Designers seem to be troubled time and again while centering items in their layout. Well, no more! There are several ways to center items, be it horizontally or vertically or both, of which I present 13 unique ways categorically and in order of their simplicity. Center elements Horizontally Centering elements horizontally is a fairly easy thing to do. It can be done in 3 ways: 1. Using text-align:center; for Inline …read more

File permissions mode 0777 vs 777

If the question Whats the difference between 0777 vs 777 file modes? runs through your mind, you’re not alone. Lets find out… A bit of history, I needed to create a directory (using Php). So as per the syntax of mkdir(), I used mkdir(‘/path/to/create/dir’, 777); where the 2nd passed parameter is the file mode. Normally, this should have worked fine and uploading any file to this folder should have worked …read more

How to recover from a Frozen MAC ?

Mac OS is usually quite stable and not prone to a system crash, yet seldom it does get stuck/frozen. Lets check out what can you do to recover from your frozen MAC without having to electrically reboot. Force Quit an application In the Dock, right click the offending application and select quit. If that doesn’t work, Ctrl + click the offending App, and then Hold Option That should turn the …read more

Exclamation mark before a function aka IIFE

Immediately-Invoked Function Expression (IIFE) If you ever happen to look at any of code generated using build tools like Webpack or any other Minification/Uglification tool, you may have encountered an exclamation mark before a function only to wonder what it exactly does ? Well, in short, that exclamation mark converts the function into an Immediately-Invoked Function Expression (IIFE). Now what exactly is an IIFE ? As the full-form indicates, it …read more

Whats a Double arrow in javascript

What do the operators “>>” (double arrow) and “|” (single pipe) mean in JavaScript? If that’s the question that runs through your mind, then you are at the right place to discover Bitwise operators. 1. The Right Shift Operator >>(double arrow) Shifts x in binary representation y (< 32) bits to the right, discarding bits shifted off. Or more simply x >> y means to shift the bits of x …read more

JS File Upload with Dropzone and Symfony

Handling File Uploads completely server-side (especially with Symfony) doesn’t usually seem a pretty straightforward task. It requires a lot of tweaking for stuff as simple as displaying the upload progress or even generate thumbnails for images, etc. Besides, the documentation is pretty convoluted in itself. An alternate is to use the simplicity of JS File Upload with Dropzone and Symfony 3.x+ that’ll not only help fast-track development but also avoid …read more