teleren/devto huggingface dataset:
JavaScript : Closures (English/Hindi)
Tags: webdev, javascript, programming
Published: 2023-08-26 05:34:15

## English

A closure in JavaScript is a concept where a function retains access to the variables from its containing (enclosing) function, even after that enclosing function has finished executing. This means that a function "closes over" the variables it needs, keeping them alive beyond their original scope.

```javascript
function outerFunction() {
  let outerVariable = "I'm from outer function";

  function innerFunction() {
    console.log(outerVariable); // inner function can access outerVariable
  }

  return innerFunction;
}

const closureExample = outerFunction(); // closureExample now holds the innerFunction

closureExample(); // Outputs: "I'm from outer function"

```

## Hindi
JavaScript mein ek closure ek aisa concept hai jahan ek function apne enclosing function ke variables tak ka access rakhta hai, us enclosing function ka execution khatam hone ke baad bhi. Iska matlab hai ki ek function "closes over" (apni baahar ke) variables ko, aur unhe unke asal scope se bahar rakh deta hai.

```javascript
function outerFunction() {
  let outerVariable = "Main bahar waale function se hoon";

  function innerFunction() {
    console.log(outerVariable); // andar waala function outerVariable tak ka access kar sakta hai
  }

  return innerFunction;
}

const closureExample = outerFunction(); // closureExample ab innerFunction ko hold karta hai

closureExample(); // Output: "Main bahar waale function se hoon"

```
Native PHP: How to Start?
Tags: php, nativephp, laravel, webdev
Published: 2023-10-18 05:03:50

---
title: Native PHP: How to Start?
published: true
date: 2023-08-26 05:31:05 UTC
tags: php,nativephp,laravel,webdevelopment
canonical_url: https://medium.com/@emma.ngo1110/native-php-how-to-start-911b27b40791
---

