teleren/devto huggingface dataset:
Sharing composable state in Vue apps
Tags: vue, typescript, javascript, tutorial
Published: 2024-06-17 10:48:06

When I started my web development career with Vue, back then we were using Vue 2 and Vuex to implement a global state management tool. I liked this approach because it allowed to create reactive values globally in apps that are easily accessible and that could be modified when needed. 

However, right now you could achieve something similar by using the composables and have a global state there. This approach is more like Vue 3 compatible with the usage of composables, script setup, and other DX utils that come natively with the framework.

In this article, I want to introduce you to the concept that I am using both in my work and hobby projects.

Enjoy!

## 🟢 Sharing composable state in Vue apps

Normally, when we create a composable, we usually do it like the following:

```ts
import { ref } from 'vue'

export const useWishlist = () => {
  const wishlist = ref({})

  const addToWishlist = (key, value) => {
    wishlist.value[key] = value
  }

  return {
    wishlist,
    addToWishlist,
  }
}
```

First, we create a new composable function
Next, we create a reactive `ref` variable that will store the state
Furthermore, we create a funtion that modifies the state.
And finally, we return all this as a part of the composable.

This approach certainly works but each call of the `useWishlist` composable will generate a new `wishlist` variable.

Sometimes, we may want to have a global reactive property that would be responsible for storing the state of the customer's wishlist. How do we do that then?

The only small different that we need to do here to achieve that is to move registration of `wishlist` variable, outside of the `useWishlist` composable like following:

```ts
import { ref } from 'vue'

const wishlist = ref({})

export const useWishlist = () => {
  const addToWishlist = (key, value) => {
    wishlist.value[key] = value
  }

  return {
    wishlist,
    addToWishlist,
  }
}
```

This way, whenever we access the `useWishlist` composable, the value of `wishlist` will be the same globally. Thanks to this approach we can trigger `addToWishlist` method from multiple places in the application and have the `wishlist` variable being updated automatically.

