teleren/devto huggingface dataset:
JavaScript Design Patterns - Structural - Decorator
Tags: programming, javascript, beginners
Published: 2024-05-03 02:47:18

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

**Decorator** is a structural design pattern that allows us to attach new behaviors to objects by placing them inside special wrapper objects containing them.

In the example below, we use a decorator to extend behavior in Facebook Notifications.

```js
class Notification {
  constructor(kind) {
    this.kind = kind || "Generic";
  }
  
  getInfo() {
    return `I'm a ${this.kind} Notification`;
  }
}

class FacebookNotification extends Notification {
  constructor() {
    super("Facebook");
  }
  
  setNotification(msg) {
    this.message = msg;
  }
  
  getInfo() {
    return `${super.getInfo()} with the message: ${this.message}`;
  }
}

class SMSNotification extends Notification {
  constructor() {
    super("SMS");
  }
  
  getInfo() {
    return super.getInfo();
  }
}

export { FacebookNotification, SMSNotification };
```

👉 Use this pattern when adding extensions to an object in runtime without affecting other objects.

---

I hope you found it helpful. Thanks for reading. 🙏

Let's get connected! You can find me on:
- **Medium:** https://medium.com/@nhannguyendevjs/
- **Dev**: https://dev.to/nhannguyendevjs/
- **Hashnode**: https://nhannguyen.hashnode.dev/
- **Linkedin:** https://www.linkedin.com/in/nhannguyendevjs/
- **X (formerly Twitter)**: https://twitter.com/nhannguyendevjs/
- **Buy Me a Coffee:** https://www.buymeacoffee.com/nhannguyendevjs
House Painters Services in Christchurch
Tags: wallpapering, interior, exterior, painting
Published: 2024-05-03 02:39:29

Are you considering giving your home a fresh new look? Look no further! Our [professional house painters](http://djparkyn.co.nz/) services in Christchurch are here to transform your space into a masterpiece. Whether you're looking to enhance your home's curb appeal or revamp its interior, our expert team has you covered.

## Why Choose Our House Painters Services?

### Expertise in Interior Painting:

Our team of skilled painters specializes in [interior painting](http://djparkyn.co.nz/interior-painting/), bringing life and vibrancy to every room in your home. From accent walls to full-room transformations, we have the experience and expertise to deliver exceptional results.

### Attention to Detail:

We understand that the key to a flawless paint job lies in the details. That's why we meticulously prepare surfaces, ensuring smooth and even coats of paint that will stand the test of time. Our attention to detail sets us apart and ensures a finish that exceeds your expectations.

### Tailored Solutions for Every Home:

At House Painters Christchurch, we recognize that every home is unique. That's why we offer personalized painting solutions tailored to your specific needs and preferences. Whether you're looking to refresh your living space or completely transform your home's exterior, we have the skills and creativity to bring your vision to life.

### Commitment to Quality:

Quality is at the forefront of everything we do. From the paints we use to the techniques we employ, we never compromise on quality. We source premium paints and materials to ensure long-lasting results that enhance the beauty and value of your home.

### Exceptional Customer Service:

Our dedication to customer satisfaction sets us apart from the rest. From your initial consultation to the final brushstroke, we prioritize clear communication, professionalism, and respect for your home. Our goal is to make the painting process as smooth and stress-free as possible, leaving you with a home that exceeds your expectations.

## Transform Your Home Today!

Ready to transform your home with our professional [house painters services in Christchurch](https://maps.app.goo.gl/9qRpJcsygn1zd5pS7)? Contact us today to schedule your consultation. Whether you're planning a small interior update or a complete home makeover, we're here to bring your vision to life. Let us help you elevate your space and make your house feel like home.

## Conclusion:

With our expert house painters services in Christchurch, you can elevate your home with confidence. From interior painting to exterior transformations, we have the skills, experience, and dedication to deliver exceptional results that exceed your expectations. Contact us today to schedule your consultation and take the first step towards transforming your home into a masterpiece.
obs failed to connect to any servers please check your internet connection and try again
Published: 2024-05-03 02:38:32

So this was fixed by having to select the RIGHT service which in this case was **Youtube -HLS**

NB: Selecting Youtube - RTMPS would result in the error message below:

> obs failed to connect to any servers please check your internet connection and try again


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u6tk4uit5hjolj4z54ud.png)
1 Law of Success as a Developer
Tags: webdev, javascript, beginners, programming
Published: 2024-05-03 02:16:00

The first law to having a long and healthy career in software development is to embrace your imposter.

We like to complain in the industry all the time about imposter syndrome. And it is a real psychological thing that some people have.

But I think we often claim that we are experiencing an imposter syndrome and we are not. We are just programmers!

Let me give you an example. Myself, after over 10 software projects, every project I joined, and this includes the project I worked on last year.

For the first three months of that project, I'm swimming in frameworks I have never seen, patterns that are maybe somewhat new, weird aspects to the business that I have never encountered.

And yet everybody on the team wants to pretend that they are so experienced, that they know exactly what is going on.

But, if you are actually really intelligent, and you have any sense of self awareness, you will know that I don't know everything that is going on in the project.

And I think if you can become comfortable with that, and just accept that that is part of the job, you are going to have a long career in software.

Now, if you don't like that, you are probably in the wrong position.

Happy Coding!
Karl

P.S. Congratulations on the guys that have already bought the course. I'll increase the price at midnight. Don't buy if you have already bought it. [Get it here](https://karlgusta.gumroad.com/l/eofdr).
MMOexp: How Diablo 4 Malignant Hearts work
Tags: games
Published: 2024-05-03 01:44:28

Enter the Diablo 4 subreddit. Unlike many, many subreddits out there, Diablo 4's 

dedicated forum is actually nice and useful, chock-full of players looking to <a href="https://www.mmoexp.com/Diablo-4/Gold.html">Diablo 4 Gold</a> help 

each other out with the grind by providing the most comprehensive gear and activity 

information possible.

Diablo 4 Malignant Hearts list and how to use them | MMOEXP
Diablo 4 Season 1 is upon us, and that means you're probably out there hunting for a 

powerful new class modifier. Diablo 4 Malignant Hearts are a new type of socketed 

item introduced as part of Season of the Malignant, and they contain the power to 

unlock destructive new builds as you level through the Season Journey in Diablo 4.

Here I'm going to explain what the caged hearts are and where you can find them. I'm 

also going to walk you through the full Diablo 4 Malignant Hearts list, and cover 

all of the powers and bonuses that the new collectible items can unlock. There's a 

lot to wrap your head around, but remember, before you can enjoy any of this you'll 

need to learn how to create a seasonal character in Diablo 4 and complete chapter 1 

of the Season Journey in Diablo 4 Season 1.

How Diablo 4 Malignant Hearts work

(Image credit: Blizzard)
Malignant Hearts in Diablo 4 are a brand new socketable item, introduced 

specifically for Season 1. You can equip three Caged Hearts at once, with one being 

placed in your Amulet and then in one of <a href="https://www.mmoexp.com/Diablo-4/Gold.html">cheap Diablo 4 Gold</a> your two rings.
DeploySolo – The SaaS template in 1 file. (PocketBase/ htmx)
Tags: webdev, programming, go, htmx
Published: 2024-05-03 01:03:06

https://deploysolo.com/
	
Golang is an incredible language for web development. That being said, indie developers and small businesses will likely miss extensive resources found in other projects like Django. Although building an application from the ground up using the standard library is possible, it can be error prone and time consuming.

Pocketbase has almost everything an indie developer needs, supporting database, authentication, and file storage into a single, easy-to-deploy executable. Combined with htmx, and you can create a full stack web application without bloated front end frameworks. That being said, its a relatively new project, without extensive hands on resources for new developers to dive in and create full projects.

This is why I'm building DeploySolo. On the surface, its a SaaS boilerplate carefully crafted to leverage the best of these technologies. Looking further, it is my mission to create cook books and resources for indie hackers and small businesses to build real world apps using this stack without feeling lost.
Entendendo Generics em Kotlin
Tags: kotlin, backend, generics, programming
Published: 2024-05-03 01:01:56

**O que são Generics**

Generics são uma parte essencial da linguagem Kotlin que permite que escrevamos classes, interfaces, e funções que funcionem com tipos específicos, mas sem declarar esses tipos antecipadamente. Em vez disso, podemos fornecer os tipos quando usarmos essas classes, interfaces ou funções.

---

**Benefícios de usar Generics**

- Reutilização de código: Você pode escrever classes, interfaces e funções que funcionam com qualquer tipo de dado, aumentando a reutilização do código.

- Segurança de tipo: O uso de generics ajuda a detectar erros de tipo em tempo de compilação, o que pode evitar erros em tempo de execução.

- Performance: Generics não criam overhead em tempo de execução, pois o tipo é verificado em tempo de compilação.

---

**Como usar Generics em Kotlin**

Funções Genéricas

```
fun <T> listOfNotNull(vararg elements: T?): List<T> {
    return elements.filterNotNull()
}

