teleren/devto huggingface dataset:
Best DX for cookies on localhost
Tags: dx, cookies, localhost
Published: 2024-01-17 12:08:13

## Introduction
Cookies are still the most recommended way to handle authentication in web applications.
Furthermore, they can be tricks to get it right and to make it work on localhost, staging, and production with the same code.

## Setting Cookies

Your backend needs to set the cookies after the log-in, and it also needs to remove the cookies after the log-out.

To set a cookie in the backend you can do something like this:

```jsx
const domain = null;

const secure = !['development', 'test'].includes(config.NODE_ENV);

const sameSite = config.APP_ENV === 'development' ? 'Lax' : 'Strict';

const options = {
  httpOnly: true,
  overwrite: true,
  maxAge,
  secure,
  domain,
  signed: true,
  sameSite,
};

koaContext.cookies.set(cookieName, token, options);
```

We are using koa to set cookies, but it can be any node framework, and the concept would be the same in other programming languages and frameworks.

Let's dive into the cookies options:

- httpOnly: specific that this cookie can't be read by JavaScript, this is a security measure and it is recommended
- overwrite: it will override existing cookie with the same name
- maxAge: it sets an expiration date for the cookie, a short expiration time is good for security
- secure: it only sends the cookies in TLS connections
- domain: specific what domain can accept this cookie
- signed: it ensures the value was not tampered
- sameSite: it defines if the cookie should send in a cross-site request.

## Making cookies work on localhost

Commonly, your backend server will run in a port, like `http://localhost:5001` and your frontend will run in another port `http://localhost:8003`.
If a different port is interpreted as a different domain in your browser, then you can't set cookies from 5001 to 8003.
To make cookies work in localhost, we can use a proxy on the front end.
We can do this using our webpack config:

```jsx
const config = {
  devServer: {
    proxy: {
      '/graphql': `http://localhost:5001`,
    },
  },
}
```

This will proxy `http://localhost:8003/graphql` requests to `http://localhost:5001/graphql`, enabling cookies to work in your _localhost_.

## To Sum Up
To provide the best DX you need to work end to end to ensure both the backend and frontend are tweaked to support the developer's workflows.
Right now cookies are so easy to use that we even forget that we migrated from local storage a few years ago.

If you are still using local storage to save your authentication tokens, I recommend you migrate to cookies.


