teleren/devto huggingface dataset:
Parallel promises made simple - Javascript Tip
Tags: functional, javascript, tips, vanillajs
Published: 2023-08-02 03:07:01

---
title: "Parallel promises made simple - Javascript Tip"
published: true
description: Making parallel promises easy to handle, process and grokkable.
tags: functional, javascript, tips, vanillajs
series: "JS Cookbook"
---
`Promise.all` and `Promise.allSettled` have made it easy to run promises parallelly. However, the data returned by `Promise.allSettled` (which is what I often end up having to use because `Promise.all` fails at the first promise that rejects/fails) is slightly cumbersome to deal with.

Instead, I use a recipe where it becomes easy for me to run parallel promise functions and handle the data far more easily.

Before I show the recipe, here's how the usage looks like:

```js
// let's say we have these functions that return a promise
const getUsers = () => axios.get('/users');
const getTeams = () => axios.get('/teams');
const getPlans = () => axios.get('/plans');
const setConfig = () => axios.post('/config', { data: config }); // config comes from somewhere

// now, we have to run these on app-load
const results = await runPromises({
  users: getUsers,
  teams: getTeams,
  plans: getPlans,
  config: setConfig,
});
// runPromises is the recipe.

// and then `results` will look like this:
// results == {
//   users: { data: [...] }, // or { error: AxiosError }
//   teams: { data: [...] }, // or { error: AxiosError }
//   plans: { data: [...] }, // or { error: AxiosError }
//   config: { data: {...} }, // or { error: AxiosError }
// }
```

The object-based approach is not as great as a list but you can see the benefit - no need to deal with `status` and `value` and `reason` for each. Instead, each key in your object (which maps to a function) will have a resolved value object that either contains the `data` key or the `error` key.

Here's the recipe to use:

```js
const runPromises = async (promises) => {
  let plist = Object.entries(promises).map(async ([name, promise]) => {
    let res;
    try {
      res = { data: await promise() };
    } catch (e) {
      res = { error: e };
    }
    return [name, res];
  });
  let intermediateResult = [];
  for (let p of plist) {
    await intermediateResult.push(await p);
  }
  return Object.fromEntries(intermediateResult);
};
```

Briefly, what we do is convert the object into a `[key, value]` pair list, then run each promise (but because this is a `map`, it is run parallelly), and finally collect these promises into another `[key, value]` pair list and return that as an object.
⚡️J88 Tặng Code 50k- Khuyến Mãi Mới
Tags: vf555, nhacaivf555, j88tangcode50k
Published: 2023-08-02 02:47:39

⚡️J88 Tặng Code 50k- Khuyến Mãi Mới
⚡️Hướng dẫn anh em nhận code 50k
⚡️Nhiều khuyến mãi hấp dẫn
⚡️Lưu ý khi nhận code 50k
⚡️Trả thưởng uy tín
🌐Website : [https://vf555.ltd/j88-tang-50k/
](https://vf555.ltd/j88-tang-50k/
)🌐Fanpage: https://www.facebook.com/vf555ltd
👉Địa chỉ: 37 Đường Số 2, Bình Hưng Hoà A, Bình Tân, Thành phố Hồ Chí Minh, Việt Nam
📱Sdt: +84921215045
📧Email: vf555ltd@gmail.com
#vf555 #nhacaivf555 #vf555casino #vf555club #j88tangcode50k
#linkkhuyenmai
Instalação de Rede Wi-fi Ubuntu Linux TP-Link
Tags: linux, github, ubuntu, tutorial
Published: 2023-08-02 02:45:19

######NESSE TUTORIAL É NECESSÁRIO DE UTILIZAR INTERNET CABEADA, EM CASO DE DIFICULDADE DE OBTER REDE CABEADA, UTILIZE O COMPARTILHAMENTO DE REDE DO CELULAR VIA CABO.

Primeiramente, após a instalação recente do Linux, percebi que o adaptador de Wi-Fi TP-Link AC600 Archer T2U não estava sendo reconhecido pelo sistema. Para resolver esse problema, segui os passos abaixo:

Antes de instalar o driver de rede Wi-Fi, foi necessário atualizar o gerenciador de pacotes apt, pois ele não estava reconhecendo alguns comandos. Para fazer isso, executei o seguinte comando no terminal:

`sudo apt update`

Em seguida, recomendo executar novamente o comando para instalar pacotes, apenas para garantir o correto funcionamento do apt atualizado:

`sudo apt install`

Para prosseguir com a instalação do driver do adaptador, instalei o pacote DKMS (Dynamic Kernel Module Support - suporte de módulo de kernel dinâmico) com o comando:

`sudo apt install dkms`

Depois disso, prossegui clonando o diretório do driver Wi-Fi do GitHub para minha máquina através do comando:

`git clone https://github.com/aircrack-ng/rtl8812au.git`

Acessei a pasta rtl8812au usando o comando:

`cd rtl8812au`

Dentro dessa pasta, executei o comando para instalar o driver do Wi-Fi usando o DKMS:

`sudo make dkms_install`

É importante ressaltar que, após a instalação, pode ser que o adaptador de Wi-Fi não funcione imediatamente. Para garantir o correto funcionamento, recomendo reiniciar a máquina:

`sudo reboot`

Após reiniciar o sistema, o adaptador de Wi-Fi da TP-LINK deve funcionar corretamente no seu Linux.


--------------------------------------------------------------

_**OBS:** Se o seu adaptador de rede usb, for de um modelo diferente do meu, faça o seguinte processo._

_No terminal execute o comando para listar todos o equipamentos conectados na porta usb._

`lsusb`

_Após verifique o códido do seu adaptador de wifi e pesquise no adicionando a palavra "git" no final, assim localizara com facilidade o driver para o adaptador._


_**OBS:** Vale ressaltar que o tutorial utiliza o repositório do aircrack-ng no GitHub para obter o driver do adaptador de Wi-Fi TP-LINK. Essa escolha pode ser benéfica, pois o repositório do aircrack-ng é uma fonte confiável e frequentemente atualizada para drivers e utilitários de rede wireless._

_O aircrack-ng é um conjunto de ferramentas de segurança para redes sem fio, e eles mantêm uma variedade de drivers, incluindo o driver rtl8812au, que é necessário para o adaptador TP-LINK mencionado._

_Lembre-se de verificar a documentação e as atualizações no repositório do aircrack-ng para obter informações adicionais sobre o driver e quaisquer possíveis problemas conhecidos ou soluções que possam surgir ao longo do tempo._
TheAffiliateMonkey - Connecting publishers with affiliate programs
Tags: comparison
Published: 2023-08-02 02:44:22

TheAffiliateMonkey allows you to save time and resources by quickly and easily finding the best affiliate program for you.

Picking the right affiliate program for your content, whether it's a blog, YouTube, or any other channel, is a large part of whether the affiliate campaign will be successful. So, picking the best affiliate program is vital. We have personally signed up for all the programs listed on the site and done the digging, so you don't have to.

Whether you're a beginner or have been in affiliate marketing longer than us, you'll find your next affiliate program here. We aim to become the number one trusted affiliate program comparison website, and we’re a good way there already.

[https://theaffiliatemonkey.com](https://theaffiliatemonkey.com)
Top Websites to Practice Programming 🚀
Tags: webdev, javascript, programming, beginners
Published: 2023-08-02 02:25:58

Looking to sharpen your coding skills and take on exciting challenges? Look no further! Check out these amazing websites that offer a plethora of opportunities to practice and enhance your programming prowess:

## CodeSignal (Real Tests)
CodeSignal provides real-world coding tests that simulate actual job interviews. It's a fantastic platform to assess and improve your coding abilities in a real-life context.

## Exercism (Logic Puzzles)
Exercism offers a collection of logic puzzles and coding exercises to challenge your problem-solving skills. The platform provides feedback from experienced mentors to help you learn and grow.

## CodeWars (Coding Challenges)
CodeWars is home to a vast library of coding challenges, allowing you to tackle problems of varying complexity. It's a great place to interact with a community of developers and learn from their solutions.

These platforms offer a stimulating environment for continuous learning and improvement, no matter your skill level. The more you practice, the more confident and proficient you'll become in tackling real-world coding challenges.

If you found this list helpful, I'd greatly appreciate your support! Please like and share this post to help others discover these fantastic resources. Let's build a strong community of passionate programmers who love to learn and create amazing content together! 🤗💻
How to Perfectly Center a Div: A Complete Guide 🎯
Tags: webdev, css, beginners, tutorial
Published: 2023-08-02 02:19:20

Centering a div can be a bit tricky, but fear not! I'll walk you through two fantastic methods to perfectly center a div within its parent element.

## Method 1: Using Flexbox 📏

HTML:
```
<div class="parent">
			<div class="child">I am a div 🤐</div>
		</div>
```

CSS:
```
.parent {
	display: flex;
	justify-content: center;
	align-items: center;
}
```

With the above CSS, the .parent div will become a flex container, and the justify-content: center; and align-items: center; properties will ensure its child div (.child) is perfectly centered both horizontally and vertically. Voilà! 🌟

## Method 2: Utilizing CSS Grid 📐
HTML:
```
<div class="parent">
			<div class="child">I am a div 🤐</div>
		</div>
```

CSS:
```
.parent {
    display: grid;
    place-items: center;
}
```

By using CSS Grid, you can achieve the same result with even fewer lines of code! The .parent div becomes a grid container, and the place-items: center; property centers its child div (.child) in both directions. How cool is that? 😎

Feel free to choose whichever method suits your project or personal preference. Both Flexbox and CSS Grid are powerful tools to have in your web development toolkit.

Remember, mastering these techniques will help you create stunningly centered divs in your projects and impress your fellow developers! Keep coding and happy centering! 💻🎉

#WebDevelopment #CSSCentering #Flexbox #CSSGrid #CodingTips
ShareX - copy to clipboard không hoạt động
Tags: sharex, tools, productivity
Published: 2023-08-02 01:26:35

Có 1 phần mềm capture màn hình cả ảnh lẫn video rất hay và miễn phí là [ShareX ](https://getsharex.com/)(kiêm luôn chức năng share và 7749 cái chức năng khác nhau)

PHần mềm này có cái bất tiện là nếu bạn chọn 2 option "Open in editor" và "Copy to clipboard" đồng thời thì sau khi chụp ảnh xong, mà bạn bấm `Esc` để tắt cái editor đi thay vì nhấn `Enter` để đóng editor thì cái ảnh nó sẽ không dc copy vào clipboard 🤔 


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

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


Cái này là tính năng, không phải bug, nhưng mà nó "khó chịu" (awkward) 🙆‍♂️

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

để giải quyết sự khó chịu này thì hãy bật thêm tính năng sau trong phần image editor 


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


credit: https://github.com/ShareX/ShareX/issues/4337#issuecomment-1146911550
一流企业
Published: 2023-08-02 00:07:25

有一句俏皮话：

> 一流学校搞学术，二流学校忙考研，三流学校查卫生

我觉得在评价一家企业时，也有这样的特点可以把它们分为三六九等。

不入流的公司各有各的特色和不足，在此不提。

三流企业玩管理。在一家公司里，如果市场营销和项目管理者主导了公司的话语权，那么有很大可能这家公司做出的产品在市场上并不最具影响力，或者公司发展迟缓，无法取得进一步突破。IBM

二流企业搞技术。技术应为手段，而非最终目的。技术做到顶尖的公司有可能是某个细分领域里面的绝对霸主，但很少能够直接地“改变世界”，深刻地影响到每个人的生活。由技术人员说了算的企业，很可能利润颇丰、运转良好，但不一定能在市场上永葆竞争力。Citadel Securities

一流企业做产品。产品，是一家公司的最终价值所在。能够称得上“伟大”的市场化公司，无一不创造过划时代的经典产品。产品，是企业与用户的接触点，是令用户最为直观地认识、评价一家企业的准绳与基石。由优秀的产品思考者领导的公司，有如时代的弄潮儿，指引时代潮流的方向。Apple
Python: El Lenguaje de programación que impulsa la tecnología moderna.
Published: 2023-08-02 00:19:24

En el vasto y en constante evolución del mundo de la tecnología, el lenguaje de programación Python ha emergido como una fuerza impulsora clave. Su sencilla sintaxis, versatilidad y comunidad de desarrolladores apasionados lo han convertido en una herramienta indispensable para abordar una amplia gama de desafíos tecnológicos. Desde el desarrollo web hasta la inteligencia artificial y el análisis de datos, Python ha dejado una marca significativa en la industria. En este artículo, exploraremos cómo Python se ha convertido en un lenguaje de programación líder y cómo ha contribuido al progreso tecnológico.

Python ha demostrado ser un lenguaje de programación verdaderamente versátil y poderoso en el mundo de la tecnología. Su simplicidad y facilidad de uso lo han convertido en la opción preferida tanto para principiantes como para expertos en desarrollo de software. A medida que la tecnología continúa avanzando, Python seguirá desempeñando un papel fundamental en el progreso de la industria, impulsando la innovación y abriendo nuevos horizontes para resolver desafíos tecnológicos. Si eres un apasionado de la tecnología, aprender Python te abrirá un mundo de posibilidades para explorar y crear soluciones que cambien la forma en que vivimos y trabajamos.
Postman: VS Code Extension
Tags: postman, productivity, vscode, extensions
Published: 2023-08-02 00:16:22

### Prerequisities
- VS code


### Introduction
Postman is a collaboration platform and API (Application Programming Interface) development tool used to build, test, and document APIs. It allows users to make HTTP requests, view responses, and analyze API endpoints.

Postman has features like API Testing, API Documentation, Collaboration, Mock Servers, Monitoring, Environment Management, Collection Runner.


### How to install the extension
Recently, Postman VS Code extension was released. Now, you can develop and test your APIs in Postman straight from Visual Studio Code thanks to the Postman VS Code extension. To install Postman and use on VS Code :

- Go to extension on VS Code and Install Postman extension

![postman on vscode extension](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sqsvdkxhn7t4rapo7lzy.png)

- You will notice the postman icon on the left side bar, then sign in to your postman account or create an account if you do not have one
![sign in to postman](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6hrd8vjb11j8iofydouf.png)

- Once you sign in, you can start sending requests

![the postman extension](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/026iyq9efe5hmy3tjj8e.png)


![making request on postman extension](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3pfs3qlv4gai3vsde74t.png)


### Conclusion
 The Postman VS Code extension : 
- simplifies the process of working with APIs. 
- lets you easily create and send HTTP, WebSocket, and gRPC requests. 
- allows you to manage collections and environments effortlessly
- import data with cURL commands
- create and send cookies with your requests.

It makes API development and testing straightforward, leading to improved efficiency and productivity in your workflow
How do I actually get data from a CMS into my React component?
Published: 2023-08-02 00:01:30

I am new to React and my immediate goal is to build React components locally and use them within my existing CMS. The end goal is to eventually go headless, but that is far down the road at this point.

Ideally I want to have a JS object on a page in the CMS that has all the variables/props I need for the React component I want to put there.

The issues I'm facing are:

- Building React locally without having access to this data.
- Getting the built/compiled React component to "see" this data once it's been uploaded to the CMS.

For the issue with building locally I tried using ternary operators and try/catches to set the props, eg:

` const greeting = cmsComponentObj.title ? cmsComponentObj.title : 'Data not from CMS object';`

But since `cmsComponentObj` was not defined anywhere the build failed.

I'm a bit lost as to how to achieve this. Can anyone point me in the right direction?
My two cents about leading tech trends in the next future
Tags: future, trends, technology, webdev
Published: 2023-08-01 23:23:31

1. City buildings enriched by augmented reality content ([Apple visionOS](https://developer.apple.com/visionos/) as example)
2. Web browsers "replacing" every day the role, interpreted in the past by the Operating System:
  * their APIs implement functions way more ahead than the classic web page (e.g. 3D Rendering, MIDI connectivity, Serial port, Bluetooth, Data storage, etc..)
  * the runtime context is enabled by default for online data exchanging, at disposal of every webApp executed by the User. Offline execution is possible but not mandatory.
  * their role is the equivalent of what frameworks do in the software development field: provide a valid, stable and ubiquitous set of features, accepted by any programmer who is adopting the framework. This enables a team to jump straight to the core logic of an application and avoid the need of define and mutually approve any architectural/operating concept.
  * last but not least: online connectivity ensures that the last version of every application is presented to the final User, excluding the need of periodical updates. This implies transparent rollout/back of features.
Pimcore Demo installed locally but can not log into Admin using the credentials set at the time of installation
Tags: pimcore, demo, admin, ubuntu
Published: 2023-08-01 22:40:01

Have installed locally a community version of pimcore demo.  However, when trying to login to admin platform, does not recognize the saved credentials.  Also can not use forgot password as I don't have a local email server installed.  Where can I see what are the stored password or if I can reset it.  Any help is greatly appreciated in advance.  Also, pictures of the products (cars) are not shown on the installed pimcore site.
Jet Set Radio API
Tags: api, javascript, webdev, node
Published: 2023-08-01 22:34:42

# JetSetRadio-API
For any lovers of Jet Set Radio out there, I made an api for it that also includes data from JSRF! The api pulls data from the fandom wiki, then converts and stores records in JSON! This was such a fun project being able to practice my development skills with my most nostalgic childhood game.  

Example request: `https://jetsetradio-api.onrender.com/v1/api/characters/jsr`

The API Homepage has a link to the documentation if you want to learn more!  
Contribute to the project if you feel so inclined!

**API Homepage**: https://jetsetradio-api.onrender.com/  
**Github Repo**: https://github.com/Jet-Set-Radio-API/JetSetRadio-API
Plan Your Dream Trip with Wanderkit.net: A Behind-the-Scenes Look
Tags: nextjs, openai, react, tailwindcss
Published: 2023-08-01 21:42:39

Hey there! I'm excited to share my latest project, [wanderkit.net](wanderkit.net), where you can create personalised travel itineraries using AI. Whether you're a seasoned explorer or a newbie to travel planning, **Wanderkit** is here to make your trip unforgettable.

The Magic Behind **Wanderkit**: The Technologies I Used

Now, let me show you the tools that made Wanderkit possible:

**Next.js**: Powering a Smooth Experience
**Wanderkit** runs on Next.js, a cool framework that ensures everything works smoothly and lets us build things quickly. With Vercel hosting, we could easily put it all together and launch the site without any trouble.  I experimented with using Next.js 13 with the app directory and will be writing a separate blog on my findings.

**MongoDB**: Our Trusty Database Partner
Storing data is essential, and that's where MongoDB comes in. It's easy to set up and lets us make changes without having to deal with any database migrations. So I can focus on developing.

**OpenAI**: The Magic of Personalised Recommendations
OpenAI is used for generating the actual itineraries. It was the most developed, well documented and stable option.

**Stripe**: Safe and Easy Payments
Making payments should be worry-free, and Stripe is the go-to for secure transactions. It's a well-known payment system that keeps your financial info safe and makes paying for your trip a breeze. I will be writing a separate blog on integrating Stripe with Next.js.

**Mailersend**: Staying Connected
Communication is key, and Mailersend helps us stay in touch with you. Sending emails and updates is simple, thanks to this handy tool. It came with a generous free tier and an easy setup.

**Tailwind CSS**: Making Things Look Awesome
For a stylish look, we used Tailwind CSS. It helps us create a beautiful design with ease. I have absolutely fallen in love with the utility approach of Tailwind CSS. I like having my CSS close to my HTML, allowing me to see how everything is styled in one go. It's fast, no CSS-in-JS overhead. Easy setup. And it comes with an amazing build in design system, especially the colours.

Start Your Adventure with [wanderkit.net](wanderkit.net)

Now that you know the magic behind Wanderkit, come and check it out at **Wanderkit**. Your dream itinerary is just a few clicks away! As we keep improving the site, we'd love to hear your feedback and ideas for new features.

If you're curious about the nitty-gritty, take a peek at our project's code on GitHub (https://github.com/levischouten/wanderkit-net). We're excited to have you join us on this amazing journey of travel and technology.

Get ready to plan the trip of a lifetime with [wanderkit.net](wanderkit.net). Happy travels, adventurers! 🌍✈️

My personal website: [www.levischouten.net](www.levischouten.net)
Day 795 : First of the Month
Tags: hiphop, code, coding, lifelongdev
Published: 2023-08-01 21:27:56

_liner notes_:

- Professional : Another packed day. Had a bunch of meetings. Met up with my manager to show him the demo applications I made, a PR that I did and a review of some updates to documentation. I responded to some questions in the GitHub repo for the Web Components I made. I replied to some community questions. Was asked to join a pair programming session. Next thing I know, it basically time to call it a day. Also did some planning for my upcoming trips.

- Personal : Went through tracks for the radio show. Created a page in my side project for past sessions. Also added a description field for the sessions in both the create and edit forms. Didn't get a chance to watch any anime though.

![A winding road through the green moss covered mountains of Castleton, United Kingdom as sunset.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j8h7ln5uvcqetflfw7hq.jpg)

It's the first of the month, so I'm going to pay all my bills. I'm also going to look into buying a battery for my van. Then I'll go through some tracks for the radio show. I also want to start working on the details page for my side project. If I have some time, I want to watch some anime before calling it a night. Going to get started.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube PArF9k2SbQk %}