Get Random rows in Doctrine

Every Php Symfony developer knows the struggle of getting random rows/records via Doctrine. This is because there is no native solution present and quite unfortunately, the doctrine team isn’t even willing to implement this feature! (Reference) So how could we get random rows/objects? Lets go over the possible options, each having its advantages & disadvantages : 1. Add a customized Numeric Function: To do this, define a new class in …read more

What to do when Ubuntu Freezes/Crashes?

All operating systems freeze sometimes, and Ubuntu is no exception. It so happens that when Ubuntu Freezes, all you’re left with is a blank screen or a non-working mouse/keyboard or perhaps you have a particular program that has crashed/frozen. What could you do to debug and regain control before you decide to pull the plug and restart all over? Does a magic combination like Ctrl + Alt + Delete exist …read more

Demystifying Promises vs Callbacks

Aren’t Promises just regular Callbacks? What are the pros/cons of using one over the other? Promises vs Callbacks? Questions like these bothering you? Not anymore! Before we actually go dive in deeper, lets quickly remind ourselves the basic definitions of these terms and what they are meant to accomplish. Callbacks: A Callback is a any function which is passed as a parameter to another function and is invoked/executed only after …read more

Autocomplete using Live Templates

During development, isn’t it several 100 times that we need to print something on the screen? (Maybe just to check the flow of execution, especially with the advent of modular development?) Well, we end up typing the same syntax over and over again. Certainly we could do a copy-paste each time but even then you’d need to type the whole thing the first time at least! and the effort involved …read more

Setup Git prompt step by step

While using GIT, isn’t it pretty often that you need to keeping checking what branch you are currently on, or if there is stashed content or not, or if you are ahead/behind of the remote repository and so on ? How about we got this information without having to do a git status or a git stash show each time? Git Prompt to the Rescue! Git prompt helps save precious …read more

Create a Global gitignore

Each time you set up a project, there’s that dreaded repetitive task of creating a new .gitignore file and adding in all the same files/directories that need to be ignored. This sometimes can get pretty tedious. There are OS-generated files (like .DS_Store, Thumbs.db) or IDE-generated files (like .idea/)  that will always clutter up your repository structure. You could also have dependencies like node_modules, built resources like .dll, .so or even logs …read more

Top Fascinating Uses of the Spread Operator

The Spread Operator ES2016 brings us many many goodies, one of which I came across a couple of days ago is the Spread Operator. I have become a big fan of it, not just because of its utility but also as it helps me to shorten my code. So what is it exactly? Simply put, the spread operator allows an expression(that could be an array/object) to be expanded in places …read more

Hello Coders!

Today, while I was at work, as I was researching about some coding issue online, I realised that there are still so many many things to learn and so many more that aren’t well documented or perhaps documented at all. So, after long hours of thinking, finally I have decided to start writing about my coding experiences. I think this will not only help me to always have a place …read more