teleren/devto huggingface dataset:
Introducing F**kDevTools.js: Secure Your Web Applications
Tags: webdev, javascript, security, github
Published: 2024-05-17 18:48:41

## Why We Created F**kDevTools.js

In the world of web development, security is paramount. We created F**kDevTools.js to address a common vulnerability: the exposure of sensitive information through browser developer tools. By disabling these tools, we aim to enhance the security of web applications and protect against potential attacks and data breaches.

## How It Helps Developers

F**kDevTools.js provides a straightforward solution for developers to prevent unauthorized access to their site's backend through browser developer tools. By disabling right-click, F12, and Ctrl+Shift+I shortcuts, this script minimizes the risk of users inspecting or tampering with the site's code. This added layer of security is especially beneficial for applications dealing with sensitive data.

## Installation

Integrating F**kDevTools.js into your project is simple. Follow these steps:

1. **Include the Script**: Add the following script to your HTML file:
   ```html
   <script src="path/to/FuckDevTools.js"></script>
   ```

2. **Configuration**: Customize the configuration options as needed:
   ```javascript
   var disable_right_click = true;
   var disable_f12 = true;
   var disable_csi = true;
   document.onkeydown = function(event) {
       if (disable_f12) {
           if (event.keyCode == 123) {
               event.preventDefault();
           }
       }
       if (disable_csi) {
           if (event.ctrlKey && event.shiftKey && event.keyCode == 73) {
               event.preventDefault();
           }
       }
   }
   if (disable_right_click) {
       document.oncontextmenu = function() {
           event.preventDefault();
       }
   }
   ```

## Collaboration: Help Us Improve

We believe in the power of community and collaboration. We're calling on developers to contribute to making F**kDevTools.js even better. Whether it's optimizing the script, adding new features, or improving documentation, your contributions are invaluable.

