Object: An object is an entity. A thing from the real world. A thing that you want to store and process data about.
Class: A class is a blueprint or template for creating objects. It defines the structure and behavior of objects. In a class, variables are called properties and functions are methods.
OOP: A programming paradigm that structures software development around classes and objects, rather than functions and logic.
4 Pillars of Object Oriented Programming (OOP)
Encapsulation: Hiding data and complexity. bundles data and methods into a single unit restricting access to internal details and providing controlled access.
Inheritance: Hierarchy of classes. allows a class to inherit properties and behaviors from a parent class promoting code reuse and creating a natural hierarchy of classes.
PHP is a single inheritance programming language.
Polymorphism: Many forms of an object. Enables a single method to behave differently based on the object calling it, allowing for dynamic and flexible code.
Different forms of the same type of object with the same interface can behave in different ways.
Abstraction: Simplify reality. Hides complex implementation details exposing only the essential features of an object making the system easier to use and manage.
With RealVNC Connect, you can securely access and control your Raspberry Pi remotely, whether you’re using it with a display or as a headless device.
This is perfect for situations where you may wish to have your Raspberry Pi constantly performing tasks, but don’t necessarily need visual access to it all the time.
Install VNC on Raspberry Pi
To install it, simply run the following command on your Raspberry Pi
sudo apt-get update
sudo apt-get install x11vnc
Once installed you can start the vnc server using:
x11vnc -noxrecord -forever
If you want to run it with the password, first set a password using the following command
x11vnc -storepasswd
Now you can run the x11vnc with the password, run the command
x11vnc -noxrecord -forever -usepw
Now, on the mac if you want to connect to the Raspberry Pi in the terminal type:
open vnc://ip_address_of_raspberry_pi:5900
This is how you can install VNC on Raspberry Pi and run it remotely.
If you’re using JetFormBuilder to handle user registration, you might want to add user meta on JetFormBuilder Registration when a user registers — that is not possible with default submit action. Many time you want to change/modify the form submission date and add it to user meta or somewhere else in the database.
In this blog post, we’ll walk through how to add custom user meta after a JetFormBuilder register form is submitted, using a simple and effective PHP snippet.
How to add user meta on JetFormBuilder Registration Form
We need to enable “Add User ID to form data:” option in the Register User Post Submit Action.
We need to use “Call Hook Post Submit Actions”.
Need to add code according to the custom hook we just created earlier.
add_action( 'jet-form-builder/custom-action/update-registered-user-role', function () {
$data = jet_fb_context()->get_request();
if ( isset( $data['role'] ) && isset( $data['user_id'] ) ) {
// Get WP_User object
$user = new WP_User( $data['user_id'] );
// Optional: Validate role exists before assigning
$allowed_roles = array( 'supplier', 'factory', 'buyer' );
// Ensure role is valid and allowed
if ( in_array( $data['role'], $allowed_roles ) ) {
// Remove existing roles
$user->set_role( '' );
// Add new role
$user->add_role( $data['role'] );
}
}
}, 99 );
The NodeJS live-server package runs a temporary server displaying any HTML/CSS/JS resources in the current folder. It automatically reloads the page in your browser when any of these files change.
Verify that Node.js is installed. If you see anything when you run which npm in a terminal, it is. If not, follow the instructions at nodejs.org to install.
Install live-server: npm install -g live-server
Move your terminal to where your pages live: cd <path-to-content>
You can accelerate the speed of animations used in your Dock by running a simple command in Terminal; here’s how:
Open Terminal from Finder > Applications > Utilities.
Insert the below commands, depending on what you want to achieve. Once you insert a command, press Return to run it:
To speed up Dock animations
defaults write com.apple.dock autohide-time-modifier -float 0.15;killall Dock
To disable Dock animations
defaults write com.apple.dock autohide-time-modifier -int 0;killall Dock
You can always reinstate your original Dock settings with the below command:
defaults delete com.apple.dock autohide-time-modifier;killall Dock
Auto hide delay tweaking
Enter this into Terminal to make the Dock show without a delay :
`defaults write com.apple.dock autohide-delay -float 0; killall Dock;`
Maybe you want to have a long delay (5 seconds) so that you never accidentally trigger the Dock:
defaults write com.apple.dock autohide-delay -float 5; killall Dock;
To restore defaults:
defaults delete com.apple.dock autohide-delay; killall Dock;
Animation speed tweaking
Enter this into Terminal to make the Dock show without animations :
defaults write com.apple.dock autohide-time-modifier -float 0; killall Dock;
It's still nice to have a short animation (0.2 seconds) and this line makes it possible:
defaults write com.apple.dock autohide-time-modifier -float 0.2; killall Dock;
To restore defaults:
defaults delete com.apple.dock autohide-time-modifier; killall Dock;
রাজশাহীর কালাভুনা এ অঞ্চলের একটি বিশেষ আকর্ষণীয় খাবার। এটি প্রধানত গরুর মাংস দিয়ে তৈরি করা হয়। কালাভুনা তৈরির প্রক্রিয়ায় মাংসকে বিভিন্ন মসলা দিয়ে মেরিনেট করে নিয়ে খুব ধীরে ধীরে রান্না করা হয়, যাতে মাংস সম্পূর্ণরূপে মসলা শুষে নিতে পারে এবং একটি গভীর, সমৃদ্ধ স্বাদ অর্জন করে।
এই প্রক্রিয়ার ফলে কালাভুনা তার বিশেষ গাঢ় রঙ এবং স্বাদের জন্য পরিচিত হয়। এটি সাধারণত পোলাও, ভাত বা রুটি সহ পরিবেশন করা হয় এবং বাঙালি রাঁধুনিদের মধ্যে একটি প্রিয় খাবার হিসাবে জনপ্রিয়। কালাভুনার অনন্য স্বাদ এবং ঘ্রাণ রাজশাহী অঞ্চলের খাদ্য সংস্কৃতির একটি গুরুত্বপূর্ণ অংশ। এটি শুধুমাত্র স্থানীয় নয়, যারা একবার এই খাবারটির স্বাদ গ্রহণ করে, তাদের স্মৃতিতে চিরকাল থেকে যায়। কেউ প্রথম বার রাজশাহী ঘুরতে এসেছে আর কালাভুনা না খেয়ে ফেরত গেছে এমনটা হয়না। তাই সপ্তাহের প্রতি দিনেই কালাভুনার দোকান গুলোতে কম বেশি ভিড় দেকতে পাওয়া যাই। এছাড়া যে সকল দিনে গরু-ছাগলের হাট বসে সে সকল দিনে এ ভিড় আরও কয়েক গুন বেড়ে যাই, দুর দূরান্ত থেকে গরু-ছাগল কেনা বেচা শেষ করে কালাভুনা দিয়ে ভাত খেয়ে সবাই বাড়ি ফিরে। তাই সাধারণের জন্য হাটের দিন গুলো এড়িয়ে চলাই ভাল।
We’ll be using Node.js in this way. Node.js has the benefit of being able to open WordPress files on Windows, MacOS, and Linux. However, Method 1, which only works with Mac and Windows, requires the usage of wpress-extractor.
We need NodeJS for this method. Now let us move on to the steps required to extract wpress file.