val listaDeInteiros: List<Int> = listOfNotNull(1, 2, null, 4)
```

Classes Genéricas

```
class Caixa<T>(val elemento: T)

val caixaDeInteiro = Caixa(10)
val caixaDeString = Caixa("Olá")
```

Interfaces Genéricas

```
interface Repositorio<T> {
    fun salvar(objeto: T)
    fun obter(id: String): T
}

class RepositorioDeCliente : Repositorio<Cliente> {

    private val clientes = mutableListOf<Cliente>()

    override fun salvar(cliente: Cliente) {
        clientes.add(cliente)
        println("Cliente salvo: $cliente")
    }

    override fun obter(id: String): Cliente? {
        return clientes.find { it.id == id }
    }
}
```

---

**Restrições de tipos (bounded type parameters)**

Em Kotlin, você pode restringir quais tipos podem ser usados como argumentos genéricos. Por exemplo, você pode restringir o tipo genérico a ser uma subclasse de uma determinada classe ou implementar uma determinada interface.

```
class Caixa<T : Number>(val elemento: T)

val caixaDeInteiro = Caixa(10) // Válido
val caixaDeDouble = Caixa(10.0) // Válido
val caixaDeString = Caixa("Olá") // Erro de compilação
```

---

**Conclusão**

Generics são uma ferramenta poderosa em Kotlin, que permite escrever código flexível, seguro e reutilizável. Espero que este artigo tenha ajudado você a entender como usar generics em suas aplicações.

---
umi3 study
Published: 2024-05-03 01:01:53

1. use pnpm to create one umi simple template; 
if you want to use ant-mobile; just npm i ant-mobile; just save;
2. 
.some umi3 don't auto load umi-plugins in dependency on your peoject。 you can pnpm add -D @umijs/plugins then you must manually start them;  for example 

```
plugins: ['@umijs/plugins/dist/antd'],
  antd: {}

