teleren/devto huggingface dataset:
Elevate Your Workflow Automation with StackStorm: A Quick Docker Setup Guide
Published: 2023-11-16 14:49:35



**Introduction:**
Automating workflows just got easier with StackStorm, a powerful open-source automation platform. In this guide, we'll walk you through setting up StackStorm using Docker and Docker Compose, providing a seamless experience for workflow development and execution.

---

**Getting Started:**
1. Clone the StackStorm Docker repository:
   ```shell
   git clone https://github.com/stackstorm/st2-docker
   cd st2-docker
   ```

2. Familiarize yourself with the directory structure:
   ![Folder structure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a2oozil5kqwdjt1w07bi.png)

3. Optionally, customize your setup by modifying variables in the `docker-compose.yml` file. Key options include:
   - `ST2_VERSION`: Tag for the Docker image.
   - `ST2_IMAGE_REPO`: Image or path to images (default is `stackstorm/`).
   - `ST2_EXPOSE_HTTP`: Port for exposing the st2web service (default is `127.0.0.1:80`).
   - `ST2_PACKS_DEV`: Directory for development packs (default is `./packs.dev`).

---

**Launching StackStorm:**
Execute the following command to start the containers:
```shell
docker-compose up -d
```

![Start StackStorm Containers](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ij08lnw1x29gyge3lkee.png)

Inspect the running containers:
![StackStorm Containers](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uteg1uhvpidxfsnzxm6k.png)

---

