The principle and practices of software development have always interested me. In this blog, we are going to talk about the first principle of coding that I ever learned about i.e. Don't Repeat Yourself principle.

The DRY principle is stated as “Every piece of knowledge must have a single, unambiguous, authoritative representation within a system” by Andy Hunt and Dave Thomas in their book The Pragmatic Programmer. In DRY code, we do functioning to codes that are repetitive and perform the same task multiple times in your code. …

Pagination is a sequence of pages which have similar content. All sites can’t have all their information on a single page. They may need to use multiple pages for easier navigation, better user experience.

In this blog, we are going to talk about custom pagination on list of dictionaries.

Let us suppose we have list of dictionaries of Employee:

The country is crying, bleeding, and dying with this dire situation from the hit of second wave of Covid 19. This pandemic has brought one sad news after another and we are honestly in dreadful condition. My heart goes out to doctors, nurses and all the health front-liners who are working 24 hrs shift so that we can beat this pandemic. …

Multiple variable assignment, For else loop, Chain comparison, floor() and ceil() functions, inspect object by dir(), reverse string with slice, N strings

7 useful python tips

1. Multiple variable assignment

You can assign values to multiple variables on one line. You can also assign different data type in single line. A simple use case is shown below:

>>> a,b,c = 4, ‘Sonika’, {‘name’:’Sonika’,’lastname’:’Baniya’}
>>> print(a,b,c)
4 Sonika {‘name’: ‘Sonika’, ‘lastname’: ‘Baniya’}

2. For/while else loop

Yes, for else loop. In so many programming language, else statement is restricted to use only with if statement. In python (only for python version 3.X) …

tweet with python script

What do you need to install?

1. Python
2. Tweepy : Tweepy is a python library for accessing Twitter API.
3. Developer account in Twitter


1. Create a test file name in your working directory.

2. Write the following here:

import tweepy# Consumer keys and access tokens from twitter developer console
CONSUMER_SECRET = ‘############’
CONSUMER_KEY = ‘############’
ACCESS_SECRET = ‘#############’
ACCESS_KEY = ‘##############’
# OAuth authentication connection from
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(ACCESS_KEY, ACCESS_SECRET)
# Creation of the actual interface, using authentication
tweet = tweepy.API(auth)
# Write tweet here
tweet.update_status(“Hi from API” )

3.Run the following file by running python command in your working directory and bam, you are done in 8 lines of code.

Git history, GitLens, Waka time, Better Comments, Error Lens, Material Icon Theme, Remote SSH

In this blog, going to share the must-have extensions for beginners. A little background, I am a Software developer and mostly a backend developer but here, I have tried to list some frontend friendly extensions also.

VS Code extensions for beginners

1. Git history

Git is the most widely used Version Control System out of all. Git History is the first extension you must install if you use git as VCS in your project. This extension is majorly used for:

i. view and search git log with details and graph
ii. see history of file…

Git for beginners, a basic concept, git system, familiarization with workflow

git for version control system

How do we know physical growth of person around us? Our mind captures the snapshot of the last moment we saw that person and this snapshot remains with us. Next time we see that person, our mind compares the snapshot from our memory and knows the physical growth of the person. Now, Git is a distributed version-control system for tracking changes in source code during software development. So, does that make git ‘brain’ of version control system? Yes. Does git also make snapshot of each files in each specific…

“ The fact that there was no catastrophic pandemic in recent history does not mean there won’t be another one. And we are certainly not prepared for the next pandemic.”
- Bill Gates, 2015 TED Talk

I hope everyone is taking good care of their physical and mental health in these difficult hours. Nepal Government decided to open restriction upon lockdown due to coronavirus pandemic since this Tuesday officially confirmed by Spokesperson of Nepal Government Yubaraj Khatiwada. I am not sure how we are reacting to this news because I see a lot of people posting their birthday celebration in…

Lockdown affecting lives

In picture, me and my mum in last dashain

My mum is seamstress, or simply we call it ladies tailor. We live in the heart of Nepal, Kathmandu city. She owns her small business, her customer includes local women of the town. I must say she is best at what she does, very passionate and productive women. She has been doing this tailoring for over 20 years now. Previously, she used to rent a place for her shop but a few years back she made small space in our own house and with necessary furnishing, she started here.

I am just another person who is working…

Artisan commands, list commands, custom commands

Before digging into artisan command and all this. Let’s have a clear idea on Command Line Interface. CLI is text-based UI for file configuration in computer systems in forms of text lines. Operating systems implement a command-line interface in a shell for interactive access to OS functions or services. The two most popular and easy to understand ones are DOS (for Windows) and the bash shell (for Linux and OS X). Each CLI uses its own command syntax, but they all function in a similar way.

Similarly, artisan is CLI for Laravel. It provides…

Sonika Baniya

writes code, mostly backend

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store