![](https://cdn-images-1.medium.com/max/720/0*zgRYLXE72VKqK5Do)

I’m a web developer, and the main language that I use is PHP. As you know, actually, more than 70–80 percent of the current website you can see is PHP.

Before NativePHP, there was a lot of technical help needed to build PHP into an application (example: PHP Desktop). One of the most famous PHP frameworks currently is Laravel, and in [Laracon 2023 day 2](https://laravel-news.com/laracon-day-2-live-stream) the event of Laravel, [Marcel Pocio](https://www.linkedin.com/in/marcel-pociot-aa5045156)t introduced us to NativePHP with the topic "Writing Desktop Apps with PHP.”

Actually, I tried it, and it was really easy. You just need 3 commands, and you will have an application based on a standard Laravel project. It looks like a package for Laravel, so don’t worry if you are a PHP player.

### How do I start?

If you have run the project with Laravel before, I believe you only need to run three commands before you can work with nativePHP

#### Installation

composer require nativephp/electron

![](https://cdn-images-1.medium.com/max/1024/1*cAYXVnN8aZ9L0S-2zS9Imw.png)

You can run your current Laravel project or create a new one.

#### Run the installer

php artisan native:install

![](https://cdn-images-1.medium.com/max/1024/1*4bf8RJiedOUUXB_BC3dWTA.png)

With the two commands above, nativePHP was successfully set up.

The last thing is to run it.  
php artisan native:serve

![](https://cdn-images-1.medium.com/max/876/1*1HpXk_0XvErq5muHMA11bA.png)

Then, you will get an application like this:

![](https://cdn-images-1.medium.com/max/1024/1*YHV_xSPK4ClFefYnriW9Vg.png)

### What is special?

nativePHP has 5 highlight features; you can read more [here](https://nativephp.com/docs/1/getting-started/introduction).

- Window management
- Menu management
- File management
- Database support (SQLite)
- Native notifications

But the thing that impresses me is “[Menu Bar](https://nativephp.com/docs/1/the-basics/menu-bar)”  
I really think that it gives me an application, not a web application anymore.

![](https://cdn-images-1.medium.com/max/1024/1*l9_MFk-swgDoGLn7IAgyQw.png)

Menu bar label

![](https://cdn-images-1.medium.com/max/1024/1*c9p2CHKEYyT5l0bB6A7niQ.png)

Menu bar Context Menu

![](https://cdn-images-1.medium.com/max/1024/1*HHnT_Bq6C0dZ0RFHjVtx-w.png)

### End.

This topic might be late because nativePHP was introduced in April 2023.  
But I believe that not many people know about the interesting features of nativePHP.  
As before, PHP has other technical support PHP to make an application like “PHP Desktop”.   
There are a lot of opportunities for PHP developers like me to build our product from the ground up.  
Let's try; I'm impressed by what you can do with your application!!  
Have a nice day :))))
What are the main challenges faced in adult ad monetization?
Tags: programming, adultad
Published: 2023-08-26 05:29:08



### Here are some of the main challenges faced in adult ad monetization:


**Social stigma:** The adult entertainment industry still carries a social stigma in many societies. This stigma may deter potential advertisers, publishers, and partners from working with **[adult ad networks](https://cutt.ly/FwpOoKcX)**. It can also lead to negative public perception and obstruct business opportunities outside the adult sector.


**Limited ad formats and placements:** Adult ad networks typically have limited options for ad formats and placements compared to mainstream networks. This limitation can affect the effectiveness and creativity of ad campaigns, making it difficult for an advertiser to engage their target market in innovative ways.


**Fraud:** Adult ad networks are more vulnerable to fraud than mainstream networks. This is because the industry is often seen as a lucrative target for fraudsters. Fraud can manifest in a number of ways, including click fraud, impression fraud, and domain spoofing.


**Regulation:** The adult entertainment industry is heavily regulated in many countries. This can make it difficult for adult ad networks to operate and comply with all applicable laws and regulations.


**Ad blockers:** Ad blockers are becoming increasingly popular, and they can significantly impact the revenue of adult ad networks. Ad blockers are software applications that can be installed on a user's device to prevent ads from being displayed.
Popular Graph extensions to PostgreSQL
Tags: postgres, postgressql, apacheage, graphql
Published: 2023-08-26 05:28:03

## PostgreSQL

PostgreSQL is a powerful and versatile open source database system that can handle a wide range of applications and data types.

But did you know that you can also use graph data models within PostgreSQL with extensions? Graph data models are useful for representing and analyzing complex and interconnected data, such as social networks, recommendation systems, fraud detection, knowledge graphs, and more. 

In this blogpost, I will introduce some of the most popular graph extensions to PostgreSQL and how they can enhance your database experience.

## Apache AGE

Apache AGE is an extension that provides graph database functionality to PostgreSQL. AGE stands for A Graph Extension, and is inspired by Bitnine's fork of PostgreSQL 10, AgensGraph, which is a multi-model database. 

Apache AGE allows you to store, query, and manipulate graph data in nodes and edges using hybrid queries that combine SQL and OpenCypher to access both relational and graph data simultaneously.

Apache AGE also comes with a web user interface tool called **Apache AGE Viewer**, which allows you to visualize and explore graph data in an intuitive and convenient way. 

Apache AGE is an open source project and can be installed from the [Official Website Download Page](https://age.apache.org/download)

_If you are interested, you can visit their [Official Website](https://age.apache.org/) and [Github Repo](https://github.com/apache/age)_

## pgRouting
pgRouting is an extension that provides geospatial routing functionality to PostgreSQL. pgRouting allows you to perform various types of network analysis on spatial data, such as finding the shortest path, the traveling salesman problem, the vehicle routing problem, the location-allocation problem, and more. pgRouting uses the PostGIS extension, which adds support for geographic objects to PostgreSQL, as a base. 
pgRouting is an open source project.

## Graphile
Graphile is a suite of tools that help you build high-performance GraphQL APIs on top of PostgreSQL. GraphQL is a query language for APIs that allows you to specify the exact data you need from the server in a declarative way. Graphile allows you to automatically generate a GraphQL schema from your PostgreSQL schema, or to customize it with plugins or code. Graphile also provides features such as live queries, subscriptions, authentication, authorization, validation, caching, batching, and more. 

## Conclusion
Graph extensions can greatly enhance your database functionality and performance by providing features that are not included in the core PostgreSQL or by offering more options and flexibility than the built-in ones. Graph extensions are one of the reasons why PostgreSQL is such a powerful and versatile database system.
🚀 Unveiling the Multitasking Myth: How to Master Productivity! 🎯
Tags: productivity, beginners, organization, multitasking
Published: 2023-08-26 05:21:18

Are you juggling tasks like a pro, or drowning in a sea of to-dos? 🤹‍♂️ Here's the scoop: true multitasking isn't the productivity powerhouse we thought it was, according to both science and personal experience.

🚫 Say goodbye to the multitasking trap and hello to the magic of focus! The secret sauce? One task at a time. 🧘‍♀️

But wait, how do you seamlessly switch gears without losing steam? ⚙️

🔗 My game-changing strategies of context switching:
📌 Drop breadcrumbs for future you with comments on completed tasks and next steps.
📢 Keep teammates in the loop with quick status updates.
🔖 Bookmark, comment, or stash links where you won't lose 'em.
🚀 Zone in on one task - gently ignore updates on other tasks until the current one is completed.
🚨 Emergency? Jot a note, switch, return when you've nailed it.
⏳ Reduce task-switching frequency by extending periods of focused attention.
📋 Trim the fat: fewer tasks, higher impact. Delegate, drop, prioritize.

🎉 Let's be real: true multitasking doesn't work! 💡 The true productivity revolution happens when we align with the laws of nature.

🙌 Are you ready to soar? Share your focus hacks below! ⬇️
How JDBC Paved the Way for Java Frameworks! 🛤️
Tags: webdev, java, springboot, jdbc
Published: 2023-08-26 04:10:58


Let's talk about JDBC and its magic in the Java world. 

So, what's JDBC? It's like a messenger. It helps our Java programs talk to databases. It's been around for a long time and has done a lot of good work.

Because of JDBC:

1. **Starting Point**: JDBC was one of the first tools for Java to connect with databases. It made a clear path for others to follow.

2. **Building Blocks**: Many of our favorite Java tools and frameworks are built on top of JDBC. Think of JDBC as the foundation stone of a big building.

3. **Inspiration**: By showing how Java can talk to databases, JDBC inspired many to create new and better tools. It's like the first person who made a wheel, and then others made cars and bikes using that idea.

4. **Flexibility**: With JDBC, we have the freedom to connect to many different databases. This freedom helped others to think big and design flexible tools.

In short, JDBC has been like a guiding light. Because of it, many smart people created great tools for us to work with databases more easily in Java.

So, even with all the new tools around, it's good to remember and thank JDBC for starting it all!
Task 4
Published: 2023-08-26 04:01:43

What is manual testing? What are the benefits and drawbacks of manual testing? Give some examples in support of your exam.

**Manual testing:**
The methodology of testing the developed software/application without using any automated tools is called manual testing

**Benefits of manual testing:** 
i) Depends on the human intelligence
ii) Many issues can be identified in this methodology
iii) Can identify the issues outside the code (i.e., UI issues)
iv) There is no usage of any automation tools, the cost of the project will be less
v) Cross browser testing, exploratory testing, acceptance testing can done by manual testing
vi) Manual testing can be done for the applications having frequent changes in GUI
vii) Accurate output can be achieved through this method of testing.

**Drawbacks of manual testing:**
i) Takes longer time for execution, particularly for repeating scenarios
ii) Expensive in case of long run
iii) Test cases cannot be reused for different software

