teleren/devto huggingface dataset:
Laravel Package for Generating Local Disk Temporary URL
Tags: laravel, webdev
Published: 2023-11-03 15:22:02

A while ago I wrote an article on how you can generate the temporary URL for a local disk like we do for S3. You can read the full article here  https://dev.to/abrardev99/laravel-temporary-url-for-local-storage-driver-50of. 

I needed the same functionality in multiple projects so I ended up adding the same code again and again. So I created a [package](https://github.com/abrardev99/laravel-local-temporary-url) to achieve temporary URL generation 😍. 

## First Release 
Packages come with some nice configurations. 

This is the contents of the published config file:

```php
return [
    'disk' => ['local'],

    'middleware' => ['web', 'signed']
];
```

## Usage

### Configuration
This package needs zero configuration, just install and it's good to go. However, if your local disk is different or you want to add another disk, you can configure it. You can add multiple local disks in the config using the `disk` key. <br>

The package applies `web` and `signed` middleware on routes by default, however, you can configure middleware(s) using the `middleware` key.

### Generate Temporary URL
You can use the same syntax used for S3 disk. 
```php
Storage::disk('local')->temporaryUrl('file.txt', now()->addMinutes(5));
```
MANUAL TESTING
Tags: testing, python, manualtesting, beginners
Published: 2023-11-03 15:19:43

                 MANUAL TESTING
     Manual testing is most important in testing.In testing are divided into two parts are. 
     1.manual testing
     2.automation testing
In testing unit the manual testing is being thing is test by some tools like scrum,jira etc
In manual testing five way process is
 
1.unit testing
2.integertion testing
3.system testing
4.UI/UX testing
5.acceptance testing

1.unit testing
                  In manual testing first we start with unit testing in process .the process are many bugs are how we find first we want to check the process my one by one unit.this is called unit testing

2.integertion testing
                       First we complete the unit testing then we come for integration testing .integertion testing is check the process to all the process are linked one by one then it check its work r it has any bug are not so this is called integration testing

3.system testing
                      Complete the two testing process unit testing and integration testing and the three step is system testing.system testing is all the system are process correctly r not having any bugs are not is check by system testing


4.UI/UX testing
          ui/ux is main process in the manual testing because ui/ux is we see clearly when comparing other testing to ui/ux.we see the visual bug and unwanted is noticed by ui/ux testing


5.acceptance testing
                   All the testing is completed by ur testers finally we go for acceptance testing is very important than other testing because is the final testing and we check the all the testing process is done correct r not and next we check it clearly final we finish is testing the project go to customer and launch the project

there are types of boxs are play the important role in manual testing are,
         the three important box in manual testing
             1.black box testing
             2.white box testing
             3.grey box testing


1.black box testing
            In the black box testing is all the testing and coders are check by coder because in the black box testing coder is play important in the black box testing so this is called black box testing

2.white box testing
             In white box testing first the coder will check the all the things by using the help of black box testing then the coder will give the project to the tester and he check all the things with the help of white box testing in white box testing the tester will play the important role in  the white box tester so this is called white box testing

3.grey box testing
                In the grey box testing we compelete the two level of testings are black box testing and white box testing and we move on to grey box testing all the way of testing is compelete coders will check the project and testers will also compelete the project . the two black and white boxs are called grey box testing
SOFTWARE TESTING
Tags: software, softwaretesting, webdev, beginners
Published: 2023-11-03 15:11:15

SOFTWARE TESTING
               SOFTWARE TESTING IS A PROCESS USED TO IDENTITY THE CORRECTNESS,COMPLETENESS AND QUATILTY OF DEVELOPED SOFTWARE.ITS ALSO HELPS IDENTITY THE BUGS,MISSING REQUIREMENT BY GIVE THE CUSTOMER SIDE,ETC.IT CAN BE DONE EITHER OR MAUALLY TESTING OR USING SOME TOOLS TO IDENTITY THE REQUIREMENTS.THE SOFTWARE TESTING IS A VERIFICATION AND VALIDATION PROCESS LEVELS . IN SOFTWARE TESTING IS HAVING A LEVEL OF TESTING ARE 
               1.UNIT TESTING
               2.INTEGRATION TESTING
               3.SYSTEM TESTING
               4.UI/UX TESTING
               5.ACCEPTANCE TESTING
IN SOFTWARE TESTING WE KNOW THE MAIN TWO THINGS ARE
                1.MANUAL TESTING
                2.AUTOMATION TESTING(USING TOOLS)

MANUAL TESTING
            IN MANUAL TESTING WE IDENTITY THE BUGS,ERRORS SOME SMALL THINGS ARE WE IDENTITY LIKE FUNCTIONAL PROCESS AND WE USE MANUAL TESTING IN LOW LEVEL PROCESS OR REQUIRMENT

AUTOMATION TESTING
               IN AUTOMATION TESTING WE USE A TOOLS TO IDENTITY THE ERRORS BUGS AND WE LIKE A NON-FUNCTIONAL PROCESS
Jest Mock fetch
Published: 2023-11-03 14:50:44

```js
// Assuming you have a function that returns a Promise
function fetchData() {
  return fetch('https://example.com/data.json').then(response => response.json());
}

// Create a mock function for fetch
const mockFetch = jest.fn();

// Mock the resolved value for the first call to fetch
mockFetch.mockResolvedValueOnce({ data: 'mocked data' });

// Replace the original fetch function with the mock
global.fetch = mockFetch;

// Now, when you call fetchData, it will use the mocked value for the first call
fetchData().then(data => {
  console.log(data); // { data: 'mocked data' }
});

// You can also assert how many times the mock function was called
expect(mockFetch).toHaveBeenCalledTimes(1);

```
My first OSS PR
Tags: opensource, flutter
Published: 2023-11-03 14:41:36

So, Today I have raised a PR that I think is good to get reviewed in official Flutter repo.

https://github.com/flutter/flutter/pull/137681

It was pretty simple, I had to add support for color and color blend mode on FadeInImage. Additionally I had to pass these to construction of Image object which already supported color and colorBlendMode. Added some tests reffering to other widgets and done.

I will be waiting for review on this one while hunting on working on another interesing PR. This time a bit more complicated to better my flutter skills.


Life updates:
Today I met a very close friend after a very long time. It was a nice day overall.
Best Youtube channels about Python
Tags: python, tutorial, beginners, programming
Published: 2023-11-03 14:41:21

Hi, in today's article, I would like to show you the list of Youtube channels about Python programming which I enjoy watching. If you know other channels not presented here, please share them in the comments.

**The list is presented in random order!**

# 1. Pixegami
https://www.youtube.com/@pixegami/featured
On this channel, you can find a complete Python course from scratch, tutorials on AWS, Docker, FastAPI, and much more. The materials are of a high standard and everything is well presented. There aren't many movies there, but you'll find something for yourself.
I recommend this movie - https://www.youtube.com/watch?v=Hiabp1GY8fA thanks to it, I easily created a simple website for a client, bought my first domain, and got to know the Vercel website
## 2. ArjanCodes
https://www.youtube.com/@ArjanCodes/videos
This channel has almost 300 videos and you can find many Python topics here.
I especially recommend older videos on software architecture and the "Code Roasts" series.
## 3. Coding Crashcourses
https://www.youtube.com/@codingcrashcourses8533/featured
This is a channel created for fans of all language models. Here you will find a lot of guides about the LangChain library and something about FastAPI
## 4. NeetCode & NeetCodeIO
https://www.youtube.com/@NeetCode/videos
https://www.youtube.com/@NeetCodeIO
Currently one of my favorites, you will find a lot of videos about algorithms and data structures here. If you have a problem with a task on Leetcode, check if it has not already been discussed on this channel.
I also recommend visiting his website - [neetcode.io](https://www.youtube.com/redirect?event=channel_header&redir_token=QUFFLUhqbXZKblNJMlBKcl9JdjAyQWh5Nzg3YmpybUpzUXxBQ3Jtc0tuTGc2R3IwZVJFVEE0U2pwZWFLVXpQdlpqQ2NaSEZjY3ctZG1hVWZQbE1kQThObmFucHBrMWNtMWl2R3ROcV8wQlF6TkU3cno4bHBNeVZ5YmhWSjZJZzB4WW4xWWdXZ0xkOURZTmM3clJKWjJVckdhSQ&q=https%3A%2F%2Fneetcode.io)[](https://www.youtube.com/@NeetCodeIO/about) where you will find a roadmap for learning algorithms through tasks on leetcode.
## 5. Indently
https://www.youtube.com/@Indently/videos
This is my new discovery, the channel has 763 and you can find videos about many programming languages ​​here. Currently, I am starting a series about a not-yet-very popular framework - Flute
## 6. thenewboston
https://www.youtube.com/@thenewboston/featured
From this channel, I highly recommend the "Python and React" and "Pro Django" series. If you want to deepen your knowledge of Django, this is a great place
## 7. Django road
https://www.youtube.com/@djangoroad/videos
Short and often interesting videos on various topics from the Django framework
Rails Models Files Organization
Tags: rails
Published: 2023-11-03 14:40:49

Just a place where to come back in the feature when I forget how to organize my Rails Models.

```
class MyModel < ActiveRecord::Base
  # extends 
  # includes 
  # relationships 
  # validations 
  # callbacks 
  # scopes 
  # delegates
  # additional config (i.e. accepts_nested_attribute_for etc...) 
 
  # class methods 
  # public instance methods 
  # protected instance methods 
  # private instance methods 
end
```

It is worth mentioning or thanks to this project [rails_standards](https://github.com/hopsoft/rails_standards)
The place where I found this guide.
Diving into Open Source
Tags: hack23contributor
Published: 2023-11-03 14:40:38

<!-- ✨This template is only meant to get your ideas going, so please feel free to write your own title, structure, and words! ✨ -->

### Intro
<!-- Share a bit about yourself as a contributor. Is this your first Hacktoberfest, or have you contributed to others? Feel free to embed your GitHub account by using {% embed LINK %} -->
Hi! I'm a 3rd year CS major from Pondicherry University, India.
This was the first time that I was participating in Hacktoberfest. Before this, I was never a part of any such open-source program. It was in the back of my mind, but every time I tried to look into a repository, I was overwhelmed. But this time, I resolved to take it seriously. Luckily, I found some typos and syntax errors on the websites of 'FullStackOpen' and 'Next.js'. I quickly jumped on the opportunity and learned how to make pull requests. Eventually, those pull requests got merged, and I completed my first ever Hacktoberfest.
Umrah Packages 2024
Published: 2023-11-03 14:29:05

Looking for [Umrah Packages 2024](https://newswirepost.com/2023/11/01/planning-your-umrah-journey-in-2024-exploring-umrah-packages/)? If you're in search of Umrah packages for the year 2024, you've come to the right place. We offer a variety of Umrah packages for 2024 that cater to your specific needs and preferences. 

**Website:** https://newswirepost.com/2023/11/01/planning-your-umrah-journey-in-2024-exploring-umrah-packages/
**Address:** 84 Kingsley Rd, Hounslow TW3 1QA, UK
**Phone:** 0203 930 0817
💰Boost your game/app earnings 📱
Tags: android, programming, mobile, gamedev
Published: 2023-11-03 14:28:35


📈 Did you know that besides displaying ads, there are other ways to continue monetizing your app/game?

## Discover An Innovative Monetization Technology

## How Does It Work?

This SDK revolutionizes monetization without showing intrusive ads. It helps businesses gather information that is publicly available on the web. It uses the user's network device information to anonymously index public data from well-known websites and product listings on online stores (Amazon, Ebay, MercadoLibre, etc.) from recognized sites on the Internet. This is done in a way that never interrupts the user and fully complies with GDPR/CCPA regulations. Subsequently, web pages are sent to businesses as data structures.

## What Does Netsocks SDK Offer You?

- **Higher Earnings:** Our SDK is compatible with other traditional monetization systems, so you don't have to change your current monetization model.
- **No Dependency on the Play Store:** Use our SDK regardless of where your applications are published. Your app doesn't have to be on the Play Store. Monetize your APK!
- **Easy Implementation:** Integration is in three simple and customized steps. You only need your Publisher Key!
- **Transparency:** We do not collect sensitive or personal user information. Our privacy policies are constantly updated and available to the public.
- **Estimate Your Earnings:** Calculating your income is easy. By knowing the average number of active users per month, you can assess your performance.
- **Allows Adult Content Applications:** Useful if you are an adult content creator and need to generate extra income.

Get more info: 📩 connect@netsocks.io
What is Mysoftbox
Published: 2023-11-03 14:22:13



Mysoftbox is a consultancy firm, which includes various specializations in tax auditing, compliance management, financial consulting, software development, and digital marketing services. In addition, with our extensive industry experience, technical expertise, and deep understanding of tax regulations, we offer tailored solutions for our clients’ unique needs. 

 

Overall, we’re your one-stop destination for comprehensive business optimization. Moreover, our commitment to excellence ensures your financial growth, legal compliance, online presence, and technological advancement.
F-Strings
Tags: python, coding, programming, devpride
Published: 2023-11-03 14:09:35

I'm keen to see how f-strings work with the programme I wrote in my previous post. I was advised that they're much easier to work with and less prone to error.

---

so...

I have a lot of boxes of eggs in my fridge and I want to calculate how many omelettes I can make. each box of eggs contains six eggs and I need four eggs for each omelette.

---

![Pycharm image of code to run the above task: number_of_eggs_needed_to_make_an_omlette = 4
number_of_eggs_in_a_carton = 6
number_of_egg_cartons = 9
total_eggs = number_of_egg_cartons * number_of_eggs_in_a_carton
omlettes = total_eggs // number_of_eggs_needed_to_make_an_omlette
left_over_eggs = total_eggs % number_of_eggs_needed_to_make_an_omlette
message1 = f'there are {total_eggs} eggs in total, this means you can make {omlettes} omlettes with {left_over_eggs} eggs left over'
print(message1)](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6o3z9kxrxo9a8xqnso20.jpg)

`'to make 25 omlettes, you will need 100 eggs. That means you need to buy 16 cartons of eggs'`

`'there are 54 eggs in total, this means you can make 13 omlettes with 2 eggs left over'`

---

It's a lot easier to figure out which placeholder represents which variable, so the code is a lot easier to read. I'm also happy to see the code shrink a bit!

---
VoiceOver quick start
Tags: a11y, webdev, development, tutorial
Published: 2023-11-03 14:04:40

VoiceOver is a screen reader that comes installed on all Apple computers. This article will serve as a quick introduction to some of the basic commands to help you get started using a screen reader on any website. VoiceOver will work in any browser but does work best in Safari. 

The VoiceOver command keys will be used for almost every command going forward. I will refer to the command as `VO` which can be either of these:
- `caps lock`
- `option + command`

Start VoiceOver - `command + F5`
Select `use VoiceOver`

It might start reading off all the elements on a webpage without taking a break and this can be a little overwhelming. 

Stop VoiceOver from auto reading - press the `control` key.
Start reading again - `VO + a` 
I wouldn't suggest auto reading for a first-time screen reader user. For now, let's take it one element at a time. 

In the case that the whole browser is selected (you will see an outline around the whole app):
Interact with the item (the browser in this instance) - `VO + shift + down`
Stop interacting with an item - `VO + shift + up`
This can also be thought of like navigating levels of a directory.

If the tabs or address bar are selected, you will use 
`VO + up` or `VO + down` until the content of the webpage is selected.

Once the web content is selected,
navigate between elements on the page:
`VO + left arrow` 
`VO + right arrow`

Open Rotor: `VO + u`
This tool is really interesting because it organizes the content of the website in a completely different way than what sighted users are used to seeing. Rotor breaks down the content into several different categories: links, headings, form controls and landmarks.  

You can navigate between the Rotor sections with the arrow keys.

Since starting to test the sites that I'm developing with a screen reader, I've found:
- "read more" or other vague text in buttons are not helpful. Give buttons like this descriptive aria-labels
- images declared in the content property of pseudo-elements will be read, even though there's no alt or title. 
- it's important to connect your labels to your inputs using `id` and `for`
- use html table elements instead of creating a table visually with divs

It is worth exploring how to use screen readers and other assistive technologies in order to become a more empathetic developer. VoiceOver is a great tool that is readily available to all Mac users. While VoiceOver comes with its own tutorial, I found it a bit long and slow but it is definitely worth doing when you have the time. 

To see the whole list of commands:
[Apple - VoiceOver commands](https://www.apple.com/voiceover/info/guide/_1131.html)
Placeholder Contributor
Tags: hack23contributor
Published: 2023-11-03 13:56:04

<!-- ✨This template is only meant to get your ideas going, so please feel free to write your own title, structure, and words! ✨ -->

### Intro
<!-- Share a bit about yourself as a contributor. Is this your first Hacktoberfest, or have you contributed to others? Feel free to embed your GitHub account by using {% embed LINK %} -->

### Highs and Lows
<!-- What were some of your biggest accomplishments or light-bulb moments this month? Did any problems come up that seemed impossible to fix? How did you adapt in those cases?  -->

### Growth
<!-- What was your skillset before Hacktoberfest 2023 and how did it improve? Have your learning or career goals changed since working on these new projects? -->
Error Handling in JavaScript
Tags: webdev, javascript, beginners, programming
Published: 2023-11-03 13:54:22

Are tired of Errors?
Lets learn error handling in JavaScript in 60 seconds.

There are multiple types of error:
Syntax error, reference error Type Error, Range Error

we can deal with this by wrapping the block of code in try block
and catch the potential errors in catch block. This will prevents you program from crashing.


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


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


Beside the generic catch block you can catch specific type of error and preform action according to it.


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


There is one more thing the finally block.
it’s useful as it gets exceuted regardless of weather an error occurs or not.
It’s commonly use to perform cleanup operation.

This Is TI, SAYONARA
Ready to use Google Colab to finetune SDXL + T2I Sketch Adapter 🤖🤯
Tags: opensource, design, tutorial, ai
Published: 2023-11-03 13:54:13

1. https://github.com/norflin321/ml/blob/main/SDXL_autotrain_dreambooth.ipynb - open this colab, put your 1024x1024 images inside "./images" folder, and run all cells, after ~20 min it "pytorch_lora_weights.safetensors" file is ready to download from google colab.

2. https://github.com/norflin321/ml/blob/main/SDXL_sketch2img.ipynb - open this colab, put "pytorch_lora_weights.safetensors" file inside "./finetuned" folder, run all cells, first run will take ~5min, then 40 seconds to generate an image with SDXL finetuned on your images + your sketch image + your prompt

Good, fast, free, predictable results! 🤖🔥🤗
Scraping HackerNews with GPT-4
Published: 2023-11-03 10:34:46

I wanted to share a project I recently created - An automated scraper for that can scrape any website and store the text content as JSON using GPT. I thought this might be helpful for anyone interested in scraping data or working with APIs.

## Step 1: Tech Stack
After exploring various ways to achieve this, I opted for a no-code solution. In the end I chose the no-code platform [Clevis](https://clevis.app) to cobble together the required steps and automate the process by running it on a daily schedule.

## Step 2: Scraping the content

By using an HTTP Request step in Clevis, I can make a GET request to any website and scrape the text content.

![HTTP Request](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qd25e1fuzuj44sydushd.png)

## Step 3: Using ChatGPT to parse the content as JSON

Next, I use the scraped text from HackerNews and prompt ChatGPT to create a JSON object with a schema that I provide in the prompt. In this screenshot, the scraped text is referenced as `steps.scrape.output`.


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

## Step 4: Storing the result

Now that ChatGPT has provided me the result, I can store it in my own database with another HTTP Request step that calls an API I built.

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

## Step 5: Scheduling

By enabling a schedule in Clevis, I can have this run daily to store the top HackerNews posts for later curation.