Visit our [GitHub repository](https://github.com/Ghalbeyou/FuckDevTools.js) to get involved. Together, we can create a more secure web for everyone.

---

By @ghalbeyou on GitHub
https://github.com/GhalbeYou
How to create advanced math calculations for your forms
Published: 2024-05-17 18:47:47

In our previous tutorial, we delved into creating a basic estimation form. It served its purpose well, utilizing default calculations that primarily involved addition. But now, we're stepping up our game by introducing custom math calculations, allowing for complex formulas and a myriad of mathematical operations. Let's explore how to unleash the full potential of your forms.

Activating Custom Math Calculations

First things first, we need to activate the price labels. It's a simple process of navigating through the interface and toggling the appropriate options. Once activated, we can introduce calculation variables. For our demonstration, we'll stick to basic operations involving three variables: product, service, and quantity.

Defining Calculation Variables

Each variable corresponds to a specific field in the form. For services and products, we'll fetch their respective prices. Quantity is straightforward; it's the numerical value entered by the user. With these variables in place, we can proceed to perform operations.

Crafting Mathematical Formulas

Here's where the magic happens. We define a formula that calculates the total cost based on the values of our variables. This formula can involve any mathematical operation—addition, subtraction, multiplication, or division. The flexibility is immense, empowering you to tailor the calculation to your exact needs.

Navigating the JavaScript Logic

Behind the scenes, these calculations are powered by JavaScript code. This provides unparalleled versatility, enabling intricate mathematical manipulations. As you build your formulas, the interface guides you, highlighting which variable each component belongs to.

Testing and Fine-Tuning

Once the logic is in place, it's time to test our form. We can preview it in real-time, observing how changes in variables dynamically affect the total cost. This iterative process allows us to fine-tune our calculations until they meet our expectations.

Exploring Advanced Examples

To showcase the full extent of our capabilities, we explore more complex examples. From conditional logic to multi-variable calculations, we demonstrate how versatile and powerful our forms can be. While these advanced features may require additional effort to implement, the results speak for themselves.

Conclusion

With custom math calculations, the possibilities are endless. Whether you're estimating costs, analyzing data, or conducting surveys, this feature elevates the functionality of your forms. By leveraging JavaScript and intuitive interfaces, you can create dynamic and responsive experiences for your users. So, why settle for basic estimations when you can unlock the full potential of your forms?

More info at https://zigaform.com

{% youtube https://youtu.be/DCip4R4jt5c?si=qAV6zwwojQ0rqfH8 %}
AI Joe's Epic Diss Track to Toupee Trump: How We Used Audio AI and Deepfake Tech
Tags: aimusic, viralcontent, deepfake, autio
Published: 2024-05-17 18:44:29

# AI Joe's Epic Diss Track to Toupee Trump: How We Used Audio AI and Deepfake Tech
 
[Our Write Up](https://www.cybershoptech.com/blogs/post/AI-Joe's-Epic-Diss-Track-to-Toupee-Trump%3A-How-We-Used-Audio-AI-and-Deepfake-Tech-7ce56859-9ca0-4ffb-ab03-7b04463ae72d) where we explore the exciting world of audio AI and deepfake tech.
Creating an Efficient Estimation Form with ZIGAFORM: A Step-by-Step Guide
Published: 2024-05-17 18:43:02

I'll guide you through the process of crafting an estimation form using ZIGAFORM. Let's dive right in.

1. Choosing Your Template:
When starting a new form, you have the option to select a template. However, for this demonstration, I'll build it from scratch.

2. Adding Basic Elements:
Begin by adding essential elements like a heading and text boxes for common fields like full name and comments.

3. Customizing Fields:
You can tailor each field to your specific needs. For instance, I'm adding checkboxes for products and services.

4. Incorporating Calculations:
ZIGAFORM offers default calculation options, like simple addition. I'll demonstrate this before diving into more complex math calculations.

5. Enhancing User Experience:
To make your form visually appealing, consider adding images alongside text inputs, creating a more engaging interface.

6. Configuring Email Notifications:
Ensure that your form sends notifications to the appropriate recipients by configuring email settings and including necessary fields like the customer's email address.

7. Success Messages and Redirection:
After submission, users should receive confirmation. You can set up success messages or redirect them to a designated page.

8. Customizing Invoices:
For business purposes, customize invoices to include relevant information. ZIGAFORM provides options for personalization.

9. Global Settings:
Adjust global settings to control aspects like scrolling behavior, currency format, and enabling features like reCAPTCHA for added security.

10. Preview and Testing:
Before publishing your form, always preview and test it extensively to ensure everything functions as intended.

11. Integration with WordPress:
If you're using WordPress, ZIGAFORM seamlessly integrates, allowing you to embed forms directly into your website's pages or posts.

12. Next Steps:
In the next video, I'll demonstrate how to implement custom math calculations for more intricate estimation processes.

Conclusion:
That concludes our walkthrough of creating estimation forms with ZIGAFORM. 

More info at https://zigaform.com

{% youtube https://youtu.be/uPypNQILtdE?si=jjxEXtshuNDyBuRI %}
Exploring fields of Zigaform Estimator Form Builder
Published: 2024-05-17 18:38:40

In this concise overview, we delve into the functionalities and capabilities of the Zigaform Estimator. From text boxes to dynamic checkboxes, this estimator offers a plethora of options to customize forms to your exact specifications.

Let's start with the basics. The Zigaform Estimator provides a range of options for text boxes, including customizable labels, sub-labels, and the ability to hide or show elements. Users can set default inputs or placeholders and tweak font settings to match their design preferences. Additionally, the estimator supports the inclusion of help blocks, validators, and conditional logic for enhanced form functionality.

Moving beyond text boxes, the estimator extends its versatility to various other input types. Text areas, checkboxes, select lists, and multi-select options all come with similar customization features, allowing users to tailor each field to their specific needs. Whether it's hiding default text or incorporating custom math calculations, the estimator offers flexibility at every turn.

But the Zigaform Estimator doesn't stop there. It also caters to more specialized requirements, such as date pickers, file uploads, and image uploads. Users can even add CAPTCHA features for enhanced security or utilize switches for toggling options.

One notable feature is the dynamic checkbox, which allows users to add images as checkbox options, complete with customizable text and pricing. Whether it's configuring layout modes or enabling quantities, the estimator empowers users to create dynamic and interactive forms effortlessly.

Furthermore, the estimator supports advanced features like panels with conditional logic, enabling users to hide or show sections based on user selections. This level of customization ensures that forms remain dynamic and responsive to user input.

For developers, integration is seamless, with options for embedding forms directly into HTML content. Whether it's WordPress or a PHP standalone version, users can easily incorporate forms into their web pages with minimal effort.

In conclusion, the Zigaform Estimator offers a comprehensive suite of tools for creating customized forms with ease. With its wide array of features and intuitive interface, it's a valuable asset for streamlining form creation processes. Whether you're a novice user or an experienced developer, the Zigaform Estimator has something to offer for everyone.

For further inquiries or assistance, feel free to reach out in the comments section. Thank you for exploring the Zigaform Estimator with us.

More info at https://zigaform.com

{% youtube https://youtu.be/yrSfhJzLd-k?si=Ops5sXjr-vPLVOJr %}
Dağıtık sistemler
Published: 2024-05-17 18:36:50

Java'da dağıtık sistemler, birden fazla bilgisayarın bir ağ üzerinden birbirine bağlanarak ortak bir hedefe ulaşmak için birlikte çalıştığı sistemlerdir³. Bu sistemler, farklı makinelerde veya coğrafi konumlarda bulunan bileşenlerden oluşabilir ve genellikle yüksek kullanıcı yüklerini idare edebilen ve yüksek erişilebilirlik sağlayan büyük ölçekli uygulamalar oluşturmak için kullanılır⁴.

Dağıtık sistemlerin temel özellikleri şunlardır:

- **Ölçeklenebilirlik**: Sistem, gerektiğinde daha fazla kaynak ekleyerek büyütülebilir.
- **Hata Toleransı**: Bir bileşenin başarısız olması durumunda, sistem çalışmaya devam edebilir.
- **Kaynak Paylaşımı**: Sistemdeki tüm bileşenler kaynakları paylaşabilir ve işbirliği yapabilir.
- **Eş Zamanlılık**: Birden fazla işlem, aynı anda paralel olarak gerçekleştirilebilir.

Java, dağıtık sistemlerin geliştirilmesi için popüler bir dil seçimidir çünkü platform bağımsızlığı, güçlü ağ ve çoklu iş parçacığı (multithreading) yetenekleri, geniş kütüphane ekosistemi ve güvenlik özellikleri gibi avantajlar sunar. Java'da dağıtık sistemlerin geliştirilmesinde kullanılan bazı teknolojiler Apache Kafka, Apache Zookeeper, MongoDB ve Google Cloud Platform gibi teknolojileri içerebilir¹.

Kaynak: Bing ile konuşma, 17.05.2024
(1) Distributed Java systems - asjava.com. https://asjava.com/java-core/distributed-java/distributed-java-systems/.
(2) Java distributed systems: Building and managing large-scale .... https://reintech.io/blog/java-distributed-systems-tutorial.
(3) Distributed Systems & Cloud Computing with Java | Udemy. https://www.udemy.com/course/distributed-systems-cloud-computing-with-java/.
(4) Distributed Systems Tutorial - GeeksforGeeks. https://www.geeksforgeeks.org/distributed-systems-tutorial/.
📚 How to see what changed in Composer files
Tags: composer, php, github, dependencies
Published: 2024-05-17 18:35:35

When reviewing a Pull Request that touched `composer.json` and `composer.lock` files you might notice that the diffs are usually pretty huge and it's almost impossible to tell what exactly happened there - which packages got added, updated, downgraded or removed? Nobody knows.

That's because [Composer](https://getcomposer.org/) stores information about all packages that should be installed in `composer.lock` together with some of their metadata. This helps to manage the dependencies efficiently and browse most information offline but there is currently no built-in way to compare these files when changed.


## How to live with that?

Don't worry, I got you. Simply install [Composer-Diff](https://github.com/IonBazan/composer-diff) plugin which allows you to easily compare any two versions of your `composer.lock` files:

```shell
composer global req ion-bazan/composer-diff
```

To run it in your repository:

```shell
composer diff # Displays packages changed in current git tree compared with HEAD
composer diff --help # Display detailed usage instructions
```

By default, it compares current filesystem version with your last committed changes (to use it locally just before committing your new changes):

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

It produces a colourful, tabulated markdown output which can be copy-pasted into your PR description for reference 🤩

Besides of generating diff for your current filesystem changes, you can compare any 2 git refs or local copies of files using `--base` and `--target` options or arguments:

```shell
composer diff master # Compare current composer.lock with the one on master branch
composer diff master:composer.lock develop:composer.lock -p # Compare master and develop branches, including platform dependencies
composer diff --no-dev # ignore dev dependencies
composer diff -p # include platform dependencies
composer diff -f json # Output as JSON instead of table
```

Did I mention it works with all PHP versions from 5.3 all the way till 8.4+?

## OK but I'm lazy

Me too! That's why I made things even easier with GitHub Actions - I'm adding [Composer Diff Action](https://github.com/marketplace/actions/composer-diff) to all my projects to enjoy an automated report in every PR.

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

Another day, another useful automation.

## OK but I don't like you

No problem, you can check out a few other tools instead:

 - [jbzoo/composer-diff](https://packagist.org/packages/jbzoo/composer-diff) - requires PHP 7.2+, no composer plugin support
 - [josefglatz/composer-diff-plugin](https://packagist.org/packages/josefglatz/composer-diff-plugin) - works only right after install/update
 - [davidrjonas/composer-lock-diff](https://packagist.org/packages/davidrjonas/composer-lock-diff) - does not work as composer plugin
How to install Wordpress Cost Estimation Form builder by Zigaform
Published: 2024-05-17 18:34:06

The process of installing the ZIGAFORM calculator plugin is straightforward and can be done in two simple methods. Let's delve into each method to understand how to get started with this powerful tool.

Method 1: Uploading the Plugin Zip File

Accessing the Plugins Section: To begin, navigate to the "Plugins" section in your WordPress dashboard.

Uploading the Plugin: Once in the "Plugins" section, select "Upload Plugin" and then choose the zip file containing the ZIGAFORM calculator plugin.

Installation: After selecting the zip file, proceed to install it by clicking on the appropriate button.

Activation: Once the installation is complete, activate the plugin to integrate it with your WordPress site.

Accessing ZIGAFORM: With the plugin successfully activated, you can now access ZIGAFORM from the dashboard panel.

Method 2: Manual Installation

Accessing the WordPress Directory: Alternatively, you can manually install the plugin by accessing the WordPress directory on your server.

Navigating to the Plugins Directory: Within the WordPress directory, locate the "plugins" folder.

Copying Plugin Files: Copy the files of the ZIGAFORM calculator plugin into the "plugins" directory.

Extracting Files (If Necessary): If the plugin files are compressed in a zip file, extract them within the "plugins" directory.

Refreshing the Page: After copying or extracting the plugin files, refresh the page to reflect the changes.

Activating the Plugin: Once the files are in place, navigate back to the WordPress dashboard and activate the ZIGAFORM calculator plugin.

By following either of these methods, you can easily install and activate the ZIGAFORM calculator plugin on your WordPress site. If you encounter any difficulties during the installation process or have any questions, feel free to leave a comment for assistance.

More info at https://zigaform.com

{% youtube https://youtu.be/Sn6HzQodK94?si=_t2R8HfR_kXpbHUC %}
Simplifying function with keyword only arguments
Tags: python, tips, development
Published: 2024-05-17 18:33:51

Picture this: you’re working with some legacy code; it has juggling multiple positional arguments passed to a function. Now you are mapping arguments to its value 🗺️ It’s like trying to catch falling knives blindfolded! 🤹‍♂️

The Original Function

```python
def validate_document(name, size, path, doc_type, owner, category, date, issue_by):
    print(f'name: {name}, size: {size}, path: {path}, doc_type: {doc_type}, owner: {owner}, category: {category}, date: {date}, issue_by: {issue_by}')

# Function call with positional argument
validate_document('test.pdf', 1024, 'home/user/', 'pdf', 'Bob', 'medical', '2023-01-02', 'Martin')

```
It's difficult to work with 🥲, right?

Worry not 😉, you can refactor it to make it better, using keyword only arguments.

Using "*" in function declaration, make sure that all the following arguments will be passed as keyword argument only.
 
Now your Improved code look like this

```python
def validate_document(name, *, size, path, doc_type, owner, category, date, issue_by):
    print(f'name: {name}, size: {size}, path: {path}, doc_type: {doc_type}, owner: {owner}, category: {category}, date: {date}, issue_by: {issue_by}')

# function called with keyword only arguments
validate_document(name='test.pdf', size=1024, path='home/user/', doc_type='pdf', owner='Bob', category='medical', date='2023-01-02', issue_by='Martin')
```

Now, only the “name” can venture forth as a positional argument, because it is before "\*". The rest arguments must be called by their true names: **size**, **path**, **doc_type**, and so on. 🗝️

If you still try to call function with positional argument you will encounter `TypeErorr` like following.

`TypeError: validate_document() takes 1 positional argument but x were given`

Now you have better code to work with which 😇

And Happy Coding!
java JAR && WAR
Published: 2024-05-17 18:32:51

Java'da **JAR** (Java Archive), Java sınıflarını, meta verileri ve kaynak dosyalarını tek bir dosyada toplamak için kullanılan bir paketleme formatıdır¹. ZIP dosya formatına dayanır ve genellikle Java uygulamalarının dağıtımı için kullanılır. JAR dosyaları, sıkıştırma özelliği sayesinde dosya boyutunu azaltabilir ve Java uygulamalarını çalıştırmak için gerekli tüm sınıfları ve kaynakları içerir¹.

**WAR** (Web Application Archive), web uygulamalarını dağıtmak için kullanılan bir dosya formatıdır². JSP'ler (JavaServer Pages), servletler, HTML, JavaScript ve diğer web kaynaklarını içerir. WAR dosyaları, web uygulamalarının sunuculara kolayca dağıtılabilmesi için özel bir yapıya sahiptir².

Her iki dosya formatı da, Java uygulamalarının ve web uygulamalarının sürüm kontrolü, dağıtımı ve yönetimi için kullanılır ve Java geliştirme ekosisteminin önemli bir parçasıdır. 

Kaynak: Bing ile konuşma, 17.05.2024
(1) JAR Nedir? WAR Nedir? EAR Nedir? | Koray PEKER. https://koraypeker.com/2018/04/04/jar-war-ear-uclemesi/.
(2) Difference between jar and war in Java - Stack Overflow. https://stackoverflow.com/questions/5871053/difference-between-jar-and-war-in-java.
(3) JAR Nedir? WAR Nedir? EAR Nedir? | Koray PEKER. https://bing.com/search?q=java+jar+war+nedir.
(4) Ear , Jar and War dosyalarının temel farkları nedir?. https://hasscript.com/1911/ear-jar-and-war-dosyalar%C4%B1n%C4%B1n-temel-farklar%C4%B1-nedir.
(5) Difference between WAR and JAR in Java - Java Guides. https://www.javaguides.net/2023/11/difference-between-war-and-jar-in-java.html.
1325. Delete Leaves With a Given Value
Tags: php, leetcode, algorithms, programming
Published: 2024-05-17 18:30:30

1325\. Delete Leaves With a Given Value

Medium

Given a binary tree root and an integer target, delete all the leaf nodes with value target.

Note that once you delete a leaf node with value target, if its parent node becomes a leaf node and has the value target, it should also be deleted (you need to continue doing that until you cannot).

**Example 1:**

![sample_1_1684](https://assets.leetcode.com/uploads/2020/01/09/sample_1_1684.png)

- **Input:** root = [1,2,3,2,null,2,4], target = 2
- **Output:** [1,null,3,null,4]
- **Explanation:** Leaf nodes in green with value (target = 2) are removed (Picture in left).

  After removing, new nodes become leaf nodes with value (target = 2) (Picture in center).

**Example 2:**

![sample_2_1684](https://assets.leetcode.com/uploads/2020/01/09/sample_2_1684.png)

- **Input:** root = [1,3,3,3,2], target = 3
- **Output:** [1,3,null,null,2]

**Example 3:**

![sample_3_1684](https://assets.leetcode.com/uploads/2020/01/15/sample_3_1684.png)

- **Input:** root = [1,2,null,2,null,2], target = 2
- **Output:** [1]
- **Explanation:** Leaf nodes in green with value (target = 2) are removed at each step.

**Constraints:**

- The number of nodes in the tree is in the range `[1, 3000]`.
- `1 <= Node.val, target <= 1000`

**Solution:**

```
/**
 * Definition for a binary tree node.
 * class TreeNode {
 *     public $val = null;
 *     public $left = null;
 *     public $right = null;
 *     function __construct($val = 0, $left = null, $right = null) {
 *         $this->val = $val;
 *         $this->left = $left;
 *         $this->right = $right;
 *     }
 * }
 */
class Solution {

    /**
     * @param TreeNode $root
     * @param Integer $target
     * @return TreeNode
     */
    function removeLeafNodes($root, $target) {
        if ($root == null) return null;

        if ($root->left == null && $root->right == null && $root->val == $target)
            return null;

        $root->left = $this->removeLeafNodes($root->left, $target);
        $root->right = $this->removeLeafNodes($root->right, $target);

        if ($root->left == null && $root->right == null && $root->val == $target)
            return null;
        
        return $root;
    }
}
```

**Contact Links**

- **[LinkedIn](https://www.linkedin.com/in/arifulhaque/)**
- **[GitHub](https://github.com/mah-shamim)**