**Example: **
i) Completion of regression testing in manual testing method can take a very long time.
ii) Once the fixes are given to any particular module, there is no need of testing the application completely, the test engineer can test that particular module alone.
Interview at MMT
Tags: interview, javascript, react, browser
Published: 2023-08-26 03:56:24

## React

- Basics of React, Virtual DOM, etc.
- Latest React version and updates
- React hooks and examples
- Angular vs React which one to choose?
- PWA
- Service Workers ? Usage
- Creating new PWA project what all i will need to do?

## Browser
- What is CORS?
- How to set CORS on the client or server side
- diff CORS MODE?
- How to handle and avoid CORS errors
- Where are cookies stored, and what is the purpose of cookies?
- different cookie properties like HTTPOnly, Secure, etc. (You can find all properties in the - application tab.)
- How to pass cookies in an API call, and how can I pass all cookies at once in a request?
- What if we manipulate cookies and change the domain name?
- Chrome Browser Latest feature 
- when we click on link & open new instance of chrome can we transfer current session info to new window? (Latest chrome feature)

## Javascript
- Hoisting behavior
- code snippets
```js
console.log('start');
const promise1 = new Promise((resolve, reject) => {
console.log(1)
})
console.log('end');
```

```js
function parent() {
    var hoisted = "I'm a variable";
    function hoisted() {
      return "I'm a function";
     }
    return hoisted();
}
console.log(parent());
```

