teleren/devto huggingface dataset:
Building a gRPC Server with NestJS and Buf: A Comprehensive Showcase
Tags: typescript, nestjs, buf, protobuf
Published: 2024-05-06 14:39:11

## Introduction
If you're familiar with NestJS and gRPC, you may have already referred to the official documentation on [implementing gRPC in NestJS](https://docs.nestjs.com/microservices/grpc). While Protoc is a standard tool, as you delve deeper into customization, its complexity increases.

This is where Buf comes in. Buf offers a simpler alternative to Protoc for generating SDKs, documentation, and more. Despite its simplicity, I noticed a lack of sample projects or showcases integrating Buf with NestJS. 

Therefore, I took it upon myself to create [one](https://github.com/Ko1103/nestjs-buf-example).

## Overview of repository
This repository (https://github.com/Ko1103/nestjs-buf-example) is a NestJS and Buf usage example for protobuf server implementation. 
It will help you to understand about

- directory structure
- explains requirements
- installation process
- how to run the application

## Project Structure

```shell
.
├── Dockerfile
├── README.md
├── docker-compose.yml
├── nest-cli.json
├── proto // proto files
├── src
│   ├── posts // User posts resource
│   ├── proto // TypeScript SDK generated from proto file
│   ├── users // Users resource
│   │   ├── users.controller.ts
│   │   ├── users.module.ts
│   │   ├── users.service.ts
│   ├── app.module.ts
│   ├── main.ts
├── tsconfig.build.json
├── tsconfig.json
```

## Installation and Setup

### Requirements

- docker & docker compose cli
- Node.js v18

Please note that I developed this project using an M1 Mac.


To get started, clone repository.

```shell
git clone git@github.com:Ko1103/nestjs-buf-example.git
```

Next, install the node_modules

```shell
npm ci
```

Generate TypeScript SDK from protobuf files

```shell
npm run proto:gen
```

Finally bring up docker container.

```shell
docker compose app
```

Try accessing gRPC via `http:localhost/5000`.

## Conclusion
With this repository, you now have the ability to create new gRPC projects with NestJS using Buf. However, I'm concerned that the TypeScript SDK generated into src/proto may not be optimal. Please feel free to share any alternative options or ideas you may have regarding this.

Thank you for reading until the end.
## Reference

- https://docs.nestjs.com/microservices/grpc
- https://buf.build/
Announcing The London Perl & Raku Workshop 2024
Tags: perl, lpw, raku, conference
Published: 2024-05-06 14:39:45

The London Perl & Raku Workshop (LPW) will take place this year on Saturday 26th October and you are [encouraged to submit your talk proposals now](https://act.yapc.eu/lpw2024/). The venue is in final stages of being confirmed - it will be in central London (UK).

We'd also like to announce our CFP. We welcome proposals relating to Perl 5, Raku, other languages, and supporting technologies. We may even have space for a couple of talks entirely tangential as we are close to finalising the venue (very central London) and should have room for two tracks.

Talks may be long (40mins), short (20 mins), or very short (aka lightning, 5 mins) but we would prefer talks to be on the shorter side and will likely prioritise 20min talks. We would also be pleased to accept proposals for tutorials and discussions. The deadline for submissions is 30th September.

We would really like to have more first time speakers. If you’d like help with a talk proposal, and/or the talk itself, let us know - we’ve got people happy to be your talk buddy!

[Register](https://act.yapc.eu/lpw2024/register) (it's free!) and submit your talk on the [workshop site](https://act.yapc.eu/lpw2024/).

We would also like to make a call for sponsors - does your company want to support the workshop? By sponsoring LPW you can demonstrate your support for the Perl and/or Raku languages and nurture your relationship with the local developer community. Much more information can be found on the [workshop site](https://act.yapc.eu/lpw2024/) along with a [sponsor prospectus](https://act.yapc.eu/lpw2024/sponsoring.html).

As well as the benefits as listed on the aforementioned page, sponsors will all feature in blog posts, news posts, social media posts.

That starts right now, with our first sponsors who have already generously sponsored the workshop:

* [Geekuni](https://geekuni.com/)

With thanks from The London Perl & Raku Workshop 2024 organising team.
Disabling .NET Aspire authentication to skip the login page
Published: 2024-05-06 14:30:00

Preview 6 of .NET Aspire introduced a login page to access the dashboard. Unless the dashboard is launched from Visual Studio or Visual Studio Code (with the [C# Dev Kit extension](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit)), the login page will appear and prompt for a token. For scenarios where the dashboard is started via `dotnet run` or from the Docker image, the token can be retrieved from the console window that was used to start the app host. An URL also containing the token in a query string parameter `t` allows bypassing the login page and accessing the dashboard directly. Once authenticated, a cookie is created to avoid entering the token each time.

![The token appears in the console window.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b5la9r9mmpgfeej34u55.png)

This login page is particularly useful when the dashboard is accessible over the local network or internet. However, for local development scenarios, some might find this step unnecessary or bothersome. Fortunately, there are two ways to disable it.

## Disabling the .NET Aspire login page through an environment variable

You can use the `DOTNET_DASHBOARD_UNSECURED_ALLOW_ANONYMOUS` environment variable to disable the login page, for instance in a launch settings profile:

```json
{
  "$schema": "https://json.schemastore.org/launchsettings.json",
  "profiles": {
    "https": {
      // [...]
      "environmentVariables": {
       // [...]
        "DOTNET_DASHBOARD_UNSECURED_ALLOW_ANONYMOUS": "true" // <-- ADD THIS LINE
      }
    }
  }
}
```

It's also possible to use it when starting the dashboard via Docker:

```bash
docker run --rm -it -p 18888:18888 -p 4317:18889 -d --name aspire-dashboard -e DOTNET_DASHBOARD_UNSECURED_ALLOW_ANONYMOUS='true' mcr.microsoft.com/dotnet/nightly/aspire-dashboard:8.0.0-preview.6
```

## Disabling the .NET Aspire login page programmatically

When building the `DistributedApplication`, you can inject a configuration value to disable the login page:
    
```csharp
var builder = DistributedApplication.CreateBuilder(args);

builder.Configuration.AddInMemoryCollection(new Dictionary<string, string?>
{
    ["AppHost:BrowserToken"] = "",
});
```

Note that this method does not work with `appsettings.json` files because the `DistributedApplication.CreateBuilder` method overrides the empty token. With `AddInMemoryCollection`, you ensure that the configuration is modified after this logic.

## References

- [.NET Aspire dashboard authentication documentation](https://learn.microsoft.com/en-us/dotnet/aspire/fundamentals/dashboard/explore#dashboard-authentication)
- [.NET Aspire code search for `AppHost:BrowserToken`](https://github.com/search?q=repo%3Adotnet%2Faspire+%22AppHost%3ABrowserToken%22&type=code)
How to Visualize Live-Streaming Frames from Intel RealSense Depth Sensor
Tags: tutorial, python, opensource, rust
Published: 2024-05-06 14:25:42

{% cta https://www.rerun.io/examples/robotics/live_depth_sensor %} Source Code {% endcta %} {% cta https://www.rerun.io/examples %} Explore Other Examples {% endcta %}

**This example requires a connected RealSense depth sensor.**

The Intel RealSense depth sensor can stream live depth and color data. To visualize this data output, we utilized Rerun.

# Logging and visualizing with Rerun 

The RealSense sensor captures data in both RGB and depth formats, which are logged using the Image and DepthImage archetypes, respectively. Additionally, to provide a 3D view, the visualization includes a pinhole camera using the Pinhole and Transform3D archetypes.

The visualization in this example were created with the following Rerun code.

---

## RDF

For visualize the data as RDF:

```python
rr.log("realsense", rr.ViewCoordinates.RDF, timeless=True) 
```

---

## Image 

First, the pinhole camera is set using the Pinhole and Transform3D archetypes. Then, the images captured by the RealSense sensor are logged as an Image object, and they're associated with the time they were taken.

```python
rgb_from_depth = depth_profile.get_extrinsics_to(rgb_profile)
rr.log(
    "realsense/rgb",
    rr.Transform3D(
        translation=rgb_from_depth.translation,
        mat3x3=np.reshape(rgb_from_depth.rotation, (3, 3)),
        from_parent=True,
    ),
    timeless=True,
)

rr.log(
    "realsense/rgb/image",
    rr.Pinhole(
        resolution=[rgb_intr.width, rgb_intr.height],
        focal_length=[rgb_intr.fx, rgb_intr.fy],
        principal_point=[rgb_intr.ppx, rgb_intr.ppy],
    ),
    timeless=True,
)

rr.set_time_sequence("frame_nr", frame_nr)
rr.log("realsense/rgb/image", rr.Image(color_image))
```

---

## Depth image 

Just like the RGB images, the RealSense sensor also captures depth data. The depth images are logged as DepthImage objects and are linked with the time they were captured.

```python
rr.log(
    "realsense/depth/image",
    rr.Pinhole(
        resolution=[depth_intr.width, depth_intr.height],
        focal_length=[depth_intr.fx, depth_intr.fy],
        principal_point=[depth_intr.ppx, depth_intr.ppy],
    ),
    timeless=True,
)

rr.set_time_sequence("frame_nr", frame_nr)
rr.log("realsense/depth/image", rr.DepthImage(depth_image, meter=1.0 / depth_units))
```

---

## Join us on Github
{% github https://github.com/rerun-io/rerun %}
Encore for TypeScript - Open Source Backend SDK & Rust runtime for Node.js
Tags: typescript, javascript, backenddevelopment, cloud
Published: 2024-05-06 14:22:14

Day 1 of [Launch Week](https://encore.dev/launchweek) is finally here and we're kicking things of with a big one...

**Encore for TypeScript is now available and ready for production use!**

You can now use Encore's simple experience for building event-driven and distributed system, in TypeScript.

It's based on a new Open Source Backend SDK that provides a declarative way of building services, APIs, and using cloud primitives like databases, Pub/Sub, cron jobs, and more.

Encore for TypeScript is powered by our new Rust-based runtime, integrated with Node.js for 100% compatability the Node ecosystem. It provides some major upgrades compared to standard Node.js/Express:
- 7x faster throughput (req/s)
- 85% reduced response latency
- 0 NPM dependencies
- End-to-end type-safety even at runtime

👉 [Read all about the launch on the blog](https://encore.dev/blog/encore-for-typescript) or [watch the launch video on YouTube](https://youtu.be/zr3OXQKbaHQ?si=Qj-6k9D2cg1MhMoW) 👈

**Tune in for Launch Week**
- Follow along on the [Launch Week website](https://encore.dev/launchweek)
- Every day we'll share the new launch in a livestream via our [Discord Community](https://encore.dev/discord) at 12pm UTC, we hope you tune in!
Kas see on õige lahendus teie jaoks?
Tags: laen, krediit, laenud
Published: 2024-05-06 14:14:18

Laenuvõtmine võib olla kasulik viis suuremate väljamiste finantseerimiseks, olgu selleks siis maja ostmine, auto soetamine või koduremont. Kuid [laen](https://kiir-kredi.online/) on finantsiline kohustus, seetõttu on oluline hoolikalt kaaluda, kas laen on teie jaoks õige lahendus.

**Mida kaaluda enne laenu võtmist**

* **Kas teil on laenu jaoks piisavalt sissetulekut?** Veenduge, et suudate mugavalt maksta laenumakseid koos igapäevaste kulutustega.
* **Millist summat vajate?** Laenake ainult seda summat, mida tegelikult vajate. 
* **Mis on laenu intressimäär?** Võrrelge erinevate laenupakkujate intressimäärasid, et leida parima võimaliku lahenduse.
* **Millised on laenutingimused?** Pöörake tähelepanu tagasimaksegraafikule, viivistluste tasudele ja muudele laenutingimustele.
* **Kas on olemas muid võimalusi?** Enne laenu võtmist kaaluge säästmist või perekonnalt/sõbralt laenamise võimalust.

**Laenualternatiivid**

* **Säästmine:** Säästmise teel kogute raha oma eesmärkide saavutamiseks. Kuigi see võib võtta rohkem aega kui laenu võtmine, ei pea te intresse maksma.
* **Perekonnalt või sõbralt laenamine:** Kui teil on usaldusväärne pereliige või sõber, kes on nõus teile raha laenama, võib see olla odavam variant kui pangast laenu võtmine.
* **Toetused ja stipendiumid:**  Uurige, kas on olemas toetusi või stipendiumeid, mis võiksid teid teie eesmärkide saavutamisel aidata.

**Kokkuvõtteks**

[Laen](https://kiir-kredi.online/) võib olla kasulik finantsinstrument, kuid see ei ole alati õige lahendus. Enne laenu võtmist on oluline hoolikalt kaaluda plusse ja miinuseid ning veenduda, et suudate laenumakseid mugavalt tasuda. Samuti tasub uurida laenualternative, näiteks säästmine või toetuste/stipendiumide otsimine.
#2487. Remove Nodes From Linked List
Published: 2024-05-06 13:44:25


https://leetcode.com/problems/remove-nodes-from-linked-list/?envType=daily-question&envId=2024-05-06

```javascript

/**
 * Definition for singly-linked list.
 * function ListNode(val, next) {
 *     this.val = (val===undefined ? 0 : val)
 *     this.next = (next===undefined ? null : next)
 * }
 */
/**
 * @param {ListNode} head
 * @return {ListNode}
 */
var removeNodes = function (head) {
    let stack = []
    let curr = head

    while (curr) {
        while (stack.length && curr.val > stack[stack.length - 1]) {
            stack.pop()
        }
        stack.push(curr.val)
        curr = curr.next
    }

    //This converts the stack into a linkedlist
    let dummy = new ListNode()
    let dummyCurr = dummy

    for (let val of stack) {
        dummyCurr.next = new ListNode(val)
        dummyCurr = dummyCurr.next
    }

    return dummy.next
};

```
Install Ruby and Rails on Fedora 40
Tags: ruby, rails, fedora, asdf
Published: 2024-05-06 13:37:12


![Ruby ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g52gjpfce8aecuuivkqk.jpeg)
A few weeks ago I’ve had a problem about install the Ruby on Rails development environment on Fedora 39. First I try the same tutorial that I always use to install Rails on Ubuntu/Debian and similar distros, but I’ve had some problems. If you’re using some Debian based distribution I strong recommends this article:

https://gorails.com/setup/ubuntu/22.04

But if you’re a Fedora user, and this is the reason that you stay here, let’s go! Fedora have one of the most stable and simple to use package manager among the Linux world called “dnf”, something strong like that is the Pacman for Arch Linux. Ok, let’s setup our system.

The first thing is obvious but stronger needed, update your system, so:

```bash
sudo dnf update -y
```

The flag “-y” is the same thing to say “Yes” to install all the packages. Now let’s install some needed packages:

```bash
sudo dnf install git curl plaintextmake automake gcc gcc-c++ kernel-devel libyaml-devel -y 
```

Now everything in our system is ok to build and install our ruby versions! In the last two years I've been using "asdf" for multiple versions of languages like Ruby, Node and Elixir and for now I don't have any intention to change to another. To learn more about asdf:

https://asdf-vm.com/

So, now let’s install “asdf” on our system:

```bash
cd
git clone https://github.com/excid3/asdf.git ~/.asdf
echo '. "$HOME/.asdf/asdf.sh"' >> ~/.bashrc
echo '. "$HOME/.asdf/completions/asdf.bash"' >> ~/.bashrc
echo 'legacy_version_file = yes' >> ~/.asdfrc
echo 'export EDITOR="code --wait"' >> ~/.bashrc
exec $SHELL
```

Now we need to install the Ruby asdf plugin:

```bash
asdf plugin add ruby
```


To install Ruby and set the default version, we’ll run the following commands:

```bash
asdf install ruby 3.3.1
asdf global ruby 3.3.1
echo "gem: --no-document" > ~/.gemrc
gem update --system
```

Ruby installed, let’s install rails:

```bash
gem install rails
```

And now everything is ok, let’s make something awesome!

```bash
rails -v
```

Until the future!
Building a Simple Web Server in Node.js: A Beginner's Guide
Published: 2024-05-06 13:34:30


Are you curious about how websites work behind the scenes? Have you ever wondered what happens when you type a URL into your browser and hit enter? In this beginner-friendly guide, we'll explore the basics of building a simple web server using Node.js, a popular JavaScript runtime.

**Setting up the Tools**
Before we dive into building our web server, let's gather the tools we'll need:

```
const http = require('http');
const fs = require('fs');
const url = require('url');
const querystring = require('querystring');
const figlet = require('figlet');
```

#Creating a Server# 

Now, let's create our web server using Node.js's built-in `http` module:

```
const server = http.createServer((req, res) => {
  // Server code here
});
```
This code sets up a server that listens for incoming requests and defines what to do when a request is received.

#Reading Requests# 
When a request comes in, we need to understand what the requester is asking for:

```
const page = url.parse(req.url).pathname;
const params = querystring.parse(url.parse(req.url).query);
```
Here, we're parsing the URL to extract the path and any query parameters that might be included in the request.

#Checking What's Asked For# 
Based on what the requester wants, we respond accordingly:

```
if (page == '/') {
  // Send main page
} else if (page == '/otherpage') {
  // Send other page
} else if (page == '/api') {
  // Deal with API request
} else {
  // Handle 404 error
}

```
We check the path of the request and take appropriate actions, such as serving different pages or handling API requests. If the requested page doesn't exist, we send a "404 Not Found" error message.

#Sending Back the Response#
Once we know what the requester wants, we send back the response:

```
res.writeHead(200, {'Content-Type': 'text/html'});
res.write(data);
res.end();
```
We set the appropriate HTTP status code (e.g., 200 for "OK") and send the requested data back to the requester.

#Dealing with Different Requests# 
Sometimes, the requester may ask for something we don't have:

```
figlet('404!!', function(err, data) {
  res.write(data);
  res.end();
});
```
In this case, we use the figlet module to create an ASCII art representation of "404!!" and send it back as an error message.

#Listening All the Time# 
Finally, we need our server to listen for requests continuously:

```
server.listen(8000);
```
This line of code tells our server to listen on port 8000 for incoming requests, making our web server always available.

And there you have it! With just a few lines of code, we've created a simple web server in Node.js. While this example is basic, it provides a foundation for understanding how web servers work and can serve as a starting point for more complex applications. Happy coding!
show me the numbers!
Tags: gamedev, writing
Published: 2024-05-06 13:22:59

In the previous approach, we neglected the quality of the translation.

However, I doubt that this mindset reflects the majority.

During one of our weekly meetings,[Seba Gioseffi](https://twitter.com/SebaGioseffi)mentioned an alternative approach.

Seba credited[Chris Zukowski](https://howtomarketagame.com/)with this insight, although we couldn’t locate a corresponding blog post; it might have been a tweet or similar.

What we did discover was a blog post where he discusses the[impact of translating your Steam page](https://howtomarketagame.com/2022/10/05/should-i-translate-my-steam-page-and-other-effects-on-steam-traffic/)and a[comment on Steamworks](https://partner.steamgames.com/doc/store/localization):

> Tip: If you translate the content on your store page into languages that you are considering supporting, you can look at regional wishlists for your game to get a sense of where your game might be popular and which languages might warrant higher priority for translation of your game.
> 
> 

This presents an intriguing approach to addressing the cost of localization with limited resources:

- Translate the Steam page using LLMs.
- Analyze wishlist distribution.
- Conduct human translations for regions with significant wishlists and LLM translations for others (or omit translation entirely for those regions).

I place more trust in an LLM’s ability to translate marketing text tailored for Steam than in localizing an entire game accurately.

What I find compelling about this approach is its utility even when lacking funds to translate into languages with the most wishlists.

Rather than scrambling to find collaborators for numerous languages, you can focus your efforts on languages with the highest wishlist counts.

Based on my experience, wishlist numbers decrease rapidly, with only 2 or 3 languages having significant wishlists while others have very few.

Tomorrow, we will explore the third approach, in which we rely on “old” mindsets.
what is flash bitcoin
Tags: cryptocurrency, bitcoin, flashbitcoin, investment
Published: 2024-05-06 13:06:01

Flash Bitcoin is a type of cryptocurrency that is sent to your wallet but does not remain there permanently, as it is dependent on the software used to flash the coin click here. While flash bitcoin is indistinguishable from real bitcoin, the key difference lies in its temporary nature. These coins are generated by specific flash bitcoin software, which allows users to send fake bitcoin into the blockchain network for a designated period of time, typically 90 days. This temporary currency functions like real bitcoin during its lifespan but will disappear from the block chain after the specified time frame.
telegram t.me/eaziishops
flash bitcoin software
Can you earn money with this software
It is possible to earn money without any initial investment through the use of bitcoin flash technology. However, it is crucial to exercise caution and conduct thorough research before engaging with developers or vendors in this space, as some may source their tools from the dark web. To explore reputable sources for flash bitcoin and related software, please visit our recommended website. https://eaziishop.shop/ . https://eaziishop.shop/product-category/flash/ . https://eaziishop.shop/contact-us/ . https://eaziishop.shop/what-is-flash-bitcoin/
what is flash bitcoin
Tags: webdev, flash, bitcoin, cryptocurrency
Published: 2024-05-06 13:04:14

Flash Bitcoin is a type of cryptocurrency that is sent to your wallet but does not remain there permanently, as it is dependent on the software used to flash the coin click here. While flash bitcoin is indistinguishable from real bitcoin, the key difference lies in its temporary nature. These coins are generated by specific flash bitcoin software, which allows users to send fake bitcoin into the blockchain network for a designated period of time, typically 90 days. This temporary currency functions like real bitcoin during its lifespan but will disappear from the block chain after the specified time frame.
telegram t.me/eaziishops
flash bitcoin software
Can you earn money with this software
It is possible to earn money without any initial investment through the use of bitcoin flash technology. However, it is crucial to exercise caution and conduct thorough research before engaging with developers or vendors in this space, as some may source their tools from the dark web. To explore reputable sources for flash bitcoin and related software, please visit our recommended website. https://eaziishop.shop/ . https://eaziishop.shop/product-category/flash/ . https://eaziishop.shop/contact-us/ . https://eaziishop.shop/what-is-flash-bitcoin/