If you would like to learn more about composables, check out the official docs [here](https://vuejs.org/guide/reusability/composables.html).

## 📖 Learn more 

If you would like to learn more about Vue, Nuxt, JavaScript or other useful technologies, checkout VueSchool by clicking this [link](https://vueschool.io/courses?friend=baroshem) or by clicking the image below:

[![Vue School Link](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j7hlfz848ut2d9ly8i8q.png)](https://vueschool.io/courses?friend=baroshem)

It covers most important concepts while building modern Vue or Nuxt applications that can help you in your daily work or side projects 😉

## ✅ Summary

Well done! You have just learned how to share composable state in your Vue app. 

Take care and see you next time!

And happy coding as always 🖥️
What is your strategy to promote Rust?
Tags: rust, programming, learning
Published: 2024-06-17 10:42:37

---
title: What is your strategy to promote Rust?
published: true
description: Promoting Rust can be done by providing a platform to all the people who would like to showcase the fun things they do with Rust.
tags: rust, programming, learning
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2024-06-17 10:31 +0000
---

I was asked in our most recent [virtual event](https://workshops.code-maven.com/): What is your strategy to promote Rust?

My short answer was that I don't have a strategy as I don't see as my goal to make companies switch to Rust. Besides, who am I to be able to convince companies to switch to Rust?

Thinking about it a bit more I realized I do have a strategy.

I would like to make Rust more accessible, easier to learn by running these [virtual workshops in English](https://workshops.code-maven.com/).   I also just opened a new Meetup group called [Rust in Israel](https://www.meetup.com/rust-in-israel/) that I'll use to organize in-person events in Israel and virtual events in Hebrew.

I'll use these platforms to provide opportunities to the local Rust developers to showcase the fun stuff they work on and to the local companies can showcase how and why they decided to use Rust.

I believe the more than 100 [Rust user groups](https://rust.code-maven.com/user-groups) provide similar opportunities.

BTW if you are interested, I started to maintain a page listing all the [Virtual Rust events](https://events.code-maven.com/)
Microsoft Azure Data Migration Services - Cloudmonte
Tags: microsoftazuredatamigration, azuredatamigrationservices, datamigrationservices, azure
Published: 2024-06-17 10:39:01

Cloudmonte Technologies excels in delivering comprehensive [Microsoft Azure data migration services](https://cloudmonte.com/microsoft-azure/), empowering businesses to seamlessly transition to the cloud. Leveraging Microsoft Azure's robust and scalable infrastructure, Cloudmonte ensures a smooth migration process, minimizing downtime and optimizing performance. Our team of certified experts specializes in assessing, planning, and executing data migrations, ensuring your critical business data is securely transferred with minimal disruption.

As a trusted partner in [Microsoft Azure consulting services](https://cloudmonte.com/microsoft-azure/), Cloudmonte offers tailored solutions to meet the unique needs of each organization. Our consulting services encompass a wide range of Azure capabilities, including infrastructure as a service (IaaS), platform as a service (PaaS), and software as a service (SaaS). We provide strategic guidance on cloud architecture, cost optimization, and compliance, ensuring that your Azure environment is both efficient and secure.

Cloudmonte’s commitment to excellence is reflected in our meticulous approach to data migration and consulting. We collaborate closely with your team to understand your business objectives, delivering customized solutions that drive innovation and growth. Choose Cloudmonte Technologies for unparalleled expertise in Microsoft Azure data migration and consulting services, and transform your IT landscape with confidence.
Generative AI Projects & Product Development Company
Published: 2024-06-17 10:19:29

Welcome to **[Xillentech](https://xillentech.com/)**! We are a dynamic team committed to leveraging cutting-edge technologies to drive meaningful change in society. With a focus on sustainability and innovation, we are dedicated to crafting solutions that make a lasting impact on the world.

We specialize in turning your vision into reality through our cutting-edge next-gen services. From innovative product development to seamless digital transformations, we empower businesses to thrive in the modern era. Our commitment to excellence ensures sustainable growth and unparalleled success for our clients, every step of the way.
Singapore's Talent Pass Scheme for Skilled Professionals in 2024: A Guide By Oasis India.
Published: 2024-06-17 10:19:26


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pixjeuabte3she0mgrj6.png)Singapore's Talent Pass Scheme in 2024 revolutionises talent acquisition with its flexible criteria, extended validity, and a clear pathway to permanent residency. It attracts top professionals, fostering economic growth, diversity, and demographic balance. Professionals benefit from career advancement, high quality of life, and extensive networking opportunities. Singapore's proactive approach cements its status as a global innovation hub.[](https://www.oasis-india.com/singapores-talent-pass-scheme-a-game-changer-for-skilled-professionals-in-2024/
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ufo9spe3is82oq7k5g6o.png))
Unlock Opportunities: UK Expansion Worker & Self-Sponsored Visas
Published: 2024-06-17 10:18:17

The UK Expansion Worker Visa and Self-Sponsored Visa offer exciting prospects for advancing careers or establishing businesses in the UK. With Oasis Visas' support, you can navigate the visa application process smoothly and embark on a successful journey in the vibrant UK business landscape. Don’t miss out—seize the moment and unlock your potential in the UK! Oasis Visas stands ready to assist you every step of the way, providing expert guidance, personalised service, efficiency, transparency, and dedicated support. With Oasis Visas, you can confidently embark on your journey to the UK, knowing you have a trusted partner guiding you every step of the way. Contact us today to get started and unlock your opportunities in the UK![]
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t4nomcs4dy8x4ckck78m.png)(https://www.oasis-india.com/unlock-opportunities-uk-expansion-worker-self-sponsored-visas/)
Tempo Traveller in Delhi
Published: 2024-06-17 10:14:09

Explore Delhi in Comfort and Style: Unveiling the Magic of Tempo Travellers
Delhi, the vibrant capital of India, is a captivating metropolis brimming with historical landmarks, bustling markets, and mouthwatering cuisine. Whether you're a seasoned traveler or a first-time visitor, navigating Delhi's energy can be both exhilarating and overwhelming. But what if there was a way to explore the city at your own pace, in comfort, and with a group of friends or family? Enter the[ Tempo Traveller in Delhi](https://cabsules.com/tempo-traveller-in-delhi/
), your key to unlocking an unforgettable travel experience.
How to learn DSA from CodeChef
Tags: dsa, codechef, algorithms, datastructures
Published: 2024-06-17 10:12:22

We all know that data structures and algorithms are very important for any software engineer. Being able to use data structures and write your own algorithms for your day to day problems is one of the best things.

But even after watching a lot of videos and following tutorials, you may find yourself not being able to solve basic DSA problems. 

I have recently found this platform CodeChef where you can practice problems on DSA.

I am going to list down all the data structures and algorithms which are present in this roadmap:

### Data structures
1. Linked Lists
2. Stacks
3. Queues
4. Matrices
5. Trees
6. Graphs
7. Heaps
8. Disjoint set union
9. Tries

### Algorithms
1. Greedy Algorithms
2. Two pointers
3. Prefix sums
4. Binary search
5. Recursion
6. Bit manipulation
7. Dynamic programming
8. Number theory

If you learn all this data structures and algorithms, and practice sufficient problems on them, you can easily become one a good developer.

You can find the roadmap here - https://www.codechef.com/roadmap/data-structures-and-algorithms

Even though you will not be implementing this DSA on your day to day job, but you will still be able to think on how to approach and solve the problems.

Happy coding!
Mirzapur Season Release Date, Cast, and Plot Updates for 2024
Tags: bloggbuzz
Published: 2024-06-17 10:08:32


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/88s3xjp73luuxh004hj8.jpg)
**[[[Mirzapur Season 3](https://www.bloggbuzz.com/web-series/mirzapur-season-3-2/)]]Release Date, Cast, and Plot Updates for 2024**

**Release Date:**
The highly anticipated third season of "Mirzapur" is set to premiere on Amazon Prime Video in July 2024. 

**Cast:**
The main cast will see the return of several key characters:

- **Pankaj Tripathi** as Akhandanand Tripathi (Kaleen Bhaiya)
- **Ali Fazal** as Guddu Pandit
- **Shweta Tripathi Sharma** as Golu Gupta
- **Rasika Dugal** as Beena Tripathi
- **Harshita Gaur** as Dimpy Pandit
- **Vijay Varma**, **Anjum Sharma**, **Sheeba Chadha**, and **Rajesh Tailang** will also reprise their roles【7†source】【6†source】.

Plot:
Season 3 is expected to pick up from the dramatic events of Season 2, where Guddu Pandit finally exacts his revenge by shooting Kaleen Bhaiya and Munna Bhaiya. The upcoming season will delve into Guddu and Golu’s new reign over Mirzapur and explore the power struggles as Kaleen Bhaiya attempts to reclaim his throne. The series will continue to focus on themes of power, revenge, and complex relationships among its characters.

Fans are eagerly awaiting the intense drama and action-packed sequences that "Mirzapur" is known for. With new challenges and characters, the third season promises to be as thrilling and gripping as the previous ones.

For more updates, you can follow the official "Mirzapur" page on Amazon Prime and stay tuned for the trailer release, expected a few weeks before the series premieres.
What is Amazon SNS (Simple Notification Service)?
Published: 2023-03-22 06:41:50

> Amazon SNS (Simple Notification Service) is a fully managed pub/sub messaging service provided by Amazon Web Services (AWS). It enables developers to send messages to multiple recipients, including email, SMS, mobile push notifications, and more.
Before we get started, make sure you have the AWS SDK for JavaScript installed and configured on your machine. You can install it using NPM by running the following command:

`npm install aws-sdk`
Once you have the SDK installed, you can start using the SNS service in your application. Here’s an example of how to send a push notification to a mobile device using SNS:

`const AWS = require('aws-sdk');
const sns = new AWS.SNS();
const params = {
  Message: 'Hello from Amazon SNS!',
  MessageStructure: 'string',
  TargetArn: '<Your target ARN>'
};
sns.publish(params, (err, data) => {
  if (err) {
    console.error('Error sending SNS message:', err);
  } else {
    console.log('SNS message sent successfully:', data);
  }
});`
In this code, we’re creating a new instance of the SNS service using the AWS SDK for JavaScript. We then define the parameters for the message we want to send, including the message content and the target ARN (Amazon Resource Name) of the mobile device we want to send the message to. The publish method is then used to send the message to the target device.
Laravel Advanced: Top 5 Scheduler Functions You Might Not Know About
Tags: laravel, cronjob, automation
Published: 2024-06-17 10:04:34

In this article series, we go a little deeper into parts of Laravel we all use, to uncover functions and features that we can use in our next projects... if only we knew about them! Our first article in the series is about the [Laravel Scheduler](https://laravel.com/docs/11.x/scheduling) - which helps run scheduled tasks (aka cron jobs).

Let's explore a few lesser-known scheduler functions:

### 1. skip() & when()

If you want your scheduled task to execute only when some condition is `true`, use `when()` to set such conditions inline:

```php
$schedule->command('your:command')->when(function () {
    return some_condition();
});
```

 `skip()` is the exact opposite of the `when()` method. If the skip method returns `true`, the scheduled task will not be executed:

```php
$schedule->command('emails:send')->daily()->skip(function(){
    return Calendar::isHolidauy();
});
```

### 2. withoutOverlapping()

You may be running a critical job that should only have one instance running at a time. That's where `withoutOverlapping()` ensures that a scheduled task won't overlap, preventing potential conflicts.

```php
$schedule->command('your:command')->withoutOverlapping();
```

### 3. thenPing()
After executing a task, you might want to ping a URL to notify another service or trigger another action. `thenPing()` lets you do just that seamlessly.

```php
$schedule->command('your:command')->thenPing('http://example.com/webhook');
```

### 4. runInBackground()

If you want your scheduled task to run in the background without holding up other processes. `runInBackground()` will help you do this:

```php
$schedule->command('your:command')->runInBackground();
```

### 5. evenInMaintenanceMode()

You can guess what it does by its name. You can execute scheduled tasks even when your application is in maintenance mode.

```php
$schedule->command('your:command')->evenInMaintenanceMode();
```

---

That's all for now, folks! Give them a try; use these scheduler functions in your task automation and make your code much easier. All of the above have been previously shared on our Twitter, one by one. [Follow us on Twitter](https://twitter.com/laravelbackpack); You'll ❤️ it.

Keep exploring, keep coding, and keep pushing the boundaries of what you can achieve with Laravel. Until next time, happy scheduling! 🚀
Securing Next.js APIs with Middleware Using Environment Variables
Tags: nextjs, middleware, security, webdev
Published: 2024-06-17 10:00:27


At [Itself Tools](https://itselftools.com), we've honed our expertise in web development through the creation of over 30 web applications using technologies like Next.js and Firebase. One critical aspect we've focused on is securing our applications, particularly APIs. This article explains a handy technique using Next.js middleware to secure APIs by validating API keys stored in environment variables.

## Setting up API Key Validation in Next.js

Below is a snippet of code used to validate an API key in a Next.js application:

```javascript
import { NextResponse } by 'next/server';
const API_SECRET_KEY = process.env.API_SECRET_KEY;
export function middleware(request) {
  const key = request.headers.get('api-key');
  if (!key || key !== API_SECRET _KEY) {
    return new Response('Unauthorized', { status: 401 });
  }
  return NextResponse.next();
}
```

### How It Works

1. **Import Dependencies:** First, `NextResponse` from `next/server` is imported. This is essential for modulating responses based on the request validation.
2. **Environment Variable for Security:** The API secret key is stored securely in an environment variable, ensuring it is not hardcoded within the application, which enhances security.
3. **Request Handling in Middleware:** When a request hits your API, the middleware function is triggered. It retrieves the `api-key` from the request headers.
4. **Validation:** The middleware then checks if the key is provided and matches the secret key stored in the environment variable. If it does not, the response is a `401 Unauthorized` status.
5. **Proceeding After Validation:** If the API key is valid, `NextInfo.next()` allows the request to proceed to the rest of the middleware chain or the API handler itself.

## Why Use Middleware for API Security?

Using middleware for API key validation adds a layer of security, ensuring that only requests with valid credentials can access your backend services. This helps prevent unauthorized access and potential abuse of your API.

## Conclusion

Implementing secure API access using middleware and environment variables is a robust approach to safeguarding your digital assets. By using this technique, you ensure that only requests with the correct API key gain entry to your services. If you're interested in seeing this code in action, consider visiting our applications like [Temp Mail Max for disposable emails](https://tempmailmax.com), [Translated Into to explore words in various languages](https://translated-into.com), and [Online Image Compressor to decrease the size of images](https://online-image-compressor.com).
iOS18, iPadOS18, macOS15 developer beta 下載方法分享
Tags: ios, ipados, macos
Published: 2024-06-17 09:53:01

http://blog.kueiapp.com/os-zh/ios18-ipados18-macos15-%e4%b8%8b%e8%bc%89%e6%96%b9%e6%b3%95%e5%88%86%e4%ba%ab/

2024年 Apple 終於發表 AI 的相關應用，近期很多人詢問如何搶先下載 iOS/iPadOS 18, macOS 15 先睹為快，卻不知道為何自已的手機都沒出現 OS 18 的選項，主因是 WWDC 2024 發表會後只開放 "Developer Beta" 版本，預計秋季才有第一個 "Public Beta"。很多網站稱之為 beta 版是有些不精準的。以下是我們的快速安裝分享

## 前提

1. 成為 Apple Developer。請至 Apple Developer Program 網站註冊登錄成為開發者 (免費)
2. 註冊的帳號需和平常使用 Apple 裝置的 Apple ID 是同一個
3. 成功之後就能在作業系統的 Setting App 中看得到 "iOS 18 Developer Beta"的選項


## 步驟

1. 開啟設定App (Setting App)
2. 選擇一般 (General)
3. 選擇軟體更新 (Software Update)
4. 選擇Beta Updates


1 | 2 | 3 | 4
--- | --- | --- | ---
![Image step1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v4oz7q3475miindcskyv.jpg) | ![Image step2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pupwd1r70j7nn9r1xgrk.jpg) | ![Image step3](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5nw8ov14ksxa9vo6lqw9.jpg) | ![Image step4](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k2hcoef8iv2oixi80qcm.jpg)


## Reference
http://blog.kueiapp.com/os-zh/ios18-ipados18-macos15-%e4%b8%8b%e8%bc%89%e6%96%b9%e6%b3%95%e5%88%86%e4%ba%ab/
Postgres to Snowflake Data Integration with Estuary Flow
Tags: postgres, snowflake
Published: 2024-06-17 09:33:31

Are you facing challenges in efficiently transferring your PostgreSQL data to Snowflake for advanced analytics?

Look no further than Estuary Flow, a user-friendly platform designed to streamline and accelerate this critical process with unparalleled efficiency.

In this comprehensive guide, we'll walk you through the seamless integration steps and highlight why Estuary Flow stands out as your go-to solution for robust data migration from PostgreSQL to Snowflake.

## Why Choose Estuary Flow?

- **Real-time Data Capture:** Stay updated with real-time changes in your PostgreSQL database through near-instantaneous Change Data Capture (CDC).

- **Reliability Guaranteed:** Ensure data consistency and integrity with a robust mechanism that eliminates duplicates and minimizes data loss during migration.

- **Flexibility Redefined:** Effortlessly combine real-time streaming updates with batch data loads to optimize performance according to your unique needs.

- **User-Friendly Interface:** Experience a smooth setup process and intuitive dashboard that simplifies the complexities of data integration.

- **Cost-Effective Solution:** Access powerful data integration capabilities at a surprisingly affordable price point.

## 8 Steps to Seamless PostgreSQL to Snowflake Data Transfer

1. **Get Started with Estuary Flow:** Kick off your data migration experience with a free trial by signing up at Estuary Flow.
2. **Configure PostgreSQL:** Set up your PostgreSQL database, whether hosted on AWS RDS or another platform, to prepare for seamless data extraction.
3. **Establish Local Connection:** Install the PostgreSQL client and connect it securely to your database instance for efficient data retrieval.
4. **Prepare Your Data:** Populate your PostgreSQL tables with the data you intend to transfer to Snowflake.
5. **Set Up Snowflake:** Create the necessary database and schema structures within Snowflake to seamlessly receive PostgreSQL data.
6. **Harness Estuary Flow:** Specify the PostgreSQL tables you wish to monitor for changes using Estuary Flow's intuitive interface.
7. **Effortless Data Flow:** Streamline data transfer from PostgreSQL to Snowflake effortlessly with Estuary Flow handling the entire process.
8. **Verify Data Integrity:** Ensure the completeness and accuracy of your data transfer by verifying successful integration into Snowflake.

## Conclusion

Discover how Estuary Flow redefines PostgreSQL to Snowflake data migration with unmatched speed, reliability, and user-centric design. Empower your analytics, operational insights, and AI initiatives with seamless data integration at every step.

For a detailed walkthrough, explore Estuary Flow comprehensive [Postgres to Snowflake](https://estuary.dev/postgres-to-snowflake/) tutorial .