Python

I’ve seen lots of devs were searching online for a solution like how to do the string contains, in the python language. In this article; I’m going to tell you how to do that easily with some deeper explanations. So let’s jump right into it.

Quickest and Easiest Way

Using the in operator in python:

if "blah" in somestring: 
# Do something

Hope I got you covered; Now let’s looking into some of the details of this option and other fun facts around this string contains methods in python.

Explanation

Use the in comparison operator because

  1. The language intends its usage, and
  2. Other Python programmers…


Git

I have seen lots of people struggling to delete a git branch from the local and the remote repository. Here is a quick guide to delete your branch in such a way.

Quick Guide

git push -d <remote_name> <branch_name>
git branch -d <branch_name>

NOTE:
In most cases the remote name is origin. In such a case you'll have to use the command like so.
git push -d origin <branch_name>

Delete Local Branch

To delete the local branch use one of the following syntax :

git branch -d branch_name
git branch -D branch_name

NOTE:
The -d option is an alias for --delete, which only deletes the…


Git

Recently accidentally committed the wrong files to Git, but didn’t push the commit to the server yet. Then I wanted to undo those commits from the local repository, So In this article, I’m going to share with you how to do that.

Steps to undo the most recent local commits

$ git reset HEAD~                              # (1)
[ edit files as necessary ] # (2)
$ git add . # (3)
$ git commit -c ORIG_HEAD # (4)

I hope, I got you covered, Now let’s see the meaning of each of the above steps;

  1. This command is responsible for the undo. It will undo your last commit while…


WordPress and App Engine

Have you ever wondered about other alternative ways to install and run your WordPress website? In this article, I’m going to explain how you can install and run a WordPress inside Google App Engine.

Prerequisites

  1. Create a project in the Cloud Console.
    You need to have one project in Google Cloud to work with any of the google cloud services, In this project, we will make use of Cloud SQL API and Google App Engine which required us to have such a project before using them.
  2. Enable billing for your project.
    It is always a best practice to enable billing in a…


Python

Introduction

If you work on multiple Python projects, you’ve probably run into this one time or another. You have the latest and greatest version of Python installed, and the project you’re about to work on requires an older version. In those situations, the Python Version Manager(pyenv) is a great tool to use, allowing you to install multiple versions of Python and switch between them as you see fit.

In this tutorial, you will install pyenv and learn to install, remove, and switch between different versions of Python.

Prerequisites

Before you install pyenv itself, you’re going to need some OS-specific dependencies. These dependencies…


Introduction

If you work on multiple Node.js projects, you’ve probably run into this one time or another. You have the latest and greatest version of Node.js installed, and the project you’re about to work on requires an older version. In those situations, the Node Version Manager (nvm) is a great tool to use, allowing you to install multiple versions of Node.js and switch between them as you see fit.

In this tutorial, you will install nvm and learn to install, remove, and switch between different versions of Node.js.

Prerequisites

To complete this tutorial, you will need the following:

  • The latest version of…


Recently I had to switch to a new mac book pro, Then I had to install every tool from the beginning which I was using in the previous mac book pro. So I thought of bringing series of medium articles which might be helpful for any developer to set up their own development environment without a hassle. In this article, I'm going to describe how to set up this awesome terminal tool iterm2 with Z shell and Oh My Zsh Framework.

If you ever wonder why you need to install the iTerm2 terminal, then you can have a look available…


API Security

In the previous article, we discussed some of the basic concepts and terminologies around the APIs, in this article we will be looking into different kinds of threats which can be a threat to your APIs.

Vulnerabilities are the gaps or weaknesses in a system that make threats possible and tempt threat actors to exploit them.

As we discussed earlier, the exponential growth of API usage in today’s digital world brings the risk of those APIs being vulnerable to attacks. …


API Security

What is an API?
If you are not aware of what is an API, I suggest you to go and read this article first and come back.

Did you know that today 83% of web traffic is API driven? I hope you never thought, based on a recent report from Akamai, now more than 83% of web traffic is API driven. This traffic can vary from tech-based companies to clothing stores, etc as many of the organizations rely on a large number of different services that provide using APIs. At the same time, it has increased the attacks against these…


React Context API

Before getting into the article, I hope you have a basic understanding about React and Javascript. If not I highly recommend you to go through React official documentation and grab a small idea about what is React and how does it work.

Introduction

The issue:

If you are an expert on React of if you have some level of experience with React or React Native development, you might have come across with different difficult situations like where you need to pass the data deep down in the child component hierarchy, that becomes cumbersome when you have a very deep child component hierarchy. …

Chamika Kasun

Versatile Full-stack Developer with 5+ years of experience designing, developing, and managing complex applications and internal frameworks.

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