---
Woovi
[Woovi](https://www.woovi.com) is a Startup that enables shoppers to pay as they like. To make this possible, Woovi provides instant payment solutions for merchants to accept orders.

If you want to work with us, we are [hiring](https://woovi.com/jobs/)!

---
Photo by <a href="https://unsplash.com/@vyshnavibisani?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash">Vyshnavi Bisani</a> on <a href="https://unsplash.com/photos/brown-round-cookie-on-white-surface-z8kriatLFdA?utm_content=creditCopyText&utm_medium=referral&utm_source=unsplash">Unsplash</a>
Tech companies start 2024 with layoffs totaling 7500 employees
Tags: news, softwaredevelopment
Published: 2024-01-17 12:00:28

Fourteen days into the New Year, 46 tech companies have laid off ~7,500 employees, per layoffs tracker Layoffs.fyi.
Notable announcements:
• Google confirmed it was axing about 1,000 employees last Wednesday across its Google Assistant, core engineering, and hardware teams that work on Pixel, Nest, and Fitbit
• Amazon cut hundreds of people working in its Audible, Twitch, MGM Studios, and Prime Video units.
• Discord, the messaging app with IPO ambitions, slashed 17% of its staff
• Apple, which avoided the mass-scale layoffs of its rivals in 2023, is shutting down a 121-person team working on Al in San Diego, Bloomberg reported
Despite this wave of layoffs, experts told Wired these job cuts are materially different-and less ominous-than thos in previous years, specifically 2023 which saw tech companies cut nearly 263,000 jobs.
Rather than sweeping cost-cutting efforts, many of the early 2024 layoffs reflect relatively healthy tech companies shuffling their priorities. That may not be reassuring to anxious employees, but it's something we've seen before:
Layoffs have historically jumped around the fiscal year-end in December and January, according to the Bureau of Labor Statistics.
MDB5 Angular 6.0.0 Released!
Tags: webdev, programming, angular, news
Published: 2024-01-17 11:59:29

**MDB5 Angular 6.0.0 Changelog**

**New features:**
_Select_ - added new inputId and inputFilterId inputs that allow to declare ids for input elements

**Breaking changes:**
Updated Angular to v17, this version is required in MDB Angular v6

_Calendar_ - changed type of defaultView input from string to MdbCalendarView

_Datepicker_ - changed type of options input from any to MdbDatepickerOptions

_Timepicker:_
- Changed type of options input from Options to MdbTimepickerOptions and made all parameters optional
- Changed SelectedTime type name to MdbTimepickerSelectedTime and added this type to public exports

_Popover_ - removed unused template input

_Sidenav:_
- Changed return type of all events from MdbSidenavComponent to void
- Removed redundant li element from MdbSidenavItemComponent template

_Transfer_
- Changed onSearchOutput event name to searchOutput
- Changed selectOutput event name to selectOutput
- Changed onChange event name to listChange
- Changed onSearch event name to itemSearch
- Changed onSelect event name to itemSelect

**Fixes:**
_Sidenav_ - removed height animation transition
_Select_ - blocked input clearing in disabled component
_Input fields_ - resolved problem with default label position in all inputs with built-in placeholder (like datetime-local or time)
_Lightbox_ - resolved problem with component removal from DOM after using browser's back button
_Timepicker_ - resolved problem with font size in landscape view

Full Changelog **[here](https://mdbootstrap.com/docs/angular/getting-started/changelog/)**
Essential Steps to Kickstart Your Journey as a Developer
Tags: developer, development, beginners
Published: 2024-01-17 11:47:40

Setting clear and achievable goals is a crucial first step in your journey as a developer.

- What kind of projects do you want to work on?
- What programming languages do you want to master?

Having a roadmap will help you stay focused and motivated as you embark on your development journey.

## Learning the Fundamentals

Before diving into complex coding challenges, it's essential to grasp the fundamentals of programming.

Understanding concepts such as variables, loops, and functions will provide a strong foundation for your future endeavors.

There are numerous online resources and tutorials available that can help you build a solid understanding of these essential principles.

## Choosing the Right Tools

Selecting the right development tools can significantly impact your productivity and efficiency.

Whether it's an integrated development environment (IDE), a version control system, or a package manager, investing time in exploring and mastering these tools will streamline your workflow and enhance your coding experience.

## Building Projects

Putting theory into practice by working on real-world projects is an indispensable part of your development journey.

Start with small projects and gradually progress to more complex ones.

Building a portfolio of completed projects will not only demonstrate your skills to potential employers but also provide valuable hands-on experience.

## Embracing Continuous Learning

The field of technology is constantly evolving, and as a developer, it's essential to embrace continuous learning.

Stay updated with the latest industry trends, [explore latest technologies](https://hyscaler.com/insights/hyscaler-tech-product-development/), and be open to acquiring new skills.

Keeping pace with the ever-changing tech landscape will set you apart as a dynamic and adaptable developer.

## Seeking Community and Mentorship

Connecting with fellow developers through online forums, social media groups, or local meetups can provide a supportive network for sharing knowledge and experiences.

Additionally, seeking mentorship from seasoned developers can offer invaluable guidance and insights as you navigate through the challenges and opportunities in the tech industry.

## Sharpening Problem-Solving Skills

As a developer, you will encounter a myriad of complex problems that require innovative solutions.

Sharpening your problem-solving skills through practice and persistence is essential.

Approaching coding challenges with a solution-oriented mindset will help you overcome obstacles and foster continuous growth.

## Conclusion

Embarking on a journey as a developer requires dedication, perseverance, and a proactive approach to learning and growth.

By setting clear goals, mastering the fundamentals, embracing continuous learning, and seeking support from the developer community, you can pave the way for a fulfilling and successful career in the ever-evolving world of technology.
Residential Plots for Sale in Tambaram
Published: 2024-01-17 11:45:51

 Discover the epitome of serene living with our meticulously crafted [Residential plots for sale in Tambaram](https://www.vamananestates.com/). Nestled in the heart of this vibrant locality, these plots offer a unique opportunity to build your dream home in a well-established community. Tambaram, known for its strategic location and excellent connectivity, beckons you to embrace a lifestyle that seamlessly combines urban conveniences with tranquility.Spanning across carefully planned layouts, our residential plots boast generous dimensions, providing ample space for you to design a residence that suits your preferences. Immerse yourself in the lush green surroundings and create a haven that reflects your vision of a perfect abode. The plots are thoughtfully positioned to ensure easy access to essential amenities, educational institutions, healthcare facilities, and entertainment options, enhancing the overall quality of life.Whether you envision a contemporary architectural marvel or a cozy retreat, these plots serve as a canvas for your aspirations. The neighborhood exudes a sense of community, fostering a welcoming atmosphere for families and individuals alike. Enjoy the convenience of proximity to major transportation hubs, ensuring seamless connectivity to the rest of the city.Seize this opportunity to invest in a promising future and secure a piece of Tambaram's burgeoning real estate landscape. Our residential plots stand as a testament to thoughtful planning and a commitment to creating spaces where dreams take root and flourish. Embrace the charm of Tambaram with our exclusive residential plots, where every square foot is an invitation to a life well-lived.
Installing Flask and creating a virtual environment
Tags: python, flask, webdev, tutorial
Published: 2024-01-17 11:43:47

Before we can start working on our Flask app, we need to install Flask and create a virtual environment. A virtual environment is a way of isolating the dependencies of our project from the rest of the system, so that we can avoid conflicts and ensure reproducibility.

To install Flask, we can use the pip package manager. Pip is a tool that allows us to install and manage Python packages from the Python Package Index (PyPI). To install Flask, we can run the following command in the terminal:

```
pip install flask
```
This will download and install Flask and its dependencies. You can check the version of Flask that you have installed by running:

```
flask --version
```
You should see something like this:

```
Flask 2.0.2
Python 3.9.7
```
To create a virtual environment, we can use the venv module that comes with Python. Venv is a tool that creates a directory that contains a copy of the Python interpreter and the packages that we need for our project. To create a virtual environment, we can run the following command in the terminal:

```
python -m venv venv
```
This will create a directory called venv in the current working directory. To activate the virtual environment, we can run the following command in the terminal:

```
source venv/bin/activate
```
This will change the prompt to indicate that we are in the virtual environment. You should see something like this:

```
(venv) $
```
Now, we can install Flask and any other packages that we need for our project in the virtual environment. To deactivate the virtual environment, we can run the following command in the terminal:

```
deactivate
```

This will return us to the normal prompt. You should see something like this:

```
$
```

Original Post: https://enceladus-software.com/post/149
Headless CMS Interview Questions
Tags: interview, web, help, wordpress
Published: 2024-01-17 11:35:21

Headless CMS is one of the rapidly growing technologies that you can't ignore in the year 2024. In this article, I have selected some of the top and best headless CMS interview questions for your upcoming job, which I'll aim to cover within this blog in just 5 minutes. So, without wasting any time, let's start it :

**What is Headless CMS :**

Headless CMS is a backend-focused web content management system serving as a content repository.

**Traditional CMS vs. Headless CMS:**

Traditional CMS combines Frontend and Backend, while Headless CMS introduces an API between them.

**Popular Headless CMS Platforms:**

Notable options include [Strapi](https://strapi.io/), [Sanity](	https://www.sanity.io/), [Contentful CMS](https://www.contentful.com/).

**Benefits of Headless CMS:**

Offers flexibility, improved content delivery, scalability, and enhanced security compared to traditional CMS.

**Disadvantages of Headless CMS:**

Challenges for non-technical users, potential consistency issues, and varying community sizes for platforms.

Explore further Headless CMS interview questions and in-depth analysis on this blog. [Headless
 CMS Interview Questions](https://ravirathore.com/education/headless-cms-interview-questions/)
Gravitation Ltd
Published: 2024-01-17 11:21:57

From weighing chemicals in the laboratory to weighing fully loaded trucks and agricultural harvest, Gravitation provides customised weighing scales and weighbridges for a wide range of standard and non-standard applications. Built to your specific requirements, we can design and build weighbridges for laboratories, agriculture, industrial settings, automotive workshops, construction sites and more. Based on the nature of your project, we can provide a concrete or steel deck for your weighbridge and also make it weather-proof for outdoor installations and hazardous environments. Visit our website to browse through our products.

Website: https://gravitation.ie/
Mobilificio Marchese
Published: 2024-01-17 11:17:15

Baxter Made in Italy means interior design craftsmanship of the future. Synonymous with luxury handcrafted quality and elegance Made in Italy. From sofas to armchairs, from tables to chairs: every product is a masterpiece of craftsmanship. Everything is handmade with the best leather.

[baxter budapest](https://www.mobilificiomarchese.com/en/48-baxter-sofa)


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ylr90305t729qn4e10e7.jpg)
Online Bachelor Degree in Data Science
Tags: webdev, programming, tutorial, beginners
Published: 2024-01-17 11:10:09

Hey aspiring data scientists! 🎯 Are online bachelor degree seekers ready to take on the world of data science? 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bz4ph4sdcf0ip59wgbow.png)
If you are looking for an online bachelor's degree in Data Science, there are several reputable programs available. 
Enrolling in our online bachelor degree program is an investment in a transformative journey, where academic excellence converges with practical experience and a strong professional network, paving the way for a successful and fulfilling career.
To Know About Us Visit Our Website https://onlinebachelordegree.in/
Optimizing Refrigerator Performance: A Comprehensive Maintenance Guide
Published: 2024-01-17 11:06:36

Preserving the cleanliness and orderliness of your [refrigerator ](https://consertodegeladeira.app.br/
)goes beyond merely keeping your food fresh; it plays a crucial role in enhancing the overall efficiency of your cooling appliance. This detailed guide offers clear steps to maintain your refrigerator's optimal condition, reducing the necessity for frequent refrigerator repairs.

Streamlining Your Refrigerator Space

Commence the process by completely emptying your refrigerator. This step allows you to assess each item, deciding what stays and what departs. Identify expired items, leftovers past their prime, and items you no longer need. The removal of unnecessary items creates extra space and simplifies the organization of essentials.

Thorough Surface Cleaning

Once shelves and drawers are vacant, utilize a damp cloth or sponge to cleanse all interior surfaces. Pay special attention to spills and sticky areas. Cleaning not only promotes hygiene but also inhibits the growth of bacteria and unwanted odors. Avoid harsh chemicals, as residues may impact the taste of your food.

Strategic Food Zoning

Divide your refrigerator into zones based on food types. Allocate drawers for fruits and vegetables, dedicate a shelf to dairy products, and assign another to meats. This organization facilitates item retrieval and helps maintain optimal temperatures for different food groups. Proper zoning contributes to energy efficiency and minimizes the risk of refrigerator repair.

Embracing Storage Containers

Invest in clear storage containers to group similar items. These containers enhance visibility and assist in maintaining order. Additionally, using containers helps prevent spills and leaks, preserving the cleanliness of the refrigerator interior and averting potential issues requiring refrigerator repairs.

Checking Temperature Settings

Ensure your refrigerator is set to the recommended temperature, typically detailed in the user manual. Proper temperature settings not only ensure food safety but also enhance energy efficiency. Regularly monitor and adjust settings to prevent undue strain on the cooling system, reducing the likelihood of future refrigerator repairs.

Establishing a Maintenance Routine

Integrate cleaning and organizing into your regular household routine. Dedicate a day each month to review contents, discard expired items, and wipe down surfaces. This proactive approach extends your refrigerator's lifespan and diminishes the chances of encountering unexpected refrigerator repair issues.

In Conclusion

By adhering to these straightforward steps for cleaning and organizing your refrigerator, you can ensure its efficiency and longevity. A well-maintained refrigerator not only preserves food freshness but also reduces the likelihood of facing unexpected refrigerator repair issues. With a modest investment of effort and consistent attention, you can relish the benefits of a smoothly-running refrigerator for years to come.
Mastering the Craft: How AZ-120 Exam Dumps Elevate Your Skills
Tags: javascript, programming, beginners, react
Published: 2024-01-17 11:04:10

[AZ-120 Exam Dumps](https://dumpsboss.com/microsoft-exam/az-120/) Candidates should verify that the material addresses all key areas, leaving no knowledge gap in their preparation. Checking for Updates and Revisions in Exam Dumps Azure solutions evolve, and so do certification exams. Candidates should regularly check for updates and revisions in exam dumps to ensure they are using the most current and relevant material. 

Common Pitfalls to Avoid in AZ-120 Exam Preparation Relying Solely on Exam Dumps While exam dumps are valuable tools, relying solely on them is a pitfall. Candidates should use a variety of study resources, including hands-on [AZ-120 Exam Dumps](https://dumpsboss.com/microsoft-exam/az-120/) labs, official documentation, and community forums, to ensure a well-rounded understanding. Neglecting Practical Experience Certification is not just about theoretical knowledge. Candidates should actively seek opportunities for hands-on practice, applying their skills in real-world scenarios to reinforce their learning. Underestimating the Importance of Continuous Learning Technology is dynamic, and continuous learning is essential.
AppSignal’s Top 5 Elixir Posts in 2023
Tags: elixir
Published: 2024-01-17 11:00:00

As the year draws to an end, we're excited to share our top five most-read Elixir articles in 2023!

## Top 5 Elixir Blog Posts in 2023 ⚗️

### [An Introduction to Test Factories and Fixtures for Elixir](https://blog.appsignal.com/2023/02/28/an-introduction-to-test-factories-and-fixtures-for-elixir.html)

In the first part of this three-part series, we give an overview of Elixir test factories and fixtures.

### [Under the Hood of Ecto](https://blog.appsignal.com/2023/02/14/under-the-hood-of-ecto.html)

Explore how Ecto's internals work by looking at its four major modules in detail.

### [Absinthe for Large Elixir Applications](https://blog.appsignal.com/2023/06/06/absinthe-for-large-elixir-applications.html)

Discover how you can best use Absinthe for data-heavy Elixir applications.

### [Validating Data in Elixir: Using Ecto and NimbleOptions](https://blog.appsignal.com/2023/11/07/validating-data-in-elixir-using-ecto-and-nimbleoptions.html)

We dive into how to avoid bad data using Ecto and NimbleOptions in the second part of our Validating Data at the Boundary series.

Finally, here's our top Elixir post in 2023!

### [Phoenix 1.7 for Elixir: Edit a Form in a Modal](https://blog.appsignal.com/2023/09/12/phoenix-1-7-for-elixir-edit-a-form-in-a-modal.html)

In the third part of our Modal Forms and LiveView in Phoenix 1.7 series, we implement an edit modal.

## Season's Greetings ❆ ⛄

Have a wonderful festive break, and we'll see you in the new year!

If you haven’t already, don’t forget to [subscribe to our Elixir Alchemy newsletter](https://blog.appsignal.com/elixir-alchemy), so you never miss an upcoming post.
The AZ-600 Dumps Handbook: A Comprehensive Guide
Tags: beginners, javascript, webdev
Published: 2024-01-17 10:59:05

Understanding the AZ-600 Exam Exam Format Before delving into preparation strategies, it's essential to understand the exam's format. The AZ-600 Exam typically consists of multiple-choice questions, case studies, and practical tasks. Familiarizing yourself with the exam structure will help you tailor your preparation accordingly. Core Concepts Covered The exam covers a range of core concepts, including Azure [AZ-600 Dumps](https://examtopicsfree.com/microsoft-exam-dumps/az-600-dumps/) Stack Hub infrastructure deployment, configuration, and management. Topics such as networking, storage, and security are integral to the exam, requiring candidates to have a well-rounded understanding of Azure services. Preparing for the AZ-600 Exam Effective Study Techniques To excel in the AZ-600 Exam, adopting effective study techniques is crucial. Create a study schedule, focus on one topic at a time, and regularly assess your progress. 

[https://examtopicsfree.com/microsoft-exam-dumps/az-600-dumps/](https://examtopicsfree.com/microsoft-exam-dumps/az-600-dumps/)