teleren/devto huggingface dataset:
AINIRO Oracle, the Cut the Crap Search Engine
Tags: chatgpt, openai, machinelearning
Published: 2023-07-09 13:28:21

I spent a couple of hours today and yesterday and created [AINIRO Oracle, the Cut The Crap Search Engine](https://oracle.ainiro.io). My motivation? I'm tired of wading through tons of garbage when I search for things.

For instance, trying to figure out what year the book 1984 was published requires reading through entire sections of the Spanish Civil War, George Orwell's birth, 11 of his 47 marriages, how they ended, and who his wifes had as their siblings - For then to skim through his claim to fame, etc. Finding simple facts like these typically takes 30 minutes. With our search engine, finding the answer takes 30 seconds.

* [When Was The Book 1984 Published?](https://oracle.ainiro.io/articles/when-was-the-book-1984-published-vrzgzisbhv)

Basically, 5 orders of magnitudes improvement compared to WikiPedia.

> For crying out loud, I was looking for a simple number, the number was 1949!

Of course, the very first question in the system had to be [what is 42](https://oracle.ainiro.io/articles/what-is-42-wqb4cudi6s) for obvious reasons.

## This is NOT a Search Engine

Warning, this is _not_ a search engine, it's a _"question/answer machine"_. We've added a little bit of finesse to make that clear too. You have to finish your question with a `?`. If you don't, the system will refuse to answer you. This is to separate us from other search engines where you typically phrase questions in cryptic quasi English, such as _"site:stackoverflow.com cohesion encapsulation polymorphism"_.

> This is a _natural language answer machine and not a search engine_!

## Argument killer machine

Another one of its features I suspect will be highly useful, is as a _"source provider"_ every time some schmuck at Facebook asks you for a source. We've even explicitly added sources at the bottom of all articles to make this clear, allowing you to phrase your question to our oracle machine, copy the URL, and paste it into some stupid Facebook debate where some schmuck asks you for a source, for then to simply move on with your life ...

Internally it's using DuckDuckGo and ChatGPT, and you will get a link to DuckDuckGo's search results, and the article will be cached. If you ask a question somebody else asked previously, or your question has a _"similarity"_ of 90% or more, and the answer previously provided is less than 5 days old - The machine will return the previous answer. This is to reduce the token count, and conserve database space.

Psst, feel free to share whatever answers it comes up with anywhere you wish. _"Re-using"_ answers in debates and such, was a big part of our motivation to create this.
Can you explain the meaning of '^1.2.3' in a package.json file?
Published: 2023-07-09 13:23:38

In this post, let's dive into npm versioning together and uncover its significance!

🌟 npm Versioning Basics:

1️⃣ Major Version (X.y.z): Signifies significant changes, often incompatible with previous versions.

2️⃣ Minor Version (x.Y.z): Introduces new features while maintaining backward compatibility.

3️⃣ Patch Version (x.y.Z): Reserved for bug fixes and minor updates, with no new features.

🌟 Symbols:

1️⃣ Tilde (~):

~ allows patch updates and compatible bug fixes.
Example: ~1.2.3 includes 1.2.4, 1.2.9, but not 1.3.0.

2️⃣ Caret (^):

^ includes minor and patch updates, including new features.
Example: ^1.2.3 includes 1.2.4, 1.3.0, but not 2.0.0.

🤔 So, how can we use this knowledge in our projects?

1️⃣ If you're developing an open-source library:

🌟 Increment the major version for breaking changes and major updates.

🌟 Increment the minor version for introducing new features and enhancements while maintaining backward compatibility.

🌟 Increment the patch version for bug fixes and minor updates that don't introduce new features.

2️⃣ When using someone else's library.

🌟 Use the ~ (tilde) symbol to allow patch updates and compatible bug fixes.

🌟 Use the ^ (caret) symbol to allow minor and patch updates, including new features.

🌟 Specify an exact version (without symbol) when you want to be precise about the dependency version used.

Happy coding!
Threads Video Downloader Online
Tags: webdev, programming, frontend
Published: 2023-07-09 10:32:46


![Threads Video Downloader Online](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0w0ecvlqhq9d7rqiv8an.png)

## What is threads
Threads is Meta’s text-based Twitter rival. It is tied to your Instagram account, so you can create an account by logging in using your Instagram credentials.

Threads is a popular social media platform that allows users to send and read short messages called “threads.” It was created in 2023 by Meta, and is growing very fast.It is the biggest competitor of Twitter

**[Visit Threads Downloader](https://www.threadsdownload.xyz/)**

## Easy Steps To Download Videos From Threads
Threads Downloader is a free online Threads downloader. Threads videos and photos can be downloaded and saved for free with no speed restrictions. Simply paste the link and the download will begin instantly. To download a video from Threads, simply copy the link and paste it into the URL field above.

**[Visit Threads Downloader](https://www.threadsdownload.xyz/)**

**Steps**
1)Copy the URL of the Threads video which you want to save.
2) Paste the Threads video copied URL in the URL field above.
3) Then click the Download or the Enter key.
4) When downloaded successfully select your preferred file quality choose Mp4 for video format and Mp3 for Audio format

## The online Threads video downloader is free to use
Yes, it is always free and there is no limit on the number of downloads. So, It is up to you to decide on how much content to upload.

## Can I download any video from Threads using this downloader?
The availability of video downloads depends on the privacy settings and permissions set by the users who shared them on Threads. Some videos may not be downloadable due to privacy restrictions or the choices made by the content creators.

## Our Threads Video Downloader is user-friendly
You don’t have to sit for hours and hours figuring out how to download video from Threads. We”ve made the download scheme as simple as possible for you to save Threads videos in no time at all.

## Why you should use Threads Online Video Downloader
1.No spammy advertisements and pop-ups like other websites.

2.Faster downloading in comparison to other websites.

3+100 free tool to download Threads videos.

4.No logins and signups.

**[Visit Threads Downloader](https://www.threadsdownload.xyz/)**
How to Test React Component Using Jest
Published: 2023-07-09 13:14:28

In this tutorial, we will learn how to do unit testing to a react component using Jest. Jest is a testing framework that works with react, node, vue, and other tools with focus on simplicity. Unit test aim to make sure that one component is behave as expected despite many variations of props passed to it. The expectation here could be come from the design system.

Some of the benefit of unit testing are:
Make sure the code, design, implementation is behave as expected.
Give the developer confident when about to do some refactoring, knowing that they have safety net about the component code.
For the record I will use nextjs in this tutorial. Follow the installation guide on nextjs docs about jest here. After the step is done, now we are good to go.

_Ok let’s get to the code_

Let’s start by creating a test file with .test.ts(.test.js if you use js) extension. Where to place the file is about your preference, but there are convention to place it within the __tests__ folder in the root folder or next to the component itself. So for example if you have button/index.tsx, then the test file would be in the button/index.test.ts, right next to the component file.

Ok let’s start importing some stuff to begin with

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

We import import ‘@testing-library/jest-dom’; so we can get access to test the DOM state, and some essential utilities from @testing-library/react to test the component.

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

This is what a single test block look like. First give the test a clear name so we can undertand it better. You can render any component within the render method, in this case we want to render the button with a text within it. Render method return various function to assert the DOM state, but there we are destructuring the getByText function. Within the getByText function, you can use a string to find a text or a regex expression as well.

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

Another example is when we want to test the interaction with the component, we want to check if the onClick function actually called when we tapped on the button, we could create a mock function by writing let fn = jest.fn(); then pass it as a function to onClick props. Render the component, after it rendered, we fire an event by calling fireEvent.click. To target which DOM to click, we need to find it by findByText. Then we can expect the mock function fn is have been called.

If we run yarn test in the terminal, we can see the result as below.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zf52a63tx40g9bbe54rs.png)
Predictive Maintenance with t6 IoT Platform and Temperature Sensors
Tags: javascript, programming, machinelearning, tutorial
Published: 2023-07-09 12:52:01

Predictive maintenance is a proactive maintenance approach that utilizes data analysis and machine learning techniques to anticipate equipment failures before they occur. By monitoring and analyzing sensor data, such as temperature readings, predictive maintenance aims to detect early warning signs of anomalies or degradation in equipment performance.

This enables timely maintenance actions, minimizing unplanned downtime, optimizing maintenance schedules, and reducing costs. In this way, predictive maintenance helps businesses enhance operational efficiency, extend asset lifespan, and improve overall productivity.

t6 IoT platform is now capable of [predict equipment failure based on custom AI Models](https://www.internetcollaboratif.info/post/implementing-predictive-maintenance-with-t6-iot-platform-and-temperature-sensors/?utm_source=article&utm_medium=devto&utm_campaign=article_link&utm_term=machine-learning).
I've written a recipe on how to implement such data prediction using t6 IoT.

This new feature is developped as beta version on t6. Please send me any feedbacks.
Experience in Building My First SaaS Product as a Non-Technical Entrepreneur
Tags: devops, ai, testing
Published: 2023-07-09 12:20:10

As an entrepreneur and digital marketer without any programming knowledge, I've always had a strong interest in developing a digital product. However, with my focus on growing my digital marketing agency, finding the time to acquire new skills proved challenging.

In November 2022, I delved deep into Generative AI research, realising that many entrepreneurs and teams were already working on developing AI products. This sparked my motivation to dive into this emerging market and be a part of the early stages of the AI industry.

While contemplating the various problems that generative AI could solve, I initially considered creating an ad copy generation product. However, after conversations with industry peers, I discovered existing solutions like Jasper.ai, Copy.ai, and Quillbot. This led me to rethink my approach and explore alternative avenues.

During this time, I was heavily involved with Figma, using it for product design, creative design, and even writing papers. It struck me that developing a Figma Plugin for UX copywriting could be a valuable contribution. I spoke with designers in the field, and their validation solidified my decision.

I hired a fresh graduate and together we embarked on the development journey. In just a month, we made significant progress and built a prototype. At this stage, my focus shifted towards marketing the product, which proved to be a different ballgame from the local market I was accustomed to.

Building connections and developing a personal brand emerged as crucial strategies. However, I quickly realised how challenging it was to grow my social presence, particularly on platforms like Twitter, LinkedIn, and Product Hunt. Spending extensive time manually interacting with people became difficult to manage amidst my busy schedule. This inspired me to think of a solution—an automation tool that could save time and effort for individuals facing a similar problem.

Putting my UX copywriter plugin project on hold, I discussed the idea with my developer. Although he wanted to finish the current project first, I was fascinated and immediately began working on it.

After thorough research, I decided to build a tool that provides one-click automated replies for Twitter, LinkedIn, and Product Hunt, helping people save time and effort. My team and I outlined the development process, concluding that a Google Chrome Extension would be the ideal product format. 
We successfully developed the product, created a landing page, and established social media presence. Now, it's time to see how my first SaaS product performs!

If anyone would like to test it out, here's the link—it's completely free for now: 
https://chrome.google.com/webstore/detail/replymindai/icgdnaedamjhnmnomlhkifmkjkijnibb

I highly appreciate your valuable thoughts and suggestions.
Thank you!
How to Fix Port 80 is in use Laragon on Windows
Tags: laragon, armanrahman, errors, fix
Published: 2023-07-09 12:00:51

Sometime Laragon Shows "Port 80 is in use" On windows. 


![Error Screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hf1zl1a4yebxmh9jkzwq.png)

Sampley follow those steps.

1. Right Click on This PC" and Select Manage - 

![Screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jhsj4dq7vt8pqrscftsl.png)

2. After that go to Service and Application > Services 

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

3. Search for "World Wide Web Publishing Service" Click on Stop!


![Final Screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/henon3yq0bo99rpynv61.png)

Hope Your Issue will resolve In-sha-Allah.
Mongoose stopped accepting callbacks for some of its functions：Model.find() Model.insertMany()
Published: 2023-07-09 11:43:58

```
// old way (deprecated)

Model.find(function(err, models){
  if (err) {
    console.log(err);
  }else {
    console.log(models);
  }
});


// Model.find()  new way

Model.find()
.then(function (models) {
  console.log(models);
})
.catch(function (err) {
  console.log(err);
});

// Model.insertMany()
Fruit.insertMany([kiwi, orange, banana])
        .then(function () {
          console.log("Successfully saved defult items to DB");
        })
        .catch(function (err) {
          console.log(err);
        });
```
Why You should Start Contributing to OpenSource
Tags: beginners, programming, database, webdev
Published: 2023-07-09 11:38:12

My journey in the world of open source projects began last summer when I decided to dive into the Bitcoin project. However, I quickly realized that navigating through the vast amount of resources available was quite overwhelming. In this article, I will share some simple ways to overcome this challenge and provide insights on why you should start contributing to open source projects.

Firstly, it's important to note that not all open source projects require contributions from regular contributors. Some projects are developed and maintained by a core team, while others actively seek contributions from the community. Before diving into a project, it's essential to understand the project's goals, development process, and whether they encourage community contributions.

One interesting aspect of contributing to open source projects is the opportunity to refactor code written by others. While we often hear about the importance of refactoring our own code, exploring and improving someone else's code can be equally intriguing. It allows us to analyze different coding styles, thought processes, and approaches to problem-solving. Open source projects offer a chance to engage with code written by talented developers and learn from their expertise.

When you dive into the world of open source, you'll encounter a diverse range of projects. To get started, it's helpful to narrow down your search by identifying specific open source projects that align with your interests and skills. One of the best platforms to discover open source projects is GitHub, which hosts a vast amount of public code repositories. You can browse through different projects, explore their issues and discussions, and find opportunities to contribute.

If you're unsure where to begin, websites like [Up For Grabs](https://up-for-grabs.net/) can be valuable resources. They curate lists of open source projects that actively seek contributions, making it easier for you to find projects that are suitable for your skills and interests. These platforms provide a starting point for your research and help you navigate the vast space of open source projects.

now, what you are waiting for check the [AGE](https://github.com/apache/age/issues) and pull some requests.
SecurityBoat June CTF solution
Tags: jwt, security, ctf
Published: 2023-07-09 10:16:51

SecurityBoat posted the following CTF [challenge](http://ctf.securityboat.in:4000/jwt/) on their Twitter account.
{%embed https://twitter.com/Securityb0at/status/1677535489014759425 %}
The challenge was to get to the admin dashboard and retrieve the flag. Initial credentials were provided on the login screen.

Upon logging in, we see two cookies being returned from the server: `auth` and `pubkey`.

![Server response headers](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/am4m9xf4nmtoilhxgaqi.png)

The `auth` cookie is clearly a JWT token, so we can use a tool like [jwt.io](jwt.io) to inspect its contents.

![JWT contents](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4vaszcl0zpi6vvnphx2q.png)

Notably, the token uses RS256 (asymmetric) encryption and specifies a `role` field within its payload. 

Upon logging in, we are redirected to `http://ctf.securityboat.in:4000/jwt/user/home.php`.

With all that said, our likely attack methodology is the following:
* Replace the `user` value with `admin` within the `role` field of the token,
* Find a way to sign the token 
* Using the token, navigate to `http://ctf.securityboat.in:4000/jwt/admin/home.php`

Since we know the public key used in the RS256 encryption, we can attempt an **algorithm confusion** attack. This type of attack takes advantage of inexact token handling on the backend, by replacing the `alg` field in the token header with `HS256` and using the exposed public key as an HMAC key. We can use jwt.io for modifying the necessary fields (`role` and `alg`) and sign the token with [JWT_Tool](https://github.com/ticarpi/jwt_tool). 

The command to do so looks like the following:
```
python3 jwt_tool.py INSERT_MODIFIED_TOKEN_HERE -S hs256 -k public_key.pem
```
..where `public_key.pem` is the file that contains the RSA public key returned from the server during initial login (make sure to URL-decode the key before saving).

After JWT_Tool returns the tampered token, we can use Chrome to modify the cookies within the current session:

![Modifying cookies with Chrome](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wigmxfxoguc9i8jiiqe7.png)

After navigating to `http://ctf.securityboat.in:4000/jwt/admin/user.php`, we get the flag.

![Victory!](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hevxncma7frtzdag7xgt.png)
Hello World - Blocksver
Tags: webdev, programming, tutorial, beginners
Published: 2023-07-09 10:06:06

## Creating An Account / Login
Visit [Blocksver - Register](https://www.blocksver.com/register)
And create a new account or login at [Blocksver - Login](https://www.blocksver.com/login)

## Creating A New Project
Visit [Blocksver - Dashboard](https://www.blocksver.com/dashboard) 

Enter project name and click Create Project

![Creating new project](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/akw85gmdtqpvk6c5d8of.png)
Now open the project


![Creating new route](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qyf5e2tkg946lz8sok08.png)
Click + Icon


![Routes](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3tojvsbl3f8cu3b02ns8.png)
Click Edit


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5zryx4qu8wf3x8kjdfyc.png)
Click + Icon and click Return


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e99cy470x4f7fe8h3nmd.png)
Type
```
"text": "Hello World"
```
In the JSON Input field



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/av8ojvwxfjrbaw3j55jh.png)
Click Save Code on the top right hand corner to save your current code and click Editor button to go back to your current project


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x1dcfpro47zbldb3cotc.png)
Click Build EXE to download your executable for your REST API server.
Forward click on other page
Published: 2023-07-09 10:03:42

So you have some element on other page that you need to click when that page is opened from page you're at. 
You have `<a>` in `index.html` and when that clicks, it needs to open `projekti.html` and click on respective `<a>`. 
Depending which one you want to click, on `projekti.html` you assign `id`, and in `index.html` you put `<url_to_other_page>#<id_of_other_element>`


And in `projekti.html` you put script tag before closing `<body>`
``` 
<script src="js/my_js.js"></script>
```
------

Full code:

`index.html`

```html
<li>
 
 
                  <a href="index.html">Početna</a>
                </li>
 
                <li class="nav__dropdown">
                  <a href=""> Projekti </a>
                  <i class="ui-arrow-down nav__dropdown-trigger"></i>
                  <ul class="nav__dropdown-menu">
                    <li>
                      <a href="projekti.html#stambeno">Stambeno - Turistički objekti</a>
                    </li>
 
                    <li>
                      <a href="projekti.html#upravni">Upravni objekti</a>
                    </li>
                    <li>
                      <a href="projekti.html#industrijski">Industrijski objekti</a>
                    </li>
                    <li>
                      <a href="projekti.html#javni">Javni objekti</a>
                    </li>
                    <li>
                      <a href="projekti.html#enterijer">Enterijer</a>
                    </li>
                  </ul>
                </li>

```


`projekti.html`
```html
  <div class="portfolio-filter text-center">
            <a href="#" class="filter active" data-filter="*">Svi</a>
            <a href="#" id="stambeno" class="filter" data-filter=".stambeno">Stambeno - Turistički</a>
            <a href="#" id="upravni" class="filter" data-filter=".upravni">Upravni objekti</a>
            <a href="#" id="industrijski" class="filter" data-filter=".industrijski">Industrijski</a>
            <a href="#" id="javni" class="filter" data-filter=".javni">Javni objekti</a>
            <a href="#" id="enterijer" class="filter" data-filter=".enterijer">Enterijer</a>
          </div>


... 
  <script src="js/my_js.js"></script>
</body>
... 

```



`my_js.js`
```js

 window.addEventListener('DOMContentLoaded', () => {
     
    if (window.location.hash) {
      const target = window.location.hash.substring(1); 
 
      // Trigger click event on the corresponding element
      const element = document.getElementById(target);
      if (element) {
        element.click();
      }
    }
  });




```