```js
function foo() {
  var bar = function() {
    return 3;
  };
  return bar();
  var bar = function() {
    return 8;
  };
}
console.log(foo())
```
Firefox extension support for Android Phones
Tags: android, browser, extensions, beginners
Published: 2023-08-26 03:56:19


Have you ever considered using the Firefox extension on your Android device? It will soon be possible as Mozilla is currently developing Firefox extension support for Android phones.

Mozilla has announced that they are working on the Firefox extension support for Android phones the exact launch date is still to be announced in the first half of September 2023. The support for the Firefox extension will be available in the upcoming Firefox version and it will change the way we use Firefox on Android phones in future, We will see more browser extension support for Android phones such as Chrome, Edge, etc.

![Firefox support for android](https://codeperfectplus.com/assets/images/post/pexels-noah-erickson-404280.jpg)
_Photo by Noah Erickson_

Still, now, the Firefox extension is only available for desktop users only and in the case of Android phones, no major browser supports the extension yet. The Firefox extension support for Android phones will be a game changer for Firefox users and it will open the door for new possibilities for Firefox users and developers.

Mozilla is working on support for developers, you will see documentation, events, resources and more to help developers to build new extensions and port existing extensions to Firefox for Android.

Firefox for Android nightly build is recommended for developers to test their extensions.

What do you think about Firefox extension support for Android phones? Will you use the Firefox extension on your Android phone? Let me know in the comment section below.
What is PWA - Progressive Web App?
Tags: javascript, frontend, react
Published: 2023-08-26 03:53:38

Progressive Web Apps (PWAs) are applications that you build by using web technologies, and that can be installed and can run on all devices, from one codebase.

PWAs provide native-like experiences to your users on supporting devices. They adapt to the capabilities supported by each device and they can also run in web browsers, like websites.

## The architecture of a PWA

Progressive Web Apps are written using the programming languages of the web: HTML, CSS, and JavaScript, and are distributed to your users by using web servers.

To make your app available to users, you deploy it on a web server that's accessible via HTTPS. Your server contains:

Back-end code: the endpoints needed by your app, when connected to the internet, to retrieve dynamic content that may be stored in a database on your server.
Front-end code: the resources needed for the app to be installed on the user's device, such as HTML, CSS, and JavaScript code.

Your back-end code can use the server-side languages of your choice such as ASP.NET, Java, Node.js, or PHP. Note, however, that server-side endpoints may not even be required depending on the app your're building. The PWA that you create in this tutorial doesn't have any server-side code, because the app exclusively runs on the device it's installed on, and doesn't need any server-side data.

Your front-end code uses HTML, CSS, JavaScript, and a JSON manifest only.

You use HTML to describe the content in your app, such as the text, images, text fields, or buttons that appear in the user interface. You then use CSS to organize the HTML content in a layout, and provide styles to elements. You use JavaScript to add user interactions to your user interface. And finally, you use a JSON manifest file that describes your application to the host operating system.

Note that although your front-end code runs by using the device's web browser, the browser user interface may not be visible as your app can choose to run in a standalone window.

On top of the user interface code, you also use JavaScript to make your application faster, more reliable, and network-independent by using a service worker file. Finally, your front-end code also contains a JSON manifest file that describes your application to the host operating system.

The following diagram shows the high-level architecture of a PWA. The web server is on one side of the PWA, and the device is on the other side. The device contains the front-end code, including HTML, CSS, JavaScript, the service worker, and the manifest:

Architecture diagram of a PWA

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3wrdaozsvqp2mts5iwbh.png)


