teleren/devto huggingface dataset:
Entendiendo el Hoisting en JavaScript
Tags: javascript, beginners, spanish, webdev
Published: 2023-05-31 16:58:28

Hoy toca tema básico que es un pilar de la programación en JavaScript y es el: hoisting. Forma parte del lenguaje es un concepto que tienes que aprender para poder progresar. Al principio suena como algo muy abstracto pero la verdad es que no es tan complicado.

El hoisting tiene que ver en como funciona el motor de JavaScript la gran mayoría ejecutan V8 JavaScript Engine: [v8.dev](https://v8.dev) es uno de los más ocupados y potentes. Surge de la innovación que tuvo que hace el equipo de Google Maps. Pero eso es para otro articulo.


![Logo de V8](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j2wss511gax7ooo93tdo.png)

Ahora si como va: El hoisting hace referencia a que las declaraciones de variables y funciones son físicamente movidas al comienzo del código, pero esto en realidad no pasa sino que se asignan en memoria, pero el código se queda exactamente en donde esta. Por ejemplo en el siguiente ejemplo vemos que primero esta la definición de la función y luego la mandamos a llamar, creo que no hay nada fuera de lo común.


![Ejemplo de hoisting](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4is2mwfh6b52dt5jq3xl.png)

Pero, ¿Qué pasa si lo ponemos al revés?, primero mandamos a traer la función y después esta la definición. Bueno acá esta lo divertido porque seguirá funcionando. Y esto es culpa del hoisting la función se asigna en memoria y esta disponible a lo largo del script.


![Ejemplo de hoisting funcion](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/51c1px1d5g1yy2geha0z.png)

Ahora veamos un ejemplo con las variables que acá se pone la cosa buena. Si tenemos el siguiente ejemplo ¿Cuál crees que sea el resultado del console .log()?


![Ejemplo de hoisting variable](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iisriq42j7uq1xfbofwj.png)

Bueno pues el resultado sería el siguiente. Otra cosa interesante es que el sólo utiliza el hoisting en declaraciones, no inicializaciones. Esto quiere decir que si quiere ocupar una variable y no a sido asignada el motor de JavaScript por defecto asignara undefined.


![Ejemplo de hoisting con variable ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lz96opxxiq90fyvvcap4.png)

Si este articulo te gusto o aprendiste algo nuevo te agradecería que me siguieras y compartieras mi contenido para que más personas aprendan. Gracias.
Https Session Authentication in asp.net Core
Tags: webdev, programming, opensource, aspdotnet
Published: 2023-05-31 16:53:00

In ASP.NET Core, you can implement session-based authentication using the built-in session middleware and cookie authentication. Here's a step-by-step guide on how to set it up:

Step 1: Configure session services
In your `Startup.cs` file, configure the session services by adding the following code inside the `ConfigureServices` method:

```csharp
public void ConfigureServices(IServiceCollection services)
{
    services.AddSession(options =>
    {
        // Configure session options
        options.Cookie.Name = "YourCookieName";
        options.IdleTimeout = TimeSpan.FromMinutes(30);
        options.Cookie.IsEssential = true;
    });

    services.AddControllers();
    // other services...
}
```

Step 2: Enable session middleware
Inside the `Configure` method in `Startup.cs`, add the session middleware after the authentication middleware:

```csharp
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
    // other middleware...

    app.UseAuthentication();
    app.UseAuthorization();
    app.UseSession();

    // other configuration...
}
```

Step 3: Configure authentication
Configure cookie authentication by adding the following code inside the `ConfigureServices` method in `Startup.cs`:

```csharp
public void ConfigureServices(IServiceCollection services)
{
    // other services...

    services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
        .AddCookie(options =>
        {
            options.Cookie.Name = "YourCookieName";
            options.ExpireTimeSpan = TimeSpan.FromMinutes(30);
            options.SlidingExpiration = true;
        });

    // other services...
}
```

Step 4: Authenticate the user
Inside your controller or action method, you can use the `HttpContext.Session` property to access the session and perform authentication checks. Here's an example:

```csharp
public class YourController : ControllerBase
{
    public IActionResult Authenticate(string username, string password)
    {
        // Perform your authentication logic here
        if (IsValidUser(username, password))
        {
            HttpContext.Session.SetString("Username", username);
            return Ok();
        }

        return Unauthorized();
    }

    private bool IsValidUser(string username, string password)
    {
        // Your authentication logic here
    }
}
```

Step 5: Restrict access to authenticated users
You can apply the `[Authorize]` attribute to your controller or specific action methods to restrict access to authenticated users only:

```csharp
[ApiController]
[Route("api/[controller]")]
[Authorize]
public class YourController : ControllerBase
{
    // Actions...
}
```

These steps outline how to implement session-based authentication using cookies in ASP.NET Core. Remember to adjust the configuration and authentication logic based on your specific requirements.
Bakery Shop in Dehradun: A Delightful Treat for Your Taste Buds
Published: 2023-05-31 16:34:59

Are you a food lover who is always on the lookout for delicious treats? Do you have a sweet tooth that craves something sugary and satisfying? If so, then you must visit the best bakery shop in Dehradun! This quaint and charming bakery shop offers a variety of baked goods that will leave you craving for more. From cakes to pastries, cookies, and bread, this bakery shop has something for everyone.

The [Bakery Shop in Dehradun](https://bakepro.in/best-bakery-shop-in-dehradun/): What Makes it So Special?
When it comes to finding the bakery shop in Dehradun, there are many factors to consider. But what makes this particular bakery shop stand out from the rest? First and foremost, the quality of their products is exceptional. All their baked goods are made with the freshest ingredients, ensuring that every bite is bursting with flavor.

Secondly, their customer service is unparalleled. The staff at the bakery shop are friendly, knowledgeable, and always willing to go the extra mile to ensure that their customers are satisfied. They take the time to understand your preferences and recommend the best products to suit your taste buds.

[Online Cake Shop in Dehradun](https://bakepro.in/online-cake-shop-in-dehradun/): The Convenience of Ordering Online
In today’s fast-paced world, convenience is key. That’s why the best bakery shop in Dehradun has made it easy for customers to order their baked goods online. With just a few clicks, you can place an order for your favorite cakes, pastries, or cookies and have them delivered right to your doorstep. This online cake shop in Dehradun is perfect for those who are too busy to visit the bakery shop in person but still want to enjoy their delicious treats.

The [Best Bakery Shop in Dehradun](https://bakepro.in/best-bakery-shop-in-dehradun/): A Perfect Place for All Occasions
Whether you’re celebrating a special occasion or just want to indulge in something sweet, the best bakery shop in Dehradun has got you covered. They offer a wide range of cakes for all occasions, from birthdays to weddings, anniversaries, and more. Each cake is beautifully decorated and can be customized to suit your preferences. You can choose from a variety of flavors, sizes, and designs to create the perfect cake for your special day.

Why Visit the Best Bakery Shop in Dehradun?
There are many reasons to visit the best bakery shop in Dehradun. First and foremost, their baked goods are simply delicious. You won’t find better quality baked goods anywhere else in the city. Secondly, their customer service is exceptional. The staff are friendly, knowledgeable, and always willing to go the extra mile to ensure that their customers are satisfied. Finally, their online cake shop in Dehradun makes it easy for customers to order their favorite baked goods from the comfort of their own home.
Explore the Beauty of Uttarakhand with Aayan Tour and Travel: Your Ultimate Taxi Service and Tour Package Provider
Published: 2023-05-31 16:21:43

Are you planning to visit the picturesque state of Uttarakhand in India? Look no further than [Aayan Tour and Travel](https://aayantourandtravel.com/) for all your taxi service and tour package needs in Uttarakhand. With our expert team and exceptional services, we strive to make your trip a memorable experience, providing you with the best of Uttarakhand's natural beauty, culture, and adventure.

Taxi Service in Uttarakhand: Your Convenient and Reliable Travel Companion

At Aayan Tour and Travel, we understand the importance of comfortable and reliable transportation during your trip. That's why we offer top-notch [Taxi Service in Uttarakhand](https://aayantourandtravel.com/taxi-service-in-uttarakhand/) to cater to all your travel needs. Whether you need a taxi for local sightseeing, airport transfers, intercity travel, or even for multiple days of exploration, we have a wide range of well-maintained vehicles to suit your requirements.

Our team of professional and experienced drivers ensures that you have a safe and comfortable journey, allowing you to sit back, relax, and enjoy the scenic beauty of Uttarakhand. We prioritize your safety and provide round-the-clock customer support to assist you with any travel-related queries or emergencies.

Tour Package in Uttarakhand : Discover the Hidden Gems of the Himalayas

Uttarakhand is known for its breathtaking landscapes, serene mountains, pristine rivers, lush green valleys, and spiritual significance. With our thoughtfully curated [Tour Package in Uttarakhand](https://aayantourandtravel.com/tour-package-in-uttarakhand/) , you can explore the best of Uttarakhand and create unforgettable memories.
Upstream is June 7: Hear from maintainers of log4j and other top projects
Tags: opensource, maintainers, java, python
Published: 2023-05-31 16:18:00

---
title: Upstream is June 7: Hear from maintainers of log4j and other top projects
published: true
description: Upstream is one week away! Join us on June 7, and follow the trails blazed by open source maintainers.
tags: opensource, maintainers, java, python
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eogyo9i82qm3v1xcsrdf.png
# Use a ratio of 100:42 for best results.
published_at: 2023-05-31 16:18 +0000
---


Upstream is one week away! Join us on June 7, and follow the trails blazed by open source maintainers of projects like log4j, Mongoose, urllib3, CherryPy—or walk the route of those using their creations at huge organizations like Fannie Mae, Amazon, Cisco, and more. [RSVP now](https://upstream.live/?utm_medium=referral&utm_content=2&utm_source=dev.to).

There's no other event quite like it—fully virtual, free, and multi-perspective, the goal of Upstream is to hear from everyone in open source—including maintainers and users alike.

Let's take a look at one hour-long block on the agenda. You can choose any of these paths:

1: Join us for **the state of the open source maintainer panel** featuring Jason Coombs of Setuptools and Cherrypy, Gary Gregory of the Apache Software Foundation, and Ceki Gülcü, creator of log4j version 1. Ever wondered what it was like to be on the maintenance team for a wildly popular project like log4j during one of the most notorious zero-day vulnerability fire drills? Here's your chance.

2: **Tidelift co-founder Luis Villa sits down with Ben Adida, executive director of VotingWorks**, to hear about the only open-source voting system used in United States elections. 

3: Matthew Yonkovit of Scarf will share his *tips, tricks, and best practices for open source adoption*.

Throughout the day, we will hear directly from both the maintainers behind open source and the users who depend on their work. We expect some fascinating discussions, and can't wait to hang out with you for the day day.

BONUS: [If you register and attend the event](https://upstream.live/?utm_medium=referral&utm_content=2&utm_source=dev.to), we'll send you a free t-shirt and **you'll be entered to win a $100 gift card**. (Only those in the U.S. are eligible for the free shirt, sadly.)
How to enable https on IIS Server Local Host
Tags: webdev, programming, productivity, opensource
Published: 2023-05-31 15:49:51

To enable HTTPS on IIS (Internet Information Services) for localhost, you need to perform the following steps:

### 1. Install an SSL certificate:
   - Obtain an SSL certificate from a trusted certificate authority (CA) or generate a self-signed certificate for testing purposes.
   - If you have a certificate from a CA, make sure you have the certificate file (.cer or .crt) and the private key file (.pfx or .key).
   - If you're using a self-signed certificate, you can generate it using tools like OpenSSL or IIS Manager.

### 2. Import the certificate:
   - Open the IIS Manager on your local machine.
   - Select your server in the Connections pane.
   - Double-click on "Server Certificates" in the main pane.
   - In the Actions pane, click on "Import..."
   - Browse and select the certificate file (.cer or .pfx) and provide the necessary details.

### 3. Bind the certificate to the website:
   - Select your website in the Connections pane.
   - Double-click on "Bindings" in the main pane.
   - Click on "Add..." to add a new binding.
   - In the "Add Site Binding" window, set the following:
     - Type: Select "https".
     - IP address: Choose the IP address you want to bind the certificate to (usually, it will be "All Unassigned").
     - Port: Set the port number to 443.
     - SSL certificate: Select the imported certificate from the dropdown.
   - Click "OK" to save the binding.

### 4. Update the website's bindings:
   - In the Connections pane, select your website.
   - Double-click on "SSL Settings" in the main pane.
   - Check the "Require SSL" option if you want to enforce HTTPS access only.
   - Click "Apply" to save the settings.

### 5. Test the HTTPS connection:
   - Open a web browser and enter "https://localhost" in the address bar.
   - If everything is set up correctly, you should see the default page of your website over HTTPS.

If you encounter any issues or errors during the process, check the IIS logs and event logs for more information. Additionally, make sure that the necessary ports (e.g., port 443) are open in your firewall settings.

Remember that this guide assumes you have administrative access to your machine and sufficient knowledge of IIS and SSL certificates.
Summon the Power of GPT-4 to Elevate UI/UX Design and Win Life - Probably the Best Decision You’ll Ever Make!
Tags: webdev, design, ux, ui
Published: 2023-05-31 15:41:04

Introducing 'Design with GPT-4' - your shining beacon in the overwhelming darkness of UI/UX design. Prepare to join the leagues of design prodigies and watch your creations take over the digital world, one pixel at a time.

In the throbbing heart of the digital era, amid the never-ending onslaught of fancy design jargon and colors you can't pronounce, comes a heroic figure, cloaked in the comforting green of OpenAI. 'Design with GPT-4' is here to banish your UI/UX woes and provide a digital design glow-up that even the Kardashians would envy.

Do you remember those countless hours spent scrolling through design inspirations, banging your head against your ergonomically adjusted desk because that button just doesn't "feel" right? Well, those days are as over as using wired earphones. GPT-4, with its omniscient, omnipotent and omnipresent AI capabilities, will swoop in like the superhero of your dreams, saving you from the looming disaster of ill-placed dropdowns.

And here's the best part - no prerequisite of a million years of design experience or a PhD in understanding the psychological implications of a rounded-corner box. Just you, GPT-4, and the magical world of pixels.

Can you imagine having access to a trove of design wisdom as vast as the ocean and as intricate as a spider's web? Now multiply that by a thousand, and voila, you have 'Design with GPT-4'. It's like having Da Vinci, Picasso, and that kid who got an A+ in art class all rolled into one and sitting inside your computer.

What? You're worried about spending precious time learning yet another tool? Oh, honey! GPT-4 doesn't just know design, it knows you. It'll understand your whims and fancies before you can say "Ridiculous, yet strangely appealing user interface." It'll intuitively align your designs with your deepest artistic desires and, dare we say it, your soul.

So don’t hold back. Embrace the power of 'Design with GPT-4'. Become the Michelangelo of UI/UX design and start crafting masterpieces that'll leave users stunned and competitors crying into their obsolete design handbooks. Because, let's face it, the world could always use a few more design superheroes, right?
The Big O Journey: A Tale of Efficiency and Chuckles
Tags: webdev, algorithms, javascript, beginners
Published: 2023-05-31 15:39:29

Hey there, fellow code wizards and programming enthusiasts! Today, we're embarking on a wild and wacky adventure through the fascinating realm of Big O notation. Buckle up and get ready to giggle your way to coding efficiency!

Enter Big O, your secret weapon. Big O is like the Sherlock Holmes of algorithms. It helps you measure the performance of your code and tells you how it scales with larger inputs. You can think of it as your algorithmic crystal ball, predicting how your code will handle bigger and Badder challenges.

But wait, there's more! Big O has its own quirky language, filled with fancy symbols and odd expressions. Just like deciphering ancient hieroglyphics, it might make your head spin at first. Fear not, intrepid traveler! Let's break it down into bite-sized comedy nuggets:

## `O(1)`: "The Constant Comedian"
 - This rockstar algorithm doesn't care about the size of your input. It's always lightning-fast, like a magician pulling a rabbit out of a hat. No matter how big the hat is, the rabbit appears in a snap! It's the algorithmic equivalent of instant ramen—quick and satisfying!

## `O(n)`: "The Linear Juggler"
 - Picture yourself juggling balls—easy peasy, right? Now imagine juggling more balls, one by one, as their number increases. O(n) algorithms do just that—they scale linearly with the size of the input. The more balls (or data points) you have, the longer it takes to juggle them all. It's like watching a clown trying to juggle elephants—a bit slow, but entertaining nonetheless!

## `O(n^2)`: "The Quadratic Prankster" 
- Brace yourself! This algorithm is a mischievous prankster, wreaking havoc in the kingdom of efficiency. As the input grows, it multiplies the time it takes to complete exponentially. It's like a snail on a caffeine rush, leaving behind a trail of sluggishness and chaos. Beware the quadratic prankster—it loves to make you wait!

## `O(log n)`: "The Logarithmic Magician"
 - Ah, the smooth operator of algorithms. O(log n) is like a magic trick where the time it takes to execute decreases drastically as the input size grows. It's like playing a game of "Guess the Number," but every wrong guess cuts the search space in half. It's quick, mysterious, and impresses all the algorithmic party guests!

> May your code be elegant, your bugs be few, and your laughter be plentiful as you master the magical art of Big O! Happy coding, and remember to keep the chuckles alive!

Remember, dear adventurers, understanding Big O is key to optimizing your code and slaying inefficiency monsters. So, grab your code swords, polish your algorithmic shields, and venture forth into the vast realm of efficiency.
"From Occupational Therapy to Code": CodeNewbie Podcast S24E4
Tags: podcast, codenewbie, career, beginners
Published: 2023-05-31 15:34:49

In S24E4 of the CodeNewbie Podcast, @saronyitbarek talks about building inclusive web applications with [Africa Mincey](https://twitter.com/AfricaKenyahe), Accessibility Engineer! 

{% embed https://www.codenewbie.org/podcast/from-occupational-therapy-to-code-9bdf0aef-ccb2-423d-9084-da2623c253fc %}

Africa Mincey is a Software Engineer and accessibility specialist specializing in human-centered full-stack web development, assistive technology and web accessibility, technical writing, content creation, and community building. She uses web development tools to create dynamic and responsive web applications using HTML, CSS, JavaScript, Express, MongoDB, and Node.JS. She shares her journey merging therapy and technology on her [YouTube channel](https://youtube.com/user/africakenyah) and [blog](www.africakenyah.com).

- [Listen on Apple Podcasts](https://podcasts.apple.com/us/podcast/s24-e4-from-occupational-therapy-to-code-africa-mincey/id919219256?i=1000615131036)

- [Listen on Spotify](https://open.spotify.com/episode/3fmk3z9KMQ8Umm1LBZ2NnM?si=4e0bae43412442a5)

Or, listen wherever you normally get your podcasts!

***

**Make sure to subscribe to the CodeNewbie podcast if you haven't yet!**

Happy coding! We hope you enjoy this season of the CodeNewbie Podcast 💜
Think About AXIOS!
Tags: javascript, axios, httprequest, node
Published: 2023-05-31 15:24:17

Axios- itself a JavaScript library. It's used for making HTTP requests from Node.js environment. 

It allows us to getting web API that handles asynchronous requests. Which makes it easier to work with web APIs and retrieve data form servers.

**What Axios provides?**

- supports promises.
- cleaner syntax.
- better error handling.
- request/response interception.
- automatic JSON parsing.
- request cancellation.

Axios can be used in both client-side & server-side development.

Explore more on- https://axios-http.com/docs/intro
React Turns 10: A Decade of Making Developers Question Their Life Choices
Tags: react, javascript, webdev
Published: 2023-05-31 15:23:37

Raise your glasses, folks! React, the beloved (and sometimes despised) JavaScript library, is turning 10. A decade of joy, tears, and countless hours spent on StackOverflow. Let's embark on this nostalgic journey, shall we?

Ah, React. The JavaScript library that has been both the wind beneath our wings and the thorn in our sides for the past decade. It's been 10 years of love, hate, and everything in between. So, let's take a moment to celebrate this milestone, shall we?

First, let's talk about JSX. Who doesn't love writing HTML in their JavaScript? It's like mixing chocolate with pickles - a combination you never knew you needed until you had it. And let's not forget about the joy of debugging when you forget to close a tag. Pure bliss!

Then there's state management. Because who doesn't love spending hours trying to figure out why a component isn't rendering correctly, only to realize it's because you forgot to update the state? It's like a treasure hunt, but instead of finding gold, you find a bug. And the satisfaction you get when you finally fix it? Priceless!

And let's not forget about the endless list of libraries and tools that come with React. Redux, React Router, Enzyme, Jest - the list goes on. It's like being in a candy store, but instead of sweets, you get libraries. And just like in a candy store, you can't just pick one. You need them all!

But despite all the headaches and late-night coding sessions, we've stuck with React. Why? Because for all its quirks and complexities, it's a powerful tool that has changed the way we build web applications. It's given us the ability to create dynamic, interactive UIs with ease. And let's be honest, we kind of enjoy the challenge.

So here's to React, the JavaScript library that has kept us on our toes for the past decade. May the next 10 years be filled with even more bugs to fix, libraries to learn, and components to render. **Happy birthday, React!**