Django error message: [“’on’ value must be either True or False.”]

Reading Time: < 1 minutes This error occurs in multiple use cases, the following is one use cases which i faced, The usecase is when you use custom user model, and you are creating the migrations from the beginning on a new database, Django will not allow createsuperuser on the custom model. You can follow this simple solution to solve […]

Pass by reference in PHP

Reading Time: < 1 minutes In PHP you can pass a variable to a function as reference. When you do that actual “Memory address is passed” instead of “A Copy of the value” hence any change you make inside the function will reflect even after the outside after the function is executed. Note: You give & (ampersand) before the variable […]

PHP Fatal error: Uncaught Error: Using $this when not in object context in file.php

Reading Time: < 1 minutes As per php documentation, Because static methods are callable without an instance of the object created, the pseudo-variable $this is not available inside methods declared as static. https://www.php.net/manual/en/language.oop5.static.php In the above code snippet, static method getValue() will throw the error this is the same use case. Things to be noted in Static Method and Static Variable: Static […]

Awesome Quotes

Reading Time: 3 minutes “The best way to predict the future is to invent it.” – Alan Kay “People who are really serious about software should make their own hardware.” – Alan Kay “The only way to do great work is to love what you do.” – Steve Jobs “He not busy being born is busy dying.” – Bob Dylan “History is always […]

How do I redo a git merge

Reading Time: < 1 minutes When you have merge conflict in your code and you get No files need merging when you run `git mergetool` Solution: Do git reset –hard # You are not going to loose any changes all your code would be committed by now. However you will have a clean working dir ready to do the merging. […]