Search code snippets, questions, articles...

A portal for programmers by programmers

Learn something new everyday and share your knowledge

Programming Feeds

Remove an object from array by value in Javascript

Devsheet / September 30, 2022

There are multiple ways that can be used to remove an object based on the value in Javascript. We will explain them one by one in this post.

Check if string includes a substring Javascript (Multiple Methods)

Devsheet / September 28, 2022

If you're working with strings in JavaScript, it's often useful to know whether or not a string includes a particular substring. For example, you might want to check if a string contains a URL or a specific word. In this article, we will show you different methods to check that.

Create a searchable list in React

Devsheet / September 27, 2022

React is a powerful JavaScript library that helps developers create user interfaces and websites. When it comes to creating a searchable list, React provides a great solution. This article will show you how to create a searchable list in React without using any library.

Round Container with Image in Flutter

Devsheet / September 25, 2022

This tutorial will show you how to create a round container with an image in Flutter. This is a great way to display a user profile image or list item images.

Filter an Array using object key value in Javascript

Devsheet / September 23, 2022

If you have an array of objects and you want to filter the array by a key value, you can use the filter() method in JavaScript. The filter() method creates a new array with all the elements that pass the test implemented by the callback() function.

Uppercase first character of each word of a String in PHP

Devsheet / September 18, 2022

If you need to uppercase the first character of each word in a string in PHP, you can use the ucwords() function. This function takes a string as an argument and returns a new string with the first character of each word in the original string capitalized.

Uppercase first character of a String in PHP

Devsheet / September 18, 2022

If you need to uppercase the first character of a string in PHP, you can use the ucfirst() function. This function takes a string as an argument and returns a new string with the first character uppercased.

Lowercase first character of a String in PHP

Devsheet / September 17, 2022

If you need to lowercase the first character of a string in PHP, you can use the lcfirst() function. This function takes a string as an argument and returns the string with the first character converted to lowercase.

Convert string to uppercase in PHP

Devsheet / September 17, 2022

If you need to convert a string to uppercase in PHP, you can use the strtoupper() function. This function takes a string as an argument and returns a string with all uppercase letters.

Define Int type value in class Flutter

Devsheet / September 17, 2022

In computer programming, an integer is a data type that represents mathematical integers. In the Dart programming language, the int type represents a 64-bit signed integer. This means that it can represent values from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.

Pass Data to Stateless Widget in Flutter

Devsheet / September 15, 2022

In flutter, Stateless widgets are those widgets that don’t require any change in their state. They are immutable. In order to pass data to a stateless widget, we have to use a constructor. The constructor accepts the data as a parameter and we can use that data in our widget.

How to remove debug banner in Flutter app

Devsheet / September 10, 2022

The debug banner is a visual indicator that appears in the top right corner of the screen when running a debug build of a Flutter app. While the debug banner can be helpful when developing and debugging an app, it can be annoying when running a release build of the app. This article will show you how to remove the debug banner in a Flutter app.

Prevent device rotation in Flutter

Devsheet / September 6, 2022

If you've ever used an app on your phone and rotated your device, only to have the app rotate with it, then you know how annoying it can be. Luckily, there is a way to prevent this from happening in Flutter. By using the following code, you can ensure that your app will remain in the orientation that you originally intended it to be in.

Loop through Array of Objects in PHP

Devsheet / August 30, 2022

In PHP, there are a few different ways to loop through an array of objects. The most common way is to use a foreach loop. This type of loop will iterate through each object in the array and perform the specified actions.

How to Filter an Array of Objects in React

Devsheet / August 20, 2022

When working with data in React, it is often necessary to filter an array of objects. There are many ways to do this, but in this article, we will discuss how to filter an array of objects in React using the native filter() method.

Solution of FizzBuzz problem using Python

Devsheet / August 20, 2022

The FizzBuzz problem is a common programming challenge. The challenge is to print the numbers from 1 to 100, but for multiples of three print "Fizz" instead of the number, and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz". The solution to the FizzBuzz problem using Python is to use the modulo operator to check for the divisibility of the number by 3 and 5.

HTML comment shortcut for VS Code

Devsheet / August 20, 2022

If you are a web developer, then you know that the HTML comment tag is a vital part of your workflow. It allows you to leave notes for yourself or for other developers who may be working on the same codebase. But typing out the full tag can be a bit tedious. Fortunately, there is a shortcut you can use in the Visual Studio Code text editor to quickly insert an HTML comment.