```

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eiqv00manjgooik0m5w7.png)
but if you use ant; don't have comfortable .d.ts for it;you should install .d.ts of ant-design;

4.dont forget if you add code   plugins: `['@umijs/plugins/dist/antd']` but these don't indicate plugin start; you must write these configuration item
eg. `model: {

  }`; they will load and start `@umijs/plugins/dist/antd`
5. useEffect is from react `import { useState, useCallback, useEffect } from 'react'`;
🎱 Looking for Snooker Betting Tips? Any recommendations using the SportDevs API?
Tags: snooker, bettingtips, sportdevsapi
Published: 2024-05-03 00:46:41

I am in search of reliable snooker betting tips and would like to leverage the SportDevs API for accurate data. Can anyone provide recommendations or insights on how to use this API effectively for snooker betting predictions? Thank you in advance!
Boiled down: Class in JavaScript
Tags: webdev, javascript, beginners, learning
Published: 2024-05-02 18:03:12

## Similarities and differences between Class and Constructor Functions

In JavaScript, classes are similar to constructor functions in that they both provides ways to create objects with prototypal inheritance. Some claim that classes are essentially syntatic sugar for over constructor functions, but there are differences...

Classes differ from constructor functions in that 
- They are labelled by a special internal property called `[[IsClassConstructor]]`
- Class must be called with `new`
- Class methods are non-enumerable, so we can't use `for..in` to retrieve class methods (which we don't usually want anyway)
- Classes always `use strict` inside its construct


```
class User {
  greet() {
    return "Hello, there"
  }
}
```


## Class Expressions

Classes can be defined inside another expression, passed around, returned, assigned, etc.

```
// Class expression
let User = class {
  greet() {
    return "Heyo";
  }
}
```

Class expressions may also have a name:
```
let User = class CoolClass {
  greet() {
    return CoolClass
  }
}

