teleren/devto huggingface dataset:
Integrating SSO with Laravel Auth Provider
Tags: oauth, laravel, authentication
Published: 2024-01-29 19:30:09

At my company we have our own SSO server (based on Laravel passport) and we use our sdk (Laravel package) that provides the middleware and other functionality to communicate with the SSO server and we add to all our microservices. 

We decided to add the functionality of the SDK so that our SSO user data gets passed into the Auth provider. The Auth facade allows one to do things like fetching the logged-in user with `Auth::user()`. Thankfully Laravel allows one to extend the [user provider](https://laravel.com/docs/10.x/authentication#the-user-provider-contract)

One of the methods that can be overwritten is `retrieveById`. Our code to fill the Auth user looks something like this (simplified):

```
<?php
namespace Company\SSO\Auth\UserProviders;

use Illuminate\Contracts\Auth\Authenticatable
use Illuminate\Contracts\Auth\UserProvider;

class SSOUserProvider implements UserProvider
{
  public function retrieveById($identifier): ?Authenticatable
  {
    $user = SSO::webUser(); //this fetches the web user from  our SSO server

   if(!$user) { 
    return null;
   }

  /**
  * LaravelUser is a class that we created that implements the
  * Authenticatable contract 
  */
  return new LaravelUser(
    $user->id,
    $user->name,
    $user->email,
    $user->emailVerifiedAt,
    $user->isAdmin,
    $user->createdAt,
    $user->updatedAt,
    $user->activeGroup 
  );
 }
}
```
The custom user provider needs to be added to the auth.php config and resolved in the boot method of the ServiceProvider class. You can read about this here: [Adding custom user providers](https://laravel.com/docs/10.x/authentication#adding-custom-user-providers)

We actually went a step further and also added custom guards by using `Auth::extend()` in the boot method of the ServiceProvider. For that we pretty much followed what is described here: [Adding custom guards] 
(https://laravel.com/docs/10.x/authentication#adding-custom-guards)
NestJs JWT를 이용하여 인증 처리, 2024-01-30
Tags: nestjs
Published: 2024-01-29 19:29:04

```
npm install @nestjs/jwt @nestjs/passport passport passport-jwt --save
```
payload에는 중요한 정보는 넣지 않는다

```
npm install @types/passport-jwt --save
```
Learning Ruby
Published: 2024-01-29 19:22:03

Data types: Numbers, Strings, Booleans

Math: Addition (+)

Subtraction (-)

Multiplication (*)

Division (/)

Exponentiation (**)

Modulo (%) = returns the remainder of division. Ex: 25 % 7 = 4
7 goes into 25 three times with 4 being left over.

Puts and Print:
Print: takes whatever you give it and prints it to the screen
puts: (puts string) adds a new line after the thing you print. Lets you see the result of something or variable.

The '.length' method: methods are summoned using (.). 
if you have a string and take the length, it counts the characters, numbers, letters, and spaces.

The '.reverse' Method: it spits out a backwards version of the string you gave it.

'.upcase' & '.downcase': .upcase and .downcase methods convert a string to ALL UPPER CASE or all lower case, respectively.

.capitalize: Capitalizes the first letter of a string.

Single-Line Comments: # is for comments in ruby
Multi-Line Comments: =begin, =end 

Variable: declare it by setting it = to something
gets: gets input from user.
chomp: removes extra line
This year, I'll commit at least one line of code 😃
Tags: devresolutions2024
Published: 2024-01-29 19:18:22

---
title: This year, I'll commit at least one line of code 😃
published: true
tags: devresolutions2024
---

<!-- ✨ Feel free to customize this template to suit your needs—adjust the title, structure, and wording as you see fit! ✨ -->

My current life ethos _has_ to be about not overcommitting, so I'm keeping this as real and attainable as possible! Thanks @michaeltharrington for the helpful template <3

## Professional Goals:

1. **Goal:** I'd love to write some code - literally anything. It's been a while but I really miss using my brain in that way and I want to feel closer to what we've built.
2. **Action Steps:** Well, Codespaces is A Thing now (yes, it's really been that long!) so that has lowered the barrier dramatically. My plan is to get set up there and make some copy adjustments in one of our automated emails to start.
3. **Timeline:** I actually have a WIP PR right now but I forgot about tests so need to give that some consideration. It can feel difficult to justify spending time on something that would take my teammates 2 minutes to do, so I will probably save this as a Friday afternoon task one of these upcoming Fridays 😅

## Personal Aspirations:

1. **Aspiration:** I'd like to set up an automation where I can get my google home to warm up my car by voice command or automatically lock it after X amount of time. I've dug through some docs and it seems very doable and fun!
2. **Why it Matters:** Well, it would be nice for my car to be locked more often -- my mother in law's car literally got stolen in front of our house a few weeks ago! Note: the reason my car is unlocked a lot is because it automatically unlocks when we walk by it with the key in our pocket, and we just don't notice a lot of the times 😩 - we haven't disabled it because that _is_ a nice feature when I'm wrangling groceries + a toddler. Pros and cons!
3. **Support System:** Gosh, I don't really know. It seems impossible to find any time in the day! I've been talking about it with my partner more and reading about the subject matter so I will be ready to jump at the opportunity should a chunk of time fall in my lap.

## DEV Community Contributions:

1. **Contribution Goal:** I'm reading more content than ever before! It's been a lot of fun and I hope to elevate our authors, esp. folks who are newer to the platform.
2. **Collaboration Plans:** I've been playing with [our threads account](https://www.threads.net/@thepracticaldev) and would appreciate any and all feedback, or just some love, if you're on there!
3. **Measuring Impact:** On the threads front, I'll be looking at our reactions to understand what is resonating most with the community.
Computer Science Learning Platform
Tags: beginners, tutorial, learning
Published: 2024-01-29 19:17:44

Hello, fellow tech enthusiasts, budding software engineers, and curious minds, I'll be sharing insights, experiences, and valuable resources to support the growth and development of the tech field.

**What to Expect:**
  - This blog is dedicated to all aspiring CS students who are 
    eager to dive into the world of technology. I'll be covering 
    wide array of topics about Software Engineering, starting from 
    fundamental programming concepts, data structures and 
    algorithms(DSA), to front-end and back-end development. 

  - The goal is to create a comprehensive resource hub that 
    empowers you to not only understand these concepts but also 
    apply them in real-world projects.

**Why this Matters:**
  - In a rapidly evolving tech industry, having a strong foundation in programming and technology is crucial. Academic courses alone are not enough, that's why we explore personal projects, relevant certifications, and build portfolios. 

- My commitment is not just to share knowledge but to foster a supportive community where we can learn and grow together. I believe that by supporting each other, we can pave the way for a stronger, more inclusive tech community.

**How It Will Help You:**
  - Gain a deeper understanding of programming concepts.
  - Master data structures and algorithms for effective problem- 
    solving.
  - Explore the ins and outs of front-end and back-end 
    development.
  - Acquire practical skills through real-world projects.
  - Connect with a community of like-minded individuals who share 
    your passion for technology.

Stay tuned for upcoming posts, and let's make this learning adventure memorable!
How to sync a Nested Set(self-referencing) table into closure table using triggers?
Tags: help, database
Published: 2024-01-29 19:14:44

As I ask upon:
https://dba.stackexchange.com/q/335297/118215

I try to sync a self-referencing table into a nested set one.

So far I manged to do it via insert trigger (for more clarity look at question):

```
CREATE TRIGGER "insert_sync_closure" ON files
AFTER insert AS
BEGIN
    INSERT INTO files_closure(parent_id,child_id)
    select files_closure.parent_id as parent_id ,INSERTED.id as child_id
    from INSERTED join files_closure on INSERTED.id=files_closure.parent_id
    where  files_closure.child_id = INSERTED.folder
END

```

And initialize it using a recusive SQL query. But I am kinda stuck upon updating it using a trigger upon delete and update.

May I have your help with that?
Setup Node and NVM with Fish Shell
Tags: node, nvm, fish, shell
Published: 2024-01-29 19:12:58

---
title: Setup Node and NVM with Fish Shell
published: true
description: 
tags: node, nvm, fish, shell
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vx17o8evt7i9ioaa434m.png
# Use a ratio of 100:42 for best results.
# published_at: 2024-01-29 19:02 +0000
---

Here is how to quickly install NVM with Fish Shell. I do assume here that you have fish shell installed and bew. If you don't have fish shell installed, you can follow my other tutorial here: [TL;DR setup Fish Shell MacOS](https://dev.to/fabientownsend/tldr-setup-fish-shell-macos-2ee2)

1: Install nvm with brew
``` sh
brew install nvm
```

2: Install `bass` for Fish Shell
```
omf install bass
```

3: Configure Fish shell

``` sh
# ~/.config/fish/config.fish

...

function nvm
  bass source (brew --prefix nvm)/nvm.sh --no-use ';' nvm $argv
end

set -x NVM_DIR ~/.nvm
nvm use default --silent
```

And that's it, you are good to go, you can install node now:
``` sh
nvm install --lts
```
Effortless Elegance: Simplified Vietnamese Subtitle Mastery
Tags: vietnamesesubtitle, vietnamesesubtitles
Published: 2024-01-29 19:04:34

Unlock a world of possibilities with Simplified **[Vietnamese Subtitle](https://simplified.com/subtitle-generator/vietnamese)** Generator, designed to effortlessly add accessibility to your videos. Our user-friendly tool combines artificial intelligence with a sleek design, making it easy for creators to enhance engagement. Tailor subtitles to your creative vision with customizable options, and download them in different formats for versatile use. Backed by a user-friendly refund policy, Simplified Vietnamese Subtitle Generator is your key to a more inclusive and globally connected audience. Break down language barriers and captivate your audience with Simplified Vietnamese Subtitle Generator. In just three steps, you can transform your videos into a more inclusive experience. Our tool offers customizable features, allowing you to match subtitles to your unique style. Download subtitles in SRT or VTT formats, providing flexibility for diverse platforms. Simplified commitment to user satisfaction is evident in our refund policy, offering assurance as you explore the enhanced engagement brought by Vietnamese subtitles.
Enhance your content effortlessly with Simplified Vietnamese Subtitle Generator. This AI-powered tool revolutionizes the way you add **[Vietnamese subtitles](https://simplified.com/subtitle-generator/vietnamese)** to your videos, making the process intuitive and accessible.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/btn59nwl8r7lizn54xjs.jpg) Customize font styles and sizes to align with your creative vision, and download subtitles in various formats for seamless integration. Simplified Vietnamese Subtitle Generator is not just a tool; it's a pathway to a more connected and inclusive digital landscape, breaking down language barriers and maximizing engagement. Seamlessly integrate Vietnamese subtitles into your videos with Simplified AI-powered generators. Tailor your content for a global audience effortlessly and enhance viewer engagement. Elevate your video content with Simplified Vietnamese Subtitle Generator, a user-friendly tool designed for easy customization and download in SRT or VTT formats. Experience the magic of breaking language barriers – Simplified Vietnamese Subtitle Generator offers a quick and effective solution for creators seeking accessibility and inclusivity in their videos.
Ibuprofeno.py💊| #38: Explica este código Python
Tags: python, learning, spanish, beginners
Published: 2024-01-29 19:04:29

## **<center>Explica este código Python</center>**
#### <center>**Dificultad:** <mark>Básico</mark></center>

```py
## Reto #38
print((True + 0.5) * False)
```

- A. `0.0`
- B. `0`
- C. `1.5`
- D. `2.5`

---

Respuesta en el primer comentario.
LET’S GO!
Tags: letsgo, technology, engineering, people
Published: 2024-01-29 19:02:51

_Here we go_

## Tech Blog Launch

We, the engineering community of MediaMarktSaturn Technology, the IT partner of the electronics retailer MediaMarkt and Saturn, will share our passion for tech with you.

You can expect any kind of tech content popping up here; we are a strong team of hundreds of passionate engineers covering all disciplines of software engineering, infrastructure management, cloud operation and much more.

And we will write about it... stay tuned.

**_get to know us 👉 [https://mms.tech](https://mms.tech) 👈_**
Ibuprofeno.py💊| #37: Explica este código Python
Tags: python, spanish, learning, beginners
Published: 2024-01-29 18:57:17

## **<center>Explica este código Python</center>**
#### <center>**Dificultad:** <mark>Básico</mark></center>

```py
## Reto #37
x = y = z = False
print(x)
```

- A. `True`
- B. `False`
- C. `0`
- D. `z`

---

Respuesta en el primer comentario.
Icon and Text Animation: The start of a journey.
Tags: codepen, animation, animejs, svganimation
Published: 2024-01-29 18:52:31

<p>Animating SVGs and other HTML elements in the DOM with JavaScript and libraries such as Anime.JS</p>

https://codepen.io/collection/WvPoOR

<h2>Scrambled SVG Icon</h2>
{% codepen https://codepen.io/Code-Nit-Whit/pen/RwdjGZP %}

<h2>Text Glitch </h2>
{% codepen https://codepen.io/Code-Nit-Whit/pen/ExMbRWx %}
Am I a shark or kitten?
Tags: beginners, productivity
Published: 2024-01-29 18:51:07

I am starting my journey after thinking about it for the last 20 years. I have all sorts of things I would love to build, so here I am halfway through my life and getting ready to be a forever learner! Not sure what kind of dev I will be, but I am about to find out. I'd love to hear from the community your favorite thing you have coded/built so far.
AMP Credit Loan Customer care Helpline number⚡ ✔️7477325529*//9706590327 Contact Us.
Tags: webdev, javascript, beginners, tutorial
Published: 2024-01-29 18:45:36

AMP Credit Customer care Helpline number⚡➐➍➀➄➍➌➆➅⓿➊✔️7477325529*//9706590327 Contact Us.AMP Credit Customer care Helpline number⚡➐➍➀➄➍➌➆➅⓿➊✔️7477325529*//9706590327 Contact Us.
AMP Credit Customer care Helpline number⚡ ✔️7477325529*//9706590327 Contact Us.
Tags: javascript, webdev
Published: 2024-01-29 18:44:55

AMP Credit Customer care Helpline number⚡➐➍➀➄➍➌➆➅⓿➊✔️7477325529*//9706590327 Contact Us.
The Basics of React
Published: 2024-01-29 18:39:29

When making a website you have multiple options for extension to use. From JQuery,  Angular JS, and more to choose from. The best one I believe You should use is React JS. It’s a javascript library that helps build the user interface(UI). It’s used in the front end for updating UI when something in the code changes the HTML code. An example could be something like displaying the current time. For that to happen you have to use the createRoot Component to bind the HTML file to the JS file. Allowing the js file to hold all the functions to be used on the HTML file.

In 2011 Facebook started to have some code maintenance problems. With ads starting to get some new features, it started to slow down FaceBook’s code maintenance. During that time a prototype of React was being made to fix the problem. Two years later it was released to the public free to use. To use it you will have to install Node js. Then run the command npm install -g create-react-app to install React Globally. The link to install node js will be down below. 


To use react you need to do 3 steps
1. Create a basic HTML file with a div that has an id

```

<html>
    <title>test<title>
    <body>
        <div id =”mainApp”><div
    </body>
</html>

```


     2. create an app.js file and import react 
           .to use React you need to import it the file
            that is using react
```

Import React from ‘react’;

Function App(){
//used to hold important data
this.state= {
This.string = ‘this is a example’
},

Log: function(){
console.log(this.state.example)

//return a div
return(
<div>
<div>hello</div>
<button onCLick={log()}>
</div>
)

}

Export default App;          

```

      



  3. To render app.js you will need to render it using ReactDOM.render() from an index.js file

```

Import React from ‘react’;
Import ReactDom from ‘react-dom’;
Import App from “app.js”
//App will be rendered in the div that holds the ID of mainApp
ReactDOM.render(<App />, Document.getElementById(‘mainApp’));
```


One of my favorite components to use is componentdidmount. When 
you put this function in your code it will run when the page renders. One good example of this would be using it for AJAX requests. You Could use a GET request to get your account information when you log in To your Facebook account. Another good example would be if you try to Go to some sites like an alcohol site. It will ask you to confirm if you're the Appropriate age to use this site.
```
componentdidmount(){
console.log(‘will run when page is rendered’)
}
```


Links used for bolg:
https://www.youtube.com/watch?v=Tn6-PIqc4UM
https://blog.risingstack.com/the-history-of-react-js-on-a-timeline
https://react.dev/learn/installation
https://www.youtube.com/watch?v=hQAHSlTtcmY&t=158s

//download link 
https://nodejs.org/en/download
https://www.geeksforgeeks.org/how-to-install-reactjs-on-windows/
Why should We Buy 43GPT App?
Tags: webdev, beginners, programming, react
Published: 2024-01-29 18:37:11

The Compelling Reasons to Invest in the 43 GPT App

In the ever-evolving landscape of artificial intelligence, the 43 GPT App stands as a beacon of innovation, promising to revolutionize the way we engage in intelligent conversations. As we delve into the reasons why one should invest in this cutting-edge application, we uncover a plethora of features, use cases, and transformative capabilities that make it a compelling choice for developers, businesses, content creators, and professionals across various industries.
More learn please go to link.
**[Get Started]**(https://ncshahaaffiliate.blogspot.com/2024/01/gpt.html)
100 Tips from The Pragmatic Programmers Book: Part 5/10
Tags: career, thepragmaticprogrammer, books, programming
Published: 2024-01-29 18:30:00

#### 5.1. Act Locally.
> Keep the scope of mutable variables and open resources short and easily visible.

&nbsp;
#### 5.2. Take Small Steps—Always.
> Small steps always; check the feedback; and adjust before proceeding.

&nbsp;
#### 5.3. Avoid Fortune-Telling.
> Only look ahead as far as you can see.

&nbsp;
#### 5.4. Decoupled Code Is Easier to Change.
> Coupling ties things together, so that it’s harder to change just one thing.

&nbsp;
#### 5.5. Tell, Don’t Ask.
> Don’t get values from an object, transform them, and then stick them back. Make the object do the work.

&nbsp;
#### 5.6. Don’t Chain Method Calls.
> Try not to have more than one dot when you access something.

&nbsp;
#### 5.7. Avoid Global Data.
> It’s like adding an extra parameter to every method.

&nbsp;
#### 5.8. If It’s Important Enough To Be Global, Wrap It in an API.
> …but only if you really, really want it to be global.

&nbsp;
#### 5.9. Programming Is About Code, But Programs Are About Data.
> All programs transform data, converting an input into an output. Start designing using transformations.

&nbsp;
#### 5.10. Don’t Hoard State; Pass It Around.
> Don’t hang on to data within a function or module. Take one down and pass it around.

&nbsp;
Thanks for reading, happy coding 😀
Loan Star Customer care Helpline number⚡ ✔️7477325529*//9706590327 Contact Us.
Tags: javascript, beginners
Published: 2024-01-29 18:18:43

Loan Star Customer care Helpline number⚡➐➍➀➄➍➌➆➅⓿➊✔️7477325529*//9706590327 Contact Us.Loan Star Customer care Helpline number⚡➐➍➀➄➍➌➆➅⓿➊✔️7477325529*//9706590327 Contact Us.
Python API Tutorial: Mastering API Development for Beginners with Practical Examples
Tags: python, beginners, tutorial, api
Published: 2024-01-29 18:18:28

**Introduction to Python API**
Hey there! If you’re curious about diving into the world of Python and **APIs**, you’ve come to the right place. This Python API tutorial is designed to gently nudge you into the fascinating world where Python meets the web.

**What’s an API?**
Think of an API (**Application Programming Interface)** as a middleman that allows different software applications to talk to each other. In Python, APIs play a crucial role in enabling your code to interact with other software services and data sources seamlessly.

**Python,** known for its simplicity and elegance, is a favorite among programmers, especially beginners. When it comes to API development, Python’s straightforward syntax and a wealth of libraries make it a go-to choice. Whether it’s a simple weather application or a complex data analysis tool, Python makes API integration a breeze.

In this journey, you’ll learn how to create your very own **Python API,** exploring frameworks like Flask and Django, which are like the building blocks for your API projects. We’ll also touch upon RESTful principles, ensuring your APIs play well with others.

As we delve into this Python API tutorial for beginners, remember, it’s all about making different applications work together smoothly. So, get ready to unlock the power of Python APIs and bring your ideas to life!

**Basics of API Development in Python**
Hey there, fellow coder! Are you ready to dive into the exciting world of APIs with Python? Great! Let’s start with the basics and make it as fun and understandable as possible.

First off, APIs (**Application Programming Interfaces**) are like the secret sauce that lets different software applications communicate with each other. Imagine you’re at a restaurant **(your application)** and you order a dish (a request for data or service). The kitchen (a**nother application)** prepares your dish and delivers it back to you. That’s what an API does – it takes requests, processes them, and returns responses.

Now, why are APIs crucial? They allow your Python applications to interact with other software, be it social media platforms, databases, or even IoT devices. This opens up a world of possibilities for creating dynamic, interconnected applications.

Let’s get our hands dirty with a simple Python API example. We’ll create a basic API that returns a friendly greeting. This is a Python API tutorial for beginners, so I’ll keep it simple and clear
**more information about this post** 
**click **[here](https://codewithnazam.com/python-api-tutorial-mastering-api-development-for-beginners-with-practical-examples/)
LoanStar Loan Customer care Helpline number⚡ ✔️7477325529*//9706590327 Contact Us.
Published: 2024-01-29 18:17:13

LoanStar Loan Customer care Helpline number⚡➐➍➀➄➍➌➆➅⓿➊✔️7477325529*//9706590327 Contact Us.LoanStar Loan Customer care Helpline number⚡➐➍➀➄➍➌➆➅⓿➊✔️7477325529*//9706590327 Contact Us.