**Accessing StackStorm UI:**
Navigate to the UI at [http://localhost/](http://localhost/)

![StackStorm UI](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yck2ukdmueefvdx64t16.png)

Login with the default credentials:
- Username: `st2admin`
- Password: `Ch@ngeMe`

---

**Configuration and CLI Access:**
- Configure your password in `files/htpasswd`.
- Access the StackStorm CLI within the container:
  ```shell
  docker-compose exec st2client bash
  ```
  ![StackStorm CLI](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/an84fzc4kq6x5pqdrt1d.png)

---

**Conclusion:**
With StackStorm up and running in Docker, you're ready to streamline your workflows. Explore the intuitive UI, harness the power of automation, and elevate your development experience. Happy automating!

---

*Feel the Pulse of Automation: Dive into StackStorm with Docker!*
The complete line-up for Patterns Day …and a workshop!
Tags: patternsday, conferences, events, brighton
Published: 2023-11-28 11:25:42

---
title: The complete line-up for Patterns Day …and a workshop!
published: true
date: 2023-11-16 14:46:58 UTC
tags: patternsday,conferences,events,brighton
canonical_url: https://adactio.com/journal/20642
---

The line-up for [Patterns Day](https://patternsday.com/) is complete! You’ll be hearing from [eight fantastic speakers](https://patternsday.com/#speakers) on March 7th 2024 here in Brighton.

I really like the mix of speakers we’ve got…

Half of the speakers will be sharing what they’ve learned from design systems in their organisations: Débora from LEGO, Mary from the Financial Times, Yolijn from the Dutch government, and Samantha from University College London. That’s a good spread of deep dives.

The other half of the speakers can go broad across design systems in general: Vitaly on design patterns, Rich on typography, Geri on accessibility, and Jina on …well, absolutely everything to do with design systems!

I’m so happy that I could get the line-up to have this mix. If you have any interest in design systems at all—whether it’s as a designer, a developer, a product manager, or anything else—you won’t want to miss this. [Early bird tickets are £225](https://ti.to/clearleft/patternsday2024).

But wait! That’s not all. If you _really_ want to dive deep into interface design patterns, then stick around. The day after Patterns Day, [Vitaly is running a one-day workshop](https://patternsday.com/#workshop):

> In this in-person workshop with Vitaly Friedman, UX consultant and creative lead behind Smashing Magazine, we’ll dive deep into dissecting how to solve complex design problems. Whether you’re working on a complex nested multi-level navigation or creating enterprise grade tables, this workshop will give you the tools you need to excel at your work.

Places are limited. There isn’t room for everyone who’s going to be at Patterns Day, so if you—and your team—want to learn design pattern kung-fu from the master, [get your workshop ticket now](https://ti.to/clearleft/patternsday2024)! Workshop tickets are £445.
Trunk Based Development (TBD) ?
Published: 2023-11-16 14:43:37

This post will cover a basic of Trunk Based Development.

###What is Trunk Based Development?
The easiest way to explain TBD is we have one single branch (usually `main` branch) with open access to it, and every developer work directly on that branch.
With this approach we embrace Continuous Integration, prioritize agility and fostering collaboration. 

###Pros :
- Always release ready
- Minimize merge conflict
- Quick iteration
- Encourage small batches of work and CI/CD
- Create robust code by encouraging refactoring
- Leaner codebase

###Cons :
- Requires discipline and communication among developer
- Relies on a lot of automatic testing
- Not ideal for larger projects

Separate deployment from release. The idea is we are comfortable to deploy partially completed feature into production that is not yet “release” in a sense of available for people to use.There are many start with this type of release, But these are the 3 most common:


1. Dark launching
We are deploying features that don't affect the end user or people can't see yet. For example it could be a piece of code that is not used yet, or we build the backend for some feature before adding the UI at the end.

2. Branch by abstraction
Great technique to release big changes incrementally. Improve the abstraction in our code step by step to make cleaner interfaces overtime to improve its modularity. THEN, start to replace small component in our system with new one over many deployment and release

3. Feature Flag
We hide a new incomplete feature behind a software switch or flag. We continue to develop a new feature behind a flag, and when it's ready to release we flip the switch.



###Git tips : 
`git pull -r`
This command makes sure the latest changes from origin are fetched before rebasing on top of them.

`git stash`
Helps you with this by stashing your changes locally.

`git rebase`
Git rebase (opposite to Git merge) integrates changes from one branch onto another by moving or reapplying commits to the tip of the target branch, creating a linear history.
Product of Array Except Self
Published: 2023-11-16 14:43:23

The problem to solve is to return an array which contains product of the array elements expect itself

Eg: [1,2,3,4] = [24,12,8,6]

My first approach was to use two loops and if i!=j then it should take the product, but the time complexity was O(n^2)

Second approach was to use lproduct and rproduct. And then finally taking the product of each.

```
        int lproduct=1;
        for(int i=0;i<n;i++){
            lproducts[i]=lproduct;
            lproduct*=nums[i];
        }
        int rproduct=1;
        for(int i=n-1;i>=0;i--){
            rproducts[i]=rproduct;
            rproduct*=nums[i];
        }
        int[] result = new int[n];
        for (int i = 0; i < n; i++) {
            result[i] = lproducts[i] * rproducts[i];
        }
```
React Interview Question
Tags: javascript, interview
Published: 2023-11-16 14:42:07

Create a React web application that consumes the https://swapi.dev/api/people/ API and displays a table containing a list of Star Wars characters and the films they have appeared in and the vehicles they have used. The application should make multiple parallel API calls to fetch the film and vehicle details using the URLs returned in the first API call and display them in the table.

Publicis sapient

```js
import React, {useState, useEffect} from 'react'
import ReactDOM from 'react-dom'
import axios from 'axios'

function App() {
  // Install axios using: npm install axios
  const [characters, setCharacters] = useState([])

  useEffect(() => {
    const fetchData = async () => {
      try {
        // Fetch Star Wars characters
        const response = await axios.get('https://swapi.dev/api/people/')
        const charactersData = response.data.results

        // Create an array of promises for fetching film and vehicle details
        const promises = charactersData.map(async (character) => {
          const filmsPromise = Promise.all(
            character.films.map((film) => axios.get(film)),
          )

          const vehiclesPromise = Promise.all(
            character.vehicles.map((vehicle) => axios.get(vehicle)),
          )

          const [filmsResponse, vehiclesResponse] = await Promise.all([
            filmsPromise,
            vehiclesPromise,
          ])

          const filmsData = filmsResponse.map((film) => film.data.title)
          const vehiclesData = vehiclesResponse.map(
            (vehicle) => vehicle.data.name,
          )

          return {
            ...character,
            films: filmsData,
            vehicles: vehiclesData,
          }
        })

        // Wait for all promises to resolve
        const charactersWithDetails = await Promise.all(promises)

        setCharacters(charactersWithDetails)
      } catch (error) {
        console.error('Error fetching data:', error)
      }
    }

    fetchData()
  }, [])

  return (
    <div>
      <h1>Star Wars Characters</h1>
      <table>
        <thead>
          <tr>
            <th>Name</th>
            <th>Films</th>
            <th>Vehicles</th>
          </tr>
        </thead>
        <tbody>
          {characters.map((character) => (
            <tr key={character.name}>
              <td>{character.name}</td>
              <td>{character.films.join(', ')}</td>
              <td>{character.vehicles.join(', ')}</td>
            </tr>
          ))}
        </tbody>
      </table>
    </div>
  )
}

ReactDOM.render(<App />, document.getElementById('root'))

```
Rest is Key to Good Quality Code
Tags: webdev, programming, php
Published: 2023-11-16 14:36:46

I’ve been mulling on this topic a bit lately as I’ve been prone to jumping on the bandwagon of the late nights strong coffee and even stronger Scotch. If you follow the school of thought that coding is an art form then you may feel like it makes sense to drain yourself to your root, and write code freely in the dark of night while your mind zones in. Though I have read there are some benefits to this approach I think the negatives far outweigh them.

##### The Zone

I have had many late nights where coding late into the evening has helped me stumble into that mystical zone. The place where all code just makes sense and the big picture and small picture combine into an elegant string of variables and methods. In short, I’ve been in that state where my brain (yours does this too) is beginning to shut down its sensory perceptions. Ironically, this create a sort of hyper-focused state but it’s mostly because your brain is unable to process anything else. This is the state where even if you get messages or there are issues you’re so deep its a challenge to get out of the focus. Though I have enjoyed times of reaching this psudo-nirvana, I don’t think its something to be sought after. My best code results are often from working in short bursts of focus. These are moments where I’m able to read thoroughly, make notes and then leave the code for a few hours to settle in my mind, think of it as a buffer management system.

##### The Aftermath

We often celebrate the late work sessions and multiple day burn outs which result in code we’re proud of. We will torture ourselves but just enough that we can still enjoy the outcome. However, we often neglect the fact that late work nights, burn out sessions, over caffeination and cheap carbohydrates result in long term detriment. Diving into one of these work sessions feels like it will only be a day or so to recover but it can have long term consequences. There is the real fact that sleep deprivation has severe health consequences, and there is a sad irony that the code you may be writing in that late night session may end up refactored completely in less than a year. Does that actually make it worth deteriorating you brain over it? We often also neglect the impact that it has on our social lives and skills. We’re often more edgy and short with co-workers, which results in poorer quality code revisions and focus.

I myself if I’m tired enough will take naps on my office floor. These may be fifteen minute naps or even thirty minutes but I’m always better off doing this rather than making another pot of coffee or chugging back energy drinks. Our minds are always working and processing even in sleep. Personally, I’d much rather let my brain process a complex problem in sleep than while I’m sitting in the dark with bags drooping under my eyes as empty cans of Red Bull lay across my office floor.
Implementing a Simple Factory Pattern in JavaScript
Tags: javascript, designpatterns, tutorial, webdev
Published: 2023-11-16 14:32:12

I'm currently implementing simple [factory design](https://www.oodesign.com/factory-pattern) pattern to create DOM controls. I'm trying to follow the SOLID design principles and design patterns and in general good practices. I implement the factory pattern as a simple 'class'(I'm using ecma5 style, so I don't know if I should call it a class) to instantiate DOM elements/controls and add them to the DOM.

```javascript
function DomFactory(){

  // this is the create method
  this.create = (key, type, props, defaultVals) => {
    
    if (type === 'checkbox')
      return this.createCheckbox( key, props, defaultVals )

  }

  // creates a checkbox identified by key
  // using label as label
  this.createCheckbox = (key, props, defaultVals) => {

    const checkbox = document.createElement('input');
    let label = (props && props.label) || key;

    checkbox.type = 'checkbox';
    checkbox.id = 'ctrl-' + key;
    checkbox.name = checkbox.id;

    // Set the checkbox as checked if defaultVals is true
    if (defaultVals === true) {
      checkbox.checked = true;
    }    

    const labelElement = document.createElement('label');
    labelElement.htmlFor = checkbox.name;
    labelElement.appendChild(document.createTextNode(label));

    return { checkbox, labelElement };
  }

}
```

As I'm just getting started with this piece of code, I'm going to add some more elements(for creating different types of controls) and to add more styles.

So I'm looking further to see if I should still use a factory pattern or maybe I should use a builder pattern or something related to a composite pattern, for instantiating recursive structures(like forms, panels or other elements containing child elements).

In the next post I'll show how I'm going to use a [decorator pattern](https://dev.to/teaganga/adding-a-decorator-pattern-in-javascript-to-existing-code-390o) to add styles to the created elements, but separating concerns, since the factory deals with the creation of objects as a creational pattern, while the decorator is a structural pattern.
 
Using a decorator pattern seems a good idea also from the perspective of adhering to good practices and following SOLID design principles. 
- First of all following [Single Responsibility Principle](https://www.oodesign.com/single-responsibility-principle) as described above. Or separation of concerns, but I think this is a more broader term.
- Second of all, following Open Closed Principles for adding new functionality to an object (in this case, styling to the controls) without modifying the existing code of that object. The Controls class remains unchanged, and new functionality (styles) is added by wrapping the controls with additional behavior in the decorator.
- Last but not least, it allows the use of [Dependency Inversion Principle](https://dev.to/teaganga/depedency-injection-principle-in-javascript-6gk) (DIP), by injecting decorators to get different types of elements(like using bootstrap styles or other types of styles, without changing the main functionality).
Always abstract nested types in TypeScript
Tags: typescript, webdev, javascript, programming
Published: 2023-11-16 14:28:26

I've seen this happening multiple times in TypeScript, where you have a complex object, and this object might have nested objects, something like this for example:

```typescript
interface ComplexObject {
  a: string;
  b: number;
  c: boolean;
  nested: {
    a: string;
    b: number;
    c: boolean;
  }
}

const myObj: ComplexObject = {
  a: 'a',
  b: 1,
  c: true,
  nested: {
    a: 'a',
    b: 1,
    c: true,
  },
};
```

And while TypeScript will be just fine with this, and no errors will be thrown, because after all that's a valid code to write, the bigger the object will become, the more hard to read the interface will be as a consequence.

Now let's say that we want to have a function that take that object as input, maybe does some interpolation, and perhaps it returns a child of that object, like the nested property for example, and you will have some code like this:

```typescript
const printObj = (obj: ComplexObject) => {
  // do some stuff
  return obj.nested;
};
```

Now if you try to inspect with IntelliSense what's the output of that function, you will see something like this:

```typescript
const printObj: (obj: ComplexObject) => {
    a: string;
    b: number;
    c: boolean;
}
```

Which is again, correct, but if you start to have a lot of properties, it becomes fairly hard to read.

A better way to handle complex objects like the above, is to abstract all the nested properties into their own interfaces/types.
For example, a way to rewrite the above is to split the code in the following interfaces:

```typescript
interface ComplexObjectNested {
  a: string;
  b: number;
  c: boolean;
}

interface ComplexObject {
  a: string;
  b: number;
  c: boolean;
  nested: ComplexObjectNested
}
```

This will help to split the types/interfaces in more logically understandable blocks instead of having a massive one that can become hard to read.
And now if you inspect again the same function with IntelliSense, you will also get a much more readable output:

```typescript
const printObj: (obj: ComplexObject) => ComplexObjectNested
```

And you have the added advantage that you can also use the nested interface for other purposes, let's say you want to use it for another function:

```typescript
const getAFromNested = (nested: ComplexObjectNested) => nested.a;

// And intellisense will interpret this as 
const getAFromNested: (nested: ComplexObjectNested) => string
```
Qùa tặng yêu thương
Published: 2023-11-16 14:21:19

Bạn đã tìm được quà tặng thầy cô nhân ngày nhà giáo Việt Nam chưa ? Nếu chưa thì tham khảo quà tặng nhà [Neko](https://quatangneko.com/) nha !

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4nwewcvfgo5tk56w1lt2.png)
PrimeTek and FIYU Collaboration - Interview with Cagatay Civivi & Saša Ivičević
Tags: rapidapplicationdevelopemtn, frontend, uilibrary
Published: 2023-11-16 14:20:07

In this video, the collaboration between PrimeTek Informatic and Serengeti is presented, offering insights into their partnership and how they enhance user experience and accelerate application development together. The discussion is led by Lucija Babić, with guests Cagatay Civici from PrimeTek, a Java Champion and the mastermind behind widely-used UI component libraries, and Saša Ivičević, Director of Software Engineering at Serengeti and Development Manager of FIYU - a rapid application development platform.

The conversation covers introductions of Saša and Cagatay, Saša's overview of FIYU, and Cagatay's insights into PrimeTek. They discuss the key challenges addressed in UI development, emphasizing the need for speed, community support, and a tool that accelerates development.

Saša explains the choice of PrimeNG, highlighting its speed and customization options, while Cagatay elaborates on the flexibility and benefits of PrimeTek's UI libraries for developers using different tech stacks like Angular, React, or Vue.js.

The integration of PrimeNG into FIYU is discussed by Saša, emphasizing how it improves the overall developer experience by enabling easy inclusion of components and themes in forms.

The video concludes with a discussion about upcoming developments and features that the developer community can look forward to. 
The collaboration between PrimeTek and Serengeti showcases how a passion for technology and innovation can revolutionize application development and UI solutions.

If you want to build application faster, please visit [fiyu.app](https://fiyu.app/)
🚀 Ai News 👀 ! 🚀
Tags: ai, technology, programming, news
Published: 2023-11-16 14:08:28

**Introducing @Sidekic AI : 𝙔𝙤𝙪𝙧 𝙋𝙚𝙧𝙨𝙤𝙣𝙖𝙡 𝘼𝙄 𝙎𝙚𝙖𝙧𝙘𝙝 𝘼𝙨𝙨𝙞𝙨𝙩𝙖𝙣𝙩
**


> ❋𝘈 𝘴𝘮𝘢𝘳𝘵 𝘬𝘯𝘰𝘸𝘭𝘦𝘥𝘨𝘦 𝘩𝘶𝘣 𝘧𝘰𝘳 𝘢𝘭𝘭 𝘺𝘰𝘶𝘳 𝘣𝘦𝘴𝘵 𝘳𝘦𝘴𝘰𝘶𝘳𝘤𝘦𝘴, 𝘪𝘯𝘴𝘵𝘢𝘯𝘵𝘭𝘺 𝘴𝘩𝘢𝘳𝘦𝘢𝘣𝘭𝘦 𝘢𝘯𝘥 𝘪𝘯𝘧𝘪𝘯𝘪𝘵𝘦𝘭𝘺 𝘴𝘦𝘢𝘳𝘤𝘩𝘢𝘣𝘭𝘦

`❋Sidekic is an innovative powerhouse designed to help you effortlessly save anything from anywhere. It's a versatile, collaborative canvas empowering you to curate, share, and collaborate on collections with friends and teammates.`

Discover what you can accomplish with Sidekic:

᪥ Seamlessly save content from diverse sources
᪥ Effortlessly tag, sort, and organize your resources automatically
᪥ Collaboratively share your collections
᪥ Create and distribute notes for efficient collaboration
᪥ Utilize the browser extension for instant content saving 🚀

☑ The simplicity of staying organized with Sidekic has truly amazed me. 🌟

👉 Visit Sidekic ai for more information on the launch time:


Experience Sidekic today and witness how it transforms your efficiency and productivity.

## sidekic AI


[𝙵𝚘𝚕𝚕𝚘𝚠 & 𝙲𝚘𝚗𝚗𝚎𝚌𝚝 𝚏𝚘𝚛 𝚖𝚘𝚛𝚎 𝚍𝚎𝚟 & 𝚝𝚎𝚌𝚑 𝚌𝚘𝚗𝚝𝚎𝚗𝚝 👨‍💻](https://www.linkedin.com/posts/karimelaissaouy_sidekic-ai-collaboration-activity-7130917509532119040-pMbu?utm_source=share&utm_medium=member_desktop)








#Sidekic #ai #collaboration #productivity #organization #efficiency #innovation #tech #technology #tools #digital #assistant #productivitytools #AIassistant #creativity #teamwork #teamcollaboration #digitaltools #worksmart #timeefficiency #simplify #resourcemanagement #contentcuration #virtualassistant #sharingiscaring #worksmarter #informationmanagement #browserextension #effortlesssaving #savetime #futuretech #digitalage #workflowmanagement #teamproductivity #contentmanagement #effortlessorganization