new User().greet(); // Returns CoolClass definition
console.log(CoolClass) // error, not visible outside of the class
```

## Class fields

Class fields is a feature that allows you to define properties directly on the class itself, instead of within the constructor method. It provides concise and readable code:

```
class User {
  name = "Joseph";
  surname = "Joestar";

  greet() {
    console.log(`Hello, this is ${this.name} ${this.surname}`)
  }
}

const user = new User();
user.greet(); // Hello, this is Joseph Joestar
```
Add a `#` in front of the variable turns properties into private ones: `#name`.

You can also create _static fields_ to define a property that is shared among all instances of the class.

```
class User {
  static type = "Admin";

  constructor(name) {
    this.name = name;
  }

  greet() {
    console.log(`Hi, I am ${this.name} and I have ${this.type} permissions`)
  }
}

const user = new User("Joseph");
user.greet(); // Output: Hi, I am Joseph and I have Admin persmissions
```

Note: Class fields are a relatively new feature in JavaScript and may not be supported across all browsers and JavaScript environments. You may need to use polyfill or a transpiler like Babel to ensure compatibility with older environments.
Self Introduction
Tags: webdev, beginners, programming, learning
Published: 2024-05-03 00:32:33

## **About me**
I'm Rocky from Japan. I majored in International politics and relationship in university. While I was in my university, I went to Melbourne, Australia to study English and lived there for 6 months. After graduation, I worked for a software company in Japan as back-end engineer. I used html/css, javascript, Vue.js in front-end, and Java, C#, php in back-end. Now I'm in a college with the course of web development in Vancouver.

I like traveling and I've been to 16 countries such as Korea, Thailand, Turkey, the US, etc. I haven't been to Latin countries and now I really want to visit there.
Also, I like to play games. I like to play Nintendo Switch and play Pokemon, Mario Bros, Splatoon and so on.

The reason why I came to Vancouver is because I'd like to get a job and live here in Canada. Living in other country is my dream from my childhood and I was fascinated by Canada because of its "Mixed culture." I'd like to improve myself to be an engineer.


First week of my course has finished. Here is the review. 

## **My expectation for this course**
I'd like to get skills for front-end engineers. I worked as a back-end engineer in Japan and have some knowledge. Therefore, I'd like to brush up my skills and learn languages, frameworks and any others skills which are widely used in Canada. 

## **How was my experience with this course**
I think this environment is what I want. My teacher and classmates are nice guys. And I can learn engineering in English. I hope I have a good time with this course.

## **What I want to achieve after this course**
My goal is working as a front-end engineer in a company in Canada. I'd like to learn a lot from this course and become an engineer who can make money for companies.
is anyone good at tilemap?
Tags: gdscript, godotengine, help
Published: 2024-05-03 00:07:20

