teleren/devto huggingface dataset:
Best kids wear online
Published: 2024-04-07 04:16:13



Karee Designs, we are proud to offer the  best kids wear online in the UK. Our commitment to quality, style, and customer satisfaction sets us apart as your premier destination for outfitting your little ones. With our wide selection of trendy and comfortable clothing, hassle-free shopping experience, and exceptional customer service, Karee Designs is here to make dressing your children a joyful and effortless experience. Discover the best in kids wear online today with Karee Designs and let your child's style shine!https://www.karee.co.uk/
DevI18n - XmI/Json Translator Online Multi-Lingual
Tags: android, ios, xml, json
Published: 2024-04-07 04:07:27

After a month, I practiced a new project. The development was tedious. International language, currently supports json, xml, strings, arb, yaml and other files, 26 languages translation, welcome to experience and ask questions. This is the website: [devi18n.com](https://devi18n.com/?utm_source=devto)
Long-Term Growth Strategies: John Harrison's Approach
Published: 2024-04-07 04:05:52

Google Business Card : Name : John Harrison

Age: 58

Place of birth: New York, America

Education: New York University, with a master's degree in finance from the Wharton School of the University of Pennsylvania

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pkkw73zdy5c5l85izdja.jpg)
Career:
John has worked on Wall Street for over 30 years, during the time, he has held senior positions at several well-known hedge funds, quantitative analyst, investment manager, co-founder of the Pinnacle Hedge Strategy Fund, and one of Soros' most prized students. He is known for his exceptional investment strategies and market forecasting abilities, with particular expertise in utilizing complex algorithms and data analysis to guide investment decisions. John's investment strategies typically focus on long-term growth and risk-hedging management, and he has successfully guided his team and clients through several financial crises, earning him widespread respect in the industry and helping his clients achieve strong returns.
JavaScript Normal Functions vs Arrow Functions
Tags: webdev, javascript, beginners, programming
Published: 2024-04-07 04:01:30

Are you curious about the difference between normal functions and arrow functions in JavaScript? Let's explore this concept in simple terms!

In JavaScript, functions are blocks of code designed to perform a particular task. There are two main types: normal functions and arrow functions.

Normal functions:

```
function greet(name) {
  return "Hello, " + name + "!";
}
```
Normal functions are defined using the `function` keyword followed by the function name and parameters. They have their own `this` value which is determined by how they are called.

Arrow functions:

```
const greet = (name) => {
  return "Hello, " + name + "!";
};
```
Arrow functions are a more concise way to write functions introduced in ES6. They use the arrow `=>` to separate the parameters from the function body. Unlike normal functions, arrow functions do not have their own `this` value. Instead, they inherit the `this` value from the enclosing lexical context.

Let's see the difference in usage:

Normal function:
```
const person = {
  name: "Alice",
  greet: function() {
    return "Hello, " + this.name + "!";
  }
};
```

Arrow function:
```
const person = {
  name: "Alice",
  greet: () => {
    return "Hello, " + this.name + "!";
  }
};
```

In the normal function example, `this.name` refers to the name property of the person object. However, in the arrow function example, `this.name` will be undefined because arrow functions do not have their own `this binding`.

In summary, normal functions and arrow functions have similar functionalities, but differ in syntax and behavior, particularly with regards to the `this` keyword. Understanding these differences can help you choose the right type of function for your JavaScript code!

And that's it! You've just learned about the difference between normal functions and arrow functions in JavaScript. Happy coding! 🚀
Introducing go-to-top-react: Dynamic “Go to Top” Button for React Apps
Tags: react, scroll, vite, npm
Published: 2024-04-07 03:36:02

Are you tired of manually implementing “Back to Top” functionality in your React applications? Look no further! I’m excited to introduce go-to-top-react, a lightweight and customizable React component designed to effortlessly enhance your web UI.

Overview:

With go-to-top-react, saying goodbye to tedious coding for a “Back to Top” button is now a reality. This innovative React component streamlines the process, offering a seamless solution for users to navigate your application effortlessly.

Key Features:

Lightweight and Customizable: Weighing in at just 9.32 kB, go-to-top-react prioritizes efficiency without compromising on functionality. Customize the button to suit your application’s aesthetic seamlessly.
Dynamic Design: Witness the magic as the button dynamically adjusts its design based on scrolling length. Say goodbye to static buttons — go-to-top-react keeps your UI fresh and engaging.
Effortless Integration:Implementing go-to-top-react is a breeze. With simple installation via npm or yarn, you’ll have your “Back to Top” button up and running in no time.
How it Works:

The magic behind go-to-top-react lies in its dynamic behavior. Leveraging the dashOffset and scrolling length, the button adapts its design automatically, ensuring a seamless user experience. No need to worry about manual adjustments — sit back and let go-to-top-react do the heavy lifting.

//You can install the package via npm:

`npm install go-to-top-react`
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/unmyyhh4klq1x7oa6ven.gif)


   `   <GoToTop />`

  
Final Thoughts:

As a junior React developer, I was inspired by a sleek design featuring a dynamic “Back to Top” button. However, unable to find a similar package on npmjs, I took matters into my own hands and created go-to-top-react. If anyone else has developed a similar package before, no worries — this one’s my take on it.

With go-to-top-react, enhancing your web UI has never been easier. Whether you’re a seasoned developer or just starting, this React component empowers you to create intuitive user experiences with minimal effort.

Don’t let cumbersome “Back to Top” implementations hold you back. Elevate your React applications today with go-to-top-react and embrace a smoother, more dynamic user journey. Try it out now and revolutionize your web UI!
One Minute Notes: delegates in C#
Tags: csharp, dotnet, oneminutenotes
Published: 2023-01-02 22:46:13

I am staring a new section in my blog — the **One Minute Notes**, short notes on some important IT topics that will take only one minute to read and get a brief understanding of the concept. In this episode of **One Minute Notes**, let’s talk about what are delegates in C# and why do we need them.

⚡

**Delegates** might be considered as placeholders for functions that can be called later. Just like declaring a variable to store some integer value, you can declare a variable to store a function as a value, which allows you to change the function to be called **in the runtime**.

Here’s an example of defining and using a delegate. Of course, this is the most naive implementation. A real-life example would probably contain an if-clause or switch to choose between functions to delegate based on some condition.

```
public delegate int BinaryOperation(int a, int b);

class SampleClass
{
  public static int Add(int a, int b)
  {
     return a + b;
  }

  static int Subtract(int a, int b) => a - b;

  static void Main(string[] args)
  {
    BinaryOperation operation = Subtract;
    int x = operation (10, 2); // 8

    operation = Add;
    int x = operation(10, 2); // 12
  }
}
```

Fun fact: .NET Base Class Library also has its own **predefined delegates** that cover most popular use-cases, so it’s usually unnecessary to implement delegates of your own. The `Action` delegate represents a void function, which might take a parameter(s) with generic type. For example, `Action<string> printText = x => Console.WriteLine(x);` There’s also a `Func` delegate which defines functions that return a value. Overall, it has the same signature, but the last parameter defines the return value type. In the example above, the Add function might also be assigned to the `Func<int, int, int>` delegate.

---
Did you find this **One Minute Note** helpful? Hit like and follow me to read more of them later🙂
How to Control an LED from the Internet using Raspberry Pi Pico W
Tags: raspberrypi, pico, micropython, iot
Published: 2024-04-07 02:39:36

The Raspberry Pi Pico W brings the power of Wi0Fi connectivity to the popular Raspberry Pi Pico microcontroller board. In this tutorial, we'll explore how to leverage this capability to control an LED remotely over the internet. 

By the end of this guide, you'll have a Wi-Fi-connected LED system that can be controlled from anywhere with an internet connection.

{% embed https://youtu.be/oacTs7XLvwc %}.

## Prerequisites:
Before we begin, ensure you have the following:

- Raspberry Pi Pico W board
- 1x LED
- 1x Micro USB cable
- 2x male to male jumper cable
- 1x 1000k Ohm Resister
- Basic knowledge of Python programming

## Hardware Setup:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b1gzwki6ys3tf4eo934h.png)
- Raspberry Pi Pico to Resistor: Connect one end of the resistor to the GPIO 0 (GP0) pin on the Raspberry Pi Pico.
- Resistor to LED (Anode): Connect the other end of the resistor to the long leg (anode, +) of the LED.
- LED (Cathode) to Raspberry Pi Pico (GND): Connect the short leg (cathode, -) of the LED to one of the GND (ground) pins on the Raspberry Pi Pico.

## Software Setup:

1. Download the the provided Python code from [GitHub Gist](https://gist.github.com/RajivCodeLab/4972b82cb96fa7c27b1e24d6a22ce079).

2. Open the Thonny IDE and paste the below code.

## Dweet.io Setup:

- Go to [dweet.io](https://dweet.io) website and click on Play
- Click on create things
- give the thing name as "led_control"
- in the body write
`{
"value" : 1
}`
- Click on try it out

## Running the Code:

1. Replace "YOUR_WIFI_SSID" and "YOUR_WIFI_PASSWORD" with your WiFi network credentials.
2. Save the Python script into Raspberry Pi Pico and Run.

## Conclusion:
With the code uploaded to your Raspberry Pi Pico WiFi, your LED is now ready to be controlled over the internet. This opens up a wide range of possibilities for remote monitoring and control applications. Experiment with different APIs and functionalities to tailor the system to your needs. Happy tinkering!
Rescuing legacy Node.js projects with Bun
Tags: bunjs, node, adminjs, javascript
Published: 2024-04-07 02:03:58

For the past 4 months, I have been working in a legacy MERN stack project that is a booking system for a sports complex in Malaysia where I developed the website, backend API and an admin panel using AdminJS. It was all functional and allowed rapid iterations for requirements until a new one was added: export data as CSV.

The API and the admin panel are all using CommonJS modules. If you have ever written code using `require()` and `module.exports`, then you have already been using CommonJS. However, this is no longer the standard approach to developing modern Node.js applications and you need to use ESModules. So instead of `require()` and `module.exports`, you need to use `import` and `export default` statements. Unfortunately, some npm packages are being migrated to ESModules and this is an issue for projects built with CommonJS. ESModules are backwards compatible with CommonJS but its not the same way around. This has been a big issue in the Node.js ecosystem and it can be quite difficult to migrate large codebases to ESModules.

The admin panel built with AdminJS was in version 6.x which still has support for CommonJS. As I tried to implement the import/export plugin, there was this issue I couldnt resolve at all. I knew this was something to do with the AdminJS version so I upgraded to version 7.x, only to realize that this version dropped support for CommonJS completely. So the only option I had was to use the unmaintained [cjs-to-es6](https://www.npmjs.com/package/cjs-to-es6) package to rewrite all CommonJS code with ESM. Then I saw the bun's announcement: [It got released on Windows!](https://www.youtube.com/watch?v=yXTFOeGly9o).

When I saw the release of bun six months ago, I was not that hyped as I saw a tool that had similar ambitions, [Rome](https://github.com/rome/tools), and dissapointed many. But it was different this time. It really is a drop in replacement for Node.js so you can start using it by replacing the npm and node commands in your package.json file. The main feature that captured my interest was the ability to use require and import statemtents in the same file. This allows you to keep using CommonJS modules and use import statemtents for any new modules that drop support for it. The only catch I could find so far is that if you decide to mix import and require statements, you cannot use module.exports but instead use export statement. I did exactly that and now I have a fully functional backend with admin panel that won't make your head scratch fighting with CommonJS and ESModules.

Thanks for reading. :)
Impostor Syndrome in the Workforce
Tags: webdev, beginners, productivity
Published: 2024-04-07 00:59:09

Given that we are all working in a competitive market, there is no doubt that some of us- if not all of us have suffered from Imposter Syndrome. 

Imposter Syndrome is the feeling that you don't belong or having self-doubt. Imposter Syndrome can occur to us for a multitude of reasons, dependent on the person and their circumstances.

While Imposter Syndrome may impede on one's learning experience, it is important to know how to respond it when it does occur. In reading David Walsh's article _Conquering Imposter Syndrome_, I realized that we can use it as a motivating factor and how we can overcome it.

I myself, have experienced Imposter Syndrome and I still do to this day. In reading Walsh's article, I understand that it can be a healthy feeling just as it is an unhealthy one. Feeling Imposter Syndrome means that you desire to improve and stay up-to-date with your competition.   

It is a reminder that there will always be someone or something better than you out there, but that's okay. Instead of focusing what it is that we can't achieve, it is imperative to focus on what it is that we can achieve. This would help build momentum and give us a starting point instead of being left in a loop of depression or lack of self motivation.

David Walsh's article can be found here: (https://davidwalsh.name/conquering-impostor-syndrome)
React Safe Query - A lightweight, type-safe wrapper built around React Query
Tags: reactquery
Published: 2024-04-08 02:44:20

---
title: React Safe Query - A lightweight, type-safe wrapper built around React Query
published: true
date: 2024-04-07 00:24:00 UTC
tags: ReactQuery
canonical_url: https://reactjsexample.com/react-safe-query-a-lightweight-type-safe-wrapper-built-around-react-query/
---

## React-Safe-Query
 ![React Safe Query - A lightweight, type-safe wrapper built around React Query](https://reactjsexample.com/content/images/2024/04/Code_2024-04_10-18-47.jpg)

React-Safe-Query is a lightweight, type-safe wrapper built around React Query. It provides a type-safe API middleware for React applications, making it perfect for developers who appreciate tRPC but are working with projects that either don't use a TypeScript backend or wish to avoid the bloat and configuration associated with tRPC.

[View Github](https://github.com/cwooldridge1/react-safe-query)

## Motivation

React Query is powerful but lacks inbuilt type safety, a gap tRPC fills by offering excellent type safety and developer experience. Yet, tRPC demands a TypeScript backend, a requirement not all projects meet, especially with the rise of client-side databases like Supabase and Firebase eliminating the need for separate backends. React-Safe-Query steps in as the optimal solution for projects unable to use tRPC or those wishing to sidestep its extensive setup.

## Features

- Type Safety: Bring the power of REAL type safety to React Query without needing a TypeScript backend that uses tRPC.
- Lightweight: Minimal setup and lean configuration.
- Easy to Use: Familiar API for those who have used React Query and tRPC, making integration seamless.
NestJS tip: how to change HTTP server timeouts
Tags: node, nestjs
Published: 2024-04-07 00:00:40

### What

If you don't know what those HTTP timeouts are, I recommend you to read the following articles:

- [Tuning HTTP Keep-Alive in Node.js](https://connectreport.com/blog/tuning-http-keep-alive-in-node-js/)
- [A Complete Guide to Timeouts in Node.js](https://betterstack.com/community/guides/scaling-nodejs/nodejs-timeouts/)

### How

When using the [NestJS framework](https://nestjs.com/), sometimes you may need to change some default timeout. You can define them just like you'd do in a plain Node.js HTTP server like so:

```ts
import * as http from 'http'
import { NestFactory } from '@nestjs/core'
// import { FastifyAdapter  } from '@nestjs/platform-fastify'
import { AppModule } from './app.module'

async function bootstrap() {
  const app = await NestFactory.create(AppModule)
  // const app = await NestFactory.create(AppModule, new FastifyAdapter())

  const server = app.getHttpServer()

  console.log(server instanceof http.Server) // true

  // The timeout value for sockets
  server.setTimeout(2 * 60 * 1000)
  // The number of milliseconds of inactivity a server needs to wait for additional incoming data
  server.keepAliveTimeout = 30000
  // Limit the amount of time the parser will wait to receive the complete HTTP headers
  server.headersTimeout = 31000

  await app.listen(3000)
}
bootstrap()
```

That's all!

Here you can find all the docs about the `http.server` we used above:
 
- [`server#setTimeout`](https://nodejs.org/api/http.html#serversettimeoutmsecs-callback)
- [`server.keepAliveTimeout`](https://nodejs.org/api/http.html#serverkeepalivetimeout)
- [`server.headersTimeout`](https://nodejs.org/api/http.html#serverheaderstimeout)
Deploy an Azure Functions app from a monorepo with a GitHub Action for Node.js
Tags: azure, azurefunctions, devrel, deploy
Published: 2024-04-06 19:34:07

---
title: Deploy an Azure Functions app from a monorepo with a GitHub Action for Node.js
published: true
date: 2024-04-07 00:00:00 UTC
tags: Azure,AzureFunctions,DeveloperExperience,Deploy
canonical_url: http://dfberry.github.io/2024-04-07-azure-functions-deploy-with-github.md
---

Azure Functions apps can be locally deployed from Visual Studio Code using the Azure Functions extension or when you create the resource in the portal, you can configure deployment. These are straightforward when your app is the only thing in the repo but become a little more challenging in monorepos.

[...more](https://dfberry.github.io/2024-04-07-mono-repo-functions.md)
20 Helpful Linux Commands You Should Know
Tags: linux
Published: 2024-04-06 22:01:43

Linux offers a ton of commands that can be used to perform various operations, ranging from simply creating a new file, to complex system controls, all from your terminal. Today we will be looking at 20 of these helpful commands. Let's go!

1. `lscpu`  - Lists the CPU info of device.

2. `apt list` - Lists all available packages.  Add (--installed) to search for only the installed ones.

4. `cmatrix` - Creates a cool matrix look in your terminal (( apt install cmatrix )).

7. `ps` - Lists all the running processes.

6. `top` - Displays info of all the running processes in your terminal.

8. `ps aux` - Prints out the complete proccess table of the kernel

9. `ps -A` - List all current process

10. `kill`  -  stops a process. ((  kill [process id] ))

11. `exit`  - Terminates the current open proccess.

12. `chsh` - Changes the login shell ((shell that boots up first in the terminal))

13. `echo $$`  -  Prints the calling parent proccess id.

14. `echo $PID_MAX` - Prints out the maximum number of proccess that can be run simultaneously in the machine.

15. `ls -F`  - Lists contents of the current directory, and also adds  `/` to the end of each directory name, to signify it's a directory.

16. `echo $PATH | sed 's/:/\n/g'` - Prints each directory contained in the the environment PATH variable, one directory per line.

17. `echo off` - Disable visibility of characters entered in the terminal(can be used for password input). The opposite is used to turn it back on.

19. `whereis` - Prints out the file path(whereabout)of a linux command or file i.e (whereis  command) .

21. `uname` - Prints out the name of the operating system.

22. `cat /etc/*os-release` -  Prints out the details of the distro u're using.

23. `echo $?` - Prints out the exit code of the previous command.

24. `diff` - Shows the difference between the two files specified.

That is all for this article. Hope you've been able to learn something new today 😊. If you have any questions or suggestions, don't hesitate to drop them in the comment section. Till then, happy coding!🤗
MongoDB: Not your grandaddy's DBMS
Tags: mongodb
Published: 2019-08-26 04:37:40

MongoDB is a flexible, noSQL database management system that allows for changes with an alacrity that modern technology and web-frenzy demands. If an app needs to regularly keep up with a constantly fluctuating stream of data, more traditional, SQL DBMS sometimes won't cut it. 
Don't get me wrong; SQL has a place and time. If, say, an organization has a predictable set of data it needs to track and a predictable way it need to track said data, a SQL DBMS is the ticket. With a SQL DBMS, tables are created in advance and are pretty rigid. You can't just pop into the DB and decide you're going to populate a new column in a jiff. You can do that...you'll just hate it and it won't happen in a jiff. Of if you need to fetch any data, you'll have to maneuver through what can sometimes be an esoteric minefield of "right joins" and obtuse selectors that lead you down a labyrinthine path of hell. Of course--as with anything new--if you stick with it, writing raw SQL queries get easier and easier over time. 
On the other hand, MongoDB and other noSQL DBMS offer easily manipulated data and the language for fetching data feels way more simple because its query language is good old fashioned JavaScript. It also stores all your data in JSON-like objects, and who doesn't love the comfort of a recognizable and familiar object? Every time I use MongoDB, it's like the scene in Ratatouille when the food critic takes a bite and has a flash back to his childhood: all those objects and all that JavaScript brings me back to the first days of learning to code and gets me all misty eyed. Plus, comfortable developers = better code.
On top of all that, MongoDB does so much stuff for you. For instance, it automatically adds unique an _id field to all entries in documents. Do you need to add it yourself? No! Do you need to set primary keys and foreign keys and blah-blah-blah? No! Do you need to mess with messy rules like adding "auto-increment"? No! Using it is a simple, straightforward process that will feel natural. It even automatically creates a collection for you, after you use a model to create a document once, without you having to do the work yourself. (Although you can still choose to create the collection manually if you want.)
If you tack on the use of Mongoose, you've got a really straightforward and powerful tool for crafting, saving, querying, manipulating, and using your data.
All that said, it probably won't ever replace the use of a SQL database. A lot of bigger companies in fact use both an SQL and a noSQL database to manage their data. Some data after all will be stagnant and need to be organized in reliable ways that are set-in-stone and intentionally do not fluctuate. Other kinds of data will be loosey-goosey and need the flexibility of noSQL. Ultimately, it's good to be comfy with both and to know why and when to use one over the other.