Delete the first column in a Pandas DataFrame

Devsheet / August 20, 2022

A Pandas DataFrame is a two-dimensional data structure that can hold data of various types. You can think of it like a spreadsheet, with columns and rows. Sometimes you may want to delete a column from a DataFrame. This can be done using the .drop() method.

Using regex to validate a phone number in Javascript

Devsheet / August 20, 2022

Validating phone numbers is an important part of any web form. There are many ways to do this, but one of the most effective is to use a regular expression, or "regex." Regex can be used to validate a wide variety of data, including phone numbers. Here, we'll show you how to use regex to validate a phone number in Javascript. We'll also provide a few tips on how to make sure your phone number regex is as effective as possible.

Javascript examples to remove url from a string

Devsheet / August 14, 2022

If you're looking for a way to remove the url from a string using Javascript, you've come to the right place. In this article, we'll show you a few different examples of how to do this.

Python Switch Case: A Comprehensive Guide with Examples

Devsheet / August 12, 2022

If you're looking for a comprehensive guide on how to use switch case in Python, look no further! This guide will cover everything from the basics of switch case to more advanced concepts. We'll also provide plenty of examples to help you along the way.

Changing User Password in Ubuntu Terminal

codinginpearls / August 10, 2022

Note: If you are not familiar to using the terminal, you will find the space remains empty/blank as you type your existing and new password. Since I am new to using Ubuntu and really any terminal, I am needing a space to save even the simplest of commands.

How to customize a title in chart.js

Devsheet / August 9, 2022

Charts are a great way to visualize data, and chart.js is a powerful library for creating them. However, sometimes you may want to customize the title of your chart. This tutorial will show you how to do that.

Use jQuery to check if a tab is active/inactive

Devsheet / August 9, 2022

When using jQuery, it is possible to check if a tab is active or inactive. This can be done by using focus and blur events. By using these events, it is possible to determine if a tab is currently active or not. This can be useful when trying to determine if a user is currently on a specific tab.

jQuery code to run a function after page load

Devsheet / August 7, 2022

This code will allow you to run a function after the page has loaded. This can be useful if you want to initialize something on the page or make sure that the page is ready before running your code.

Find the Third Smallest Number in an Array using Javascript

Devsheet / August 6, 2022

If you're looking for a quick and easy way to find the third smallest number in an array using Javascript, you've come to the right place. In this article, we'll show you how to do just that with a few simple lines of code.

Python Sort String: Quick and Easy Guide

Devsheet / August 3, 2022

Python is a programming language that is widely used by web developers and software engineers. Python's simple syntax and powerful data structures make it an ideal language for sorting strings. This quick and easy guide will show you how to sort strings in Python.

Go to a line number in Visual Studio Code

Devsheet / August 1, 2022

Visual Studio Code is a code editor developed by Microsoft. It is a free and open-source tool. It has many features such as syntax highlighting, code completion, and debugging. Here, we will show you how to place your cursor on a line number on the current file

Send Form Data in axios POST request

Devsheet / July 30, 2022

When using axios, a Javascript library for making HTTP requests, to make a POST request, you need to set the data that you want to send as the body of the request. To do this, you can use the axios.post() method, which takes two arguments: the URL of the server you want to send the request to, and the data you want to send. In this article, we will look at how to use axios to make a POST request, and how to set the body of the request.

Generate a list of n numbers in Python

Devsheet / July 30, 2022

Python is a versatile language that you can use to write programs to complete a variety of tasks. In this article, you'll learn how to generate a list of numbers in Python. You'll also learn how to modify the list to meet your needs.

Randomly shuffle a list in python (Best Practices)

Devsheet / July 30, 2022

Python provides a number of ways to randomly shuffle a list. The most common is to use the shuffle() method from the random module. This method takes a list and shuffles it in place, returning None.

Python tip: How to insert a variable value inside a string

Devsheet / July 29, 2022

Python is a programming language that is widely used in many different applications today. Python is known for its ease of use and its readability, which makes it a great choice for beginners. One of the great things about Python is that you can insert a variable value inside a string, which can be very useful when you want to print out a message that includes a dynamic value.

Counting rows in a Pandas Dataframe based on column values

Devsheet / July 29, 2022

If you have a pandas DataFrame with a column of values and you want to count the number of rows where the value in that column is equal to a certain value, this tutorial will show you how.

Loading more...