I've made a good amount of progress with this game on making it but the problem I haven't fixed has been the tile map, I've been just working on everything else than it because I know its my hardest weak point because I've watched so many tutorials, but not for what I want. For a tower defense.
Modules Status Update
Tags: puppet, community
Published: 2024-05-07 16:33:16

---
title: Modules Status Update
published: true
date: 2024-05-03 00:00:00 UTC
tags: puppet,community
canonical_url: https://puppetlabs.github.io/content-and-tooling-team/blog/updates/2024-05-03-modules-status-update/
---

## Weekend again!!

Hello again, and happy Friday to all! While there isn’t much to report from the Modules team in Pune, we’re excited to announce the new features recently released on Forge. Our team has carefully considered user feedback in developing these enhancements, and we believe they will greatly enhance your experience on Forge.

- Track module updates — no more manual searching for the large number of modules in your infrastructure.
- Gain visibility into your modules — see when they were downloaded and compare them against the latest versions, so that you don’t fall behind on your updates.
- See a snapshot of your current state — all you have to do is upload a Puppetfile.
- Keep track of frequent searches — spend less time sorting through filters for platforms, supported versions, and more.

## Community Contributions

We’d like to thank the following people in the Puppet Community for their contributions over this past week:

- [`puppetlabs-apache#2540`](https://github.com/puppetlabs/puppetlabs-apache/pull/2540): “Add missing brackets for function call”, thanks to [gerlingsm](https://github.com/gerlingsm) and the following people who helped get it over the line ([bastelfreak](https://github.com/bastelfreak))

- [`puppetlabs-apache#2535`](https://github.com/puppetlabs/puppetlabs-apache/pull/2535): “Add EnableSendfile per directory”, thanks to [kajinamit](https://github.com/kajinamit)

- [`puppetlabs-apache#2521`](https://github.com/puppetlabs/puppetlabs-apache/pull/2521): “Added cache\_disk”, thanks to [dploeger](https://github.com/dploeger) and the following people who helped get it over the line ([smortex](https://github.com/smortex), [ThomasMinor](https://github.com/ThomasMinor))
Starter Nuxt Template
Published: 2024-05-02 23:49:31


```
npx nuxi@latest init starter
cd starter
pnpm install -D typescript
pnpm add lucide-vue-next
npx nuxi@latest module add shadcn-nuxt
npx shadcn-vue@latest init
npx shadcn-vue@latest add button
npx shadcn-vue@latest add badge
npx shadcn-vue@latest add card
npx shadcn-vue@latest add sheet
npx shadcn-vue@latest add input
npx shadcn-vue@latest add label
npx shadcn-vue@latest add dropdown-menu

```
Starting a Game Studio
Tags: gamedev
Published: 2024-05-02 23:20:43

Yeah... usually a bad idea, but we've got a team of 4 together and the beginnings of development!

## Who Are We
[STAG](https://saythatagaingames.itch.io/) (Say That Again Games) is a new Australian game studio.
I am the lead programmer, but we also have a broader range of skills in art, sound, and everything we could need in-between.
Most importantly, we're willing to learn, and this is why we believe our games will get better and better as times go on.

## Our First Game
Well if we're starting a studio, we need to make games, right?
Luckily we have our first idea which is planned for release on the **30th of June**.
The game is called [Cheese Clout](https://saythatagaingames.itch.io/cheese-clout), a simple game where you (a rat), have to steal cheese without getting caught.
The game is planned to be free!

## Extras
We realize that STAG isn't going to get anywhere without a community, which is why we're also planning to release the level editor for our game. We want to see our games taken to the limits, to the point of absurdity.

## Final Thoughts
I'm really excited to start this, and I'll still be developing [CompNerdSim](https://chigbeef.itch.io/compnerdsim) myself just as I already was, but I will be able to create better things with a team.
Make sure to post any questions in the comments, and thank you for supporting a new game studio (: