Now your app is ready. Run the code and wait. Everything on the screen will be recorded. Press q on your keyboard to stop the recording. The recording is then saved to the directory where the file is.
Summary
In this article you learnt how you can make your own screen recorder using Python. You learnt about the use of python pillow module and numpy. We made the screen recorder using opencv.
Thanks for reading. Hope you liked the idea and project. Do comment down you opinions. Also, share this project with your friends and programmers.
Hello Beautiful People,
You must have known about Kali Linux and most probably have used it. If not no problem then, we are going to create our own Kali Linux (oops, Sorry... Our Kali Linux themed portfolio.
For reference you people can see these terminal themed portfolio websites:
One day I was just chilling about it and somehow found a website in the theme of terminal. Then I thought why not make something like that? A terminal themed portfolio it isn't that bad...
Prerequisites
Previous knowloedge of React + JavaScript
No knowledge? No problem😥 Learn by building things just like I do...
Let's Begin
What else we will add?
We will make our own linux like login screen and will make a custom loader. Cool right? Let's start Coding.
Create a React App
Go to your desired folder, open terminal and run this command to create a react app in that directory.
npx create-react-app ./
After the app gets created,
Consider the folder structure we are going to use in this project...
Create the folders which are not available in your default app folder according to this structure.
After making the following file structure we are ready to start working with our Application.
Packages
Packages we are going to use in this project are as:
One more thing I would add is a login page, where user will enter their name or they can just enter as guest and we will display their entered name on the terminal. This is a little extra thing but I feel this adds to our portfolio and makes it a little more interactive.
import React from 'react'
import logo from '../kali-logo.png'
import { Link } from "react-router-dom";
export default function Login(props) {
return (
<>
<div className='login_container'>
<div className='login_box'>
<div className='login_area'>
{/* <h1>Login</h1> */}
<div className='logo_image'>
<img src={logo} alt="logo" />
</div>
<div className='input_login'>
Enter your name here
<input value={props.name} onChange={(e) => props.setName(e.target.value)} type="text" autoFocus={true} />
</div>
</div>
<div className='login_btns'>
<Link to="/" className='secondaryBtn' onClick={props.guestName}>Guest</Link>
<Link to="/" className='primaryBtn disabled-link' onClick={props.submitName}>Log In</Link>
</div>
</div>
</div>
</>
)
}
Adding these styles, our Kali Linux Terminal themed portfolio is ready.
Final Look
We have created an awesome login screen, a working terminal and a great loader. What else?
Go ahead and feel free to experiment with the code.
See ya in the next post, till then Bye Bye!
Hey fella's,
Here I am with a new post.
In this post, I am gonna create a tic tac toe game but with pure html, css and js. Yeah, it's a little waste of time to not use any help from libraries as such, but I love to code.
So, let's make everything on our own.
Umm, actually it's a very easy project. Nothing needs to be created or hyped like a great work. I just wanted to post something after many months, so I am creating this.
Challenges
Build responsive design 😥
Code JavaScript on my own 😣
No awesome components/functions of React 🤨
I guess, I am acting too much.
Let's Begin
I coded for a few minutes and surprisingly, every logic I made worked.
It took me few minutes to make the basic work, changing the content inside the blocks and adding a few conditions.
But I want perfection.😅
Umm, actually I am not good at finalizing things at once...
So, after a few hours,
This is what I made
How is it? Let me know in the comments.
Now, let me show you the code.
Actually it's very messed up, I am feeling embarrassed to show it. But, in the next post, I'll try to fix up things a little.
I will try to make this code better in the next one.
Till then bye bye, see ya
Hello folks, I guess most of you are using a windows computer or laptop. And since you are visiting this post, that means you're a developer too.
Windows comes with essential softwares installed that you can start with, like notepad for coding, cmd for running commands. But, while you grow up as a developer, you should change yourself with it.
So in this post, I will tell you about the most useful windows software that you should have, if you're a developer.
This post is a description about the softwares as well as an installation guide for them.
Note: This softwares mentioned in this post are based on looks, performance and work requirements.
This is probably the most important software for developers. VS code is made by Microsoft and is thus a great IDE for windows. It is a lightweight and efficient IDE for developers, that's why it's preferred by most of the programmers you see.
One more thing that makes VS code a great pick are the extensions present in it. It has a lot of essential pre built tools, that can just be installed and used. You can even customize the themes, code the look and almost everything inside it with the use of extensions.
VS Code Installation
If you want a specific post on which VS code extensions do I use, just let me know in the comments below.
2. Git
This software is really useful for programmers. Suppose you are writing 100's of lines of code from a week and by mistake your file gets corrupted. You lost all your work?
With Git you don't need to worry about it. It will manage all your previous work, files and modifications you did from time to time.
Just commit your code every time you make major changes, and it will not be lost.
Git Installation
If you want Git tutorial then visit the link Git tutorial
3. PowerToys
Now comes the software that I think not much people know about.
PowerToys is also a software developed by Microsoft itself and is a really good and powerful software. It gives you a lot more features on Windows. You can have fast search, rename/modify files easily. Change file size, etc very easily.
For me, this is a must have software on windows, whether you're a developer or not.
Let me show you some screenshots of the features it gives.
There comes another really interesting software from Microsoft, that looks really great by design.
If you're a preogrammer, you must be aware of the PowerShell and Command Prompt on Windows. But if you are looking for a really good looking area to run your scripts, Windows Terminal is made for you. This also adds a lot of features in your hands, like tabs in the same window.
I mean, just look at it.
Windows Terminal Installation
So, that's all for this list. If you liked the post, just leave a comment and please share it with your other developer friends, to make their Windows better too.
See you in the next post.
Till then Bye Bye :)
Hello folks, in this post, we will explore how can you create an effect like this using HTML, CSS and JS.
The simple logic
Just replace the "divname" in the code by the name given to the div to that you want to apply this hover effect. We will use jQuery. So firstly, import this line:
<!-- paste this line either in the 'title' tag or at the end of body -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swiper@8/swiper-bundle.min.css" />
//JS part
document.getElementById("divname").onmousemove = e => {
const divname = document.getElementById("divname")
const rect = projects.getBoundingClientRect(),
x = e.clientX - rect.left,
y = e.clientY - rect.top;
projects.style.setProperty("--mouse-x", `${x}px`);
projects.style.setProperty("--mouse-y", `${y}px`);
};
The CSS (playing with logic)
Now we will add some css to make this effect working.
/* CSS part -- this is the most important part to show the effect */
#divname::before {
content: '';
opacity: 0;
position: absolute;
height: 100%;
width: 100%;
/* background: white; */
top: 0;
left: 0;
background: radial-gradient(
800px circle at var(--mouse-x) var(--mouse-y),
rgba(255, 255, 255, 0.1),
transparent 40%);
transition: .5s all;
}
#divname:hover::before {
opacity: 1;
}
Complete Code
Now I will show you how you can make the same thing as I showed you in the preview.
In this article you will learn how can you let the user input something when the website loads and the site will display that input on the screen. We are going to use JavaScript Prompt to take the input from the user.
Prerequisites
Very basic knowledge of JavaScript
So, let's start the coding part...
HTML
Firstly create a html file. I've created a basic template with heading tag just to display the information. You can modify your html according to that.
Just give a id to the element whose content you have to change.
Here, I have to change the content inside the div with id "name".
So, we are all set. Now let's jump to the main JS part...
It's just a two line script and you're done.
JS
<script>
constname = prompt("Enter your name");
document.getElementById("name").innerText = name;
</script>
What we are doing here is taking a prompt input from the user and storing it in the variable called "name".
Then we're changing the content of the div with id "name".
So, that's it for this post. This was a small basic tutorial on JavaScript. Have a look on my other JavaScript projects by clicking the button below.
Hello there! In this article we are going to create a programmer way to write an application. We will write an application using Python.
Ideation
So, as you all know that we have a specific format to write an application. In this post, I've chosen a leave application. Firstly, what we want is the sample of the application. Then, we are going to format the sample of the application with the important information. And at the end, we'll create a new file to output the text application and save it.
Prerequisites
A basic knowledge of file handling and string formatting.
The way I am going to make the program is using file handling in Python with string formatting. But you can also just make the use of string formatting to modify the program.
How?
Firstly I saved a very raw and simple sample of application written in a file named, "letter.txt". I've used a simple format. Modify the file as per your requirements.
To
the Principal
{school_name}
Subject: Sick Leave Application
I am {name} of {class_name} of your institute. I am writing this application to inform you that I am suffering from {reason} and therefore, I want sick leave from school. I got this infection last night and I will not be capable to come to the office for from {start_date} for a several days. As advised by my doctor, I should take rest and recover appropriately before continuing work. The report from the doctor is also attached for your reference.
Kindly grant me a leave for {no_days} days.
Yours Sincerely,
{name}
Note: Just keep the data that is to be changed with the application inside "{ }" brackets. And use a single unique word to define the information used inside it. We are going to change this information using string formatting
Now create a Python script file, say "letter.py" and start to code.
Coding
Firstly, we are using the template saved in our file, "letter.txt". So, we'll have to use it, open and read the content inside it. We are going to use the concept of file handling here.
letter = open("letter.txt", "r")
text = letter.read()
In these two lines, I've opened the file, in read mode (because we don't want to modify the file) and then I've read the content inside the file using read function and stored it in a variable, text.
Now, we have got the format in the text variable. Now, just replace those reference variables written inside the "{ }" brackets with the required data.
We're going to make the user input the required data. So, let's make some variables to let the user input some data.
name = str(input("Enter your name: "))
school_name = str(input("Enter your school's name: "))
class_name = str(input("Enter the class: "))
reason = str(input("Enter the reason for being absent: "))
start_date = str(input("Enter the date from which leave starts: "))
end_date = str(input("Enter the date from which leave ends: "))
no_days = str(input("Enter the no. of days: "))
Note: I've used the same word references stored in the file inside "{ }" brackets. You can also do the same to remove any confusion.
Now, everything is well setup for us.
At last, We have to change the content in the text variable.
I've created a variable and then changed its content with the text content of text variable, using string formatting. And after that in the same variable I've replaced the references with the variables.
This is a bit complicated to see as I've combined two steps in one. But, just look at it once and you will get it easily. If not, separate the two steps and print them one by one and see the difference.
At the end, close the opened file, "letter.txt".
letter.close()
Now, you have created your application using python. Print the "temp_str" variable and see the output.
Here, we are going to make a new output file to save the application.
So, we'll again use the concept of file handling.
output = open("output.txt", "w")
output.write(temp_str)
output.close()
Congratulations! You have created a Python program to create your own application.
Code:
print("""
___ ___ ___ ___
| | | | | | | |\\ /| |
| | |__ | | | | | \\/ | |__
| /\\ | | | | | | | | |
|/ \\| |___ |___ |___ |___| | | |___
""")
letter = open("letter.txt", "r")
text = letter.read()
name = str(input("Enter your name: "))
school_name = str(input("Enter your school's name: "))
class_name = str(input("Enter the class: "))
reason = str(input("Enter the reason for being absent: "))
start_date = str(input("Enter the date from which leave starts: "))
end_date = str(input("Enter the date from which leave ends: "))