Thank you Microsoft!
[Microsoft Docs](https://learn.microsoft.com/en-us/microsoft-edge/progressive-web-apps-chromium/)
ColorHub | The new best site on the internet for finding and testing colors!
Published: 2023-08-26 03:26:13

I recently made a website ([ColorHub](https://colorhub.art)) which is  widely considered the easiest, best, and most efficient way for finding and testing colors.

Some features include:
- Palette search/creation 
- Color implementation info 
- Color schemes 
- Color variations 
- Easy to edit rgb, hsl, and hsv values Color Moods 
- Color Blindness Simulator 
- 35k+ color names 
- Advanced color search engine 
- Color history 
- Color sharing / liking system 
- Image to Color 
- Color Playground (gradients and contrast checker) 
- Minimalistic design with TONS of features

And much more...

I would love some feedback and if you like the website consider sharing
P.S - it best on a computer (chrome variations like chrome, brave, opera, are the best but it works on anything)
How can I play surf.jackbuehner.com offline?
Tags: html, microsoftedge, surfjackbuehnercom, offline
Published: 2023-08-26 02:58:49

So you've stumbled upon the addictive game surf.jackbuehner.com and now you want to know how to play it offline? Well, you're in luck! In this article, we'll walk you through the steps to play surf.jackbuehner.com offline and have a blast even without an internet connection.

First things first, you'll need to download the game files. Luckily, the developer of surf.jackbuehner.com has made the game available for offline play. Simply head over to the official website and look for the download link. Once you've downloaded the files, you're ready to go!

Before diving into the game, make sure you have a compatible web browser installed on your computer. Most modern browsers like Chrome, Firefox, and Safari should work just fine. Now, let's get started with the offline setup.

1.  Extract the downloaded game files to a location of your choice on your computer.
2.  Open your preferred web browser and go to the file menu.
3.  Select "Open File" or "Open File..." depending on your browser.
4.  Navigate to the extracted game files and select the main HTML file (usually named index.html or game.html).
5.  Click "Open" to load the game in your browser.

And voila! You are now playing surf.jackbuehner.com offline. Enjoy the thrilling surfing experience without the need for an internet connection. Feel the adrenaline rush as you navigate through the waves and perform incredible tricks.

Remember, even though you're playing offline, the game is just as challenging and addictive as ever. So be prepared to spend hours perfecting your surfing skills and trying to beat your high score. Who needs the internet when you have an awesome game like surf.jackbuehner.com right at your fingertips?

Now that you know how to play surf.jackbuehner.com offline, go ahead and show off your skills to your friends. Challenge them to beat your high score and see who reigns supreme in the world of virtual surfing!

So what are you waiting for? Grab your virtual surfboard, put on your imaginary wetsuit, and get ready to ride the waves like a pro. Surf's up, even offline!

References:

*   [surf.jackbuehner.com](https://surf.jackbuehner.com) \- Official website of the game