teleren/devto huggingface dataset:
Zig! Can you C?
Tags: c, zig, raylib
Published: 2024-04-04 21:27:33

I just want to develop something different. But what? Game, graphics, sound processing?
Surely you'll say Rust! Yep done a lot of things in Rust. But maybe C?

Ohhh... Noooo...
Remember `Segmentation Fault`?
How are you going to manage depenencies?

OK, So try to use some C library in ZIG! How hard it will be? Let's see.

Try to write somple app using `raylib`.

```bash
$ mkdir ray_test_zig
$ cd ray_test_zig
$ zig init-exe
```

Got a project. Try to run?

```bash
$ zig build run
```

Yep it's working.
We need to fetch and include `raylib` somehow.

Zig uses `zon` to fetch dependencies. Does it work with C libraries? Find out!

We need to provide where the lib is! Here it is:

Create `build.zig.zon` file.

```zig
.{
    .name = "ray_test_zig",
    .version = "0.0.1",

    .dependencies = .{
        .raylib = .{
            .url = "https://github.com/raysan5/raylib/archive/refs/tags/5.0.tar.gz",
        },
    },
}
```
Try to build project?

```bash
$ zig build
```

What it is?

```
Fetch Packages... raylib... ./ray_test_zig/build.zig.zon:7:20: error: url field is missing corresponding hash field
.url = "https://github.com/raysan5/raylib/archive/refs/tags/5.0.tar.gz",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
note: expected .hash = "1220c28847ca8e8756734ae84355802b764c9d9cf4de057dbc6fc2b15c56e726f27b",
```

Ok, zon expects a hash, just in case someone will try to hack out computer. Once again:

```zig
.{
    .name = "ray_test_zig",
    .version = "0.0.1",

    .dependencies = .{
        .raylib = .{
            .url = "https://github.com/raysan5/raylib/archive/refs/tags/5.0.tar.gz",
            .hash = "1220c28847ca8e8756734ae84355802b764c9d9cf4de057dbc6fc2b15c56e726f27b",
        },
    },
}
```
Try once again:

```bash
$ zig build
```
It works! Woooow! That's it?

No! We need to tell zig to include `raylib` during build!

Now we will edit `build.zig`. Just above line ~30 we have `b.installArtifact(exe);`
Before that line we need to add:

```zig
const raylib = b.dependency("raylib", .{
    .target = target,
    .optimize = optimize,
});

exe.installLibraryHeaders(raylib.artifact("raylib"));
exe.linkLibrary(raylib.artifact("raylib"));

```

We're teling zig where header files are and to link out executable with `raylib`.
Does it works? Let's check!

```bash
$ zig build
```

OMG! Looks like somethings with raylib was happened. It's compiled?
Let's port an simple example from `raylib` to zig.

In the `src/main.zig`:

```zig
const std = @import("std");

const ray = @cImport({
    @cInclude("raylib.h");
});

pub fn main() !void {
    ray.InitWindow(800, 450, "Hey ZIG");
    defer ray.CloseWindow();

    while (!ray.WindowShouldClose()) {
        ray.BeginDrawing();
        ray.ClearBackground(ray.RAYWHITE);
        ray.DrawText("Congrats! You created your first window!", 190, 200, 20, ray.LIGHTGRAY);
        ray.EndDrawing();
    }
}
```

```bash
$ zig build
```

No errors? Great!

```bash
$ zig build run
```

We got the raylib window!
As you can see! Just one line of code and `raylib` working like native lib!

So yep! Zig can C!
The journal of the frontend developer
Tags: webdev, programming, español, devjournal
Published: 2024-04-04 23:02:43

Hola todos, todas, (ó todes). Hace 4 años soy front-end developer. Una de mis pasiones es escribir, y lo he hecho la mayor parte de mi vida. Obviamente, es algo que quise traer a mi nueva carrera como developer, pero siempre concluyo que o no tengo suficiente experiencia como para dar una opinión profunda sobre alguna herramienta, ó ya hay mucho contenido sobre esa herramienta. 

Sin embargo, las vivencias que tenemos en nuestras respectivas empresas sí es algo único. Los dramas, los desafíos, y sobre todo el contraste que hay en lo que nos venden los creadores de contenido sobre cómo debería ser el entorno de desarrollo, y como realmente es. 

En fin, creo que podemos hacer de este un espacio para que compartamos y comentemos sobre lo que creamos relevante a nuestro performance como web/app dev.

Deja un comentario con tu experiencia o lo que quieras decir.

//

Hi everyone, I've been a front-end developer for 4 years. One of my passions has always been writing. For obvious reasons, I wanted to bring this passion along when I became a developer and wanted to share content based on my experience. However, I've always come to the same two conclusions... I don't have enough experience to share a deep insight on a web-dev tool, or there is already too much content out there about it.

However, our own experiences as front-end developers are unique. Drama, challenges, and the contrast between what's expected and the reality as developers.

Anyway, I think we could make this a space to share and comment on anything we want that's relevant to our performance as web/app dev.

Leave a comment with your experience or whatever you wanna say.
Day 942 : Smooth Sailing
Tags: hiphop, code, coding, lifelongdev
Published: 2024-04-04 22:38:56

_liner notes_:
- Professional : So...today was the day. After copying over code from the proof of concepts I made, refactoring, adding some more features, testing and doing the documentation, I pushed the Web Components code to the repository. Felt like a huge weight was lifted off my shoulders. I'm going to give it another day and take a look at them again tomorrow, test them one more time, double check the documentation and the publish them.

- Personal : So, I went through tracks on Bandcamp and picked what I'll purchase this week. I'm going to pick them up on Friday because on that day, the artist will see more from each sale. It's called Bandcamp Friday and it happens on the first Friday of the month. Started putting together the social media posts. Worked on my side project. Added my t-shirt shop and worked out the responsive text. Started thinking about the real text to put on the site. Not a bad night.

![The photo shows a beautiful landscape with a large bay and mountains in the distance. The foreground is a rocky beach with some trees. The water is calm and there are some small waves crashing on the shore. The sky is a clear blue with a hint of orange from the setting sun. The location is Cox Bay, British Columbia, Canada.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n9hxlog0gd21ta4kkfgq.jpg)

Going to finish up the social media posts for the Bandcamp tracks. I want to add the real text to my side project and start working on the authentication. Probably start putting together tracks for this week's radio show. Things with the property has been smooth sailing so far. Fingers crossed that it stays that way.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube HYplnRjMVhM %}
Hey web3miss, Open Source All and merge All projects, All efforts... 🎵
Published: 2024-04-04 22:38:56

You know how many people are trying it out there?

Out of me writing this, you reading this, and some possible other later viewers?

Including Us, better said.

You know how many people, including you, are out there, trying it out?

Believe me, A LOT.

And for each new niche created, new thing developed, there will be more.

What does that mean?

That we progress better together.

**If you work on private you 're privating all us of your awesome work**
**If you work shittly in public, you lower the bar.**
**If you work in public and collaborate, we progress better**

---

We Spread Too Thin.

## When there's a breakthrough, this happens:

"I" I'll use this caracter to signify an innovator.

When there's a breakthrou, there's innovation, when there's innovation, there's Innovator/Innovators.

"I" I'll use this caracter to signify an innovator, below:

Innovator
2Innovator 2Innovator (second round of innovation)
3Innovator 3Innovator 3Innovator

and so on, so on... 🎵

This could be a Pyramid, if we try to 3d visualize it. Or a con shape.

I'd say it applies to any human pattern... exponentiality?

What's Beyond Infinte and What's Nothing?

Infinite
Nothing.

Human Boundaries.

We'll need to work better together, in any case.

---
Hi I'm Marcelo Mazza and I'm a writer/developer/uxer. If you liked this, please do interact with the piece so I can write more and work on this.

If not and useless, I'll submit and collaborate for other projects, as I say here. Signed: April 4th 2024, 19:38, Buenos Aires, Argentina, Planet Earth.

Regards,
Marcelo.
Introducing TempLang - an abbreviated FE framework
Published: 2024-04-04 22:31:09

Hi All, I've created a new frontend framework. It's designed to make the most common front end task _very_ fast to write.

I've found that during my time as a front end developer the amount of time spent wiring stuff in ways that could be automated was high enough to build something new. 

https://templang.org

I'll start by introducing a few concepts that used to take a up a lot of my time.

- **Event Binding**: you can now tag things with on:click="^update(color=key)" and it i will call the on:update handler of any parent node with the value of _key_ as the property _color_.

- **Property Renaming**: color=key is sending the value of _key_ as the property _color_ as the event propagates.

- **Access to the _target_ and _handler element_**: each event contains a _target_ and _dest_ prop so it's easy to do things with all the elements involved. _vars_ contains any variables on either element to make it easy to do stuff!

- **Styles and Classes on the fly**: Styles can be built per element, you'll notice in the example that `base-style="background-color: ${key}"` creates a new style rule as `.custom-element-6 { background-color: rgb(187, 0, 0);}` from the data `{name: "Red", key: "#B00"}` for that element.

It's still in development and getting cleaner with every generation.
TECHNOCRATE RECOVERY PROVIDES LEGITIMATE SOLUTIONS TO LOST BITCOIN
Tags: crypto, recovery, expert
Published: 2024-04-04 22:30:57

(Technocratrecovery(@)contract or. net)     (WEBSITE: ww w.technocraterecov e r y.site)
Telegram: (@)TECHNOCRATE_RECOVERY

Ever had that sinking feeling when you realize your Bitcoin stash has gone missing? Yeah, that's me. But for more unfortunate souls, like yours truly, the experience of losing 34,000 BTC was like misplacing your favorite pair of socks, only a tad more valuable. Let me introduce you to Technocrate Recovery, the digital equivalent of the golden guardians. Instead of using sabers, these people are experts in recovering stolen or misplaced cryptocurrency with the dexterity of a magician. Technocrate Recovery doesn't just pluck your precious crypto out of thin air. They offer a range of services, from forensic analysis to negotiation with cybercriminals, all with the goal of bringing back what's rightfully yours. To begin with, Technocrate Recovery thoroughly investigates how, where, and why your Bitcoin demise. Imagine Sherlock Holmes meets deerstalkers, only with a lot more tech speak. Technocrate Recovery ensures that every retrieval effort is not just effective but also squeaky clean ethically. No shortcuts or shady dealings here. Once the sleuthing is done, it's time to roll up the sleeves and get down to business. Technocrate Recovery employs an arsenal of techniques, from tracking transactions to decoding blockchain mysteries, to get your BTC back home. By implementing best practices, staying informed about emerging trends, and seeking trusted partners like Technocrate Recovery, investors can fortify their holdings and safeguard against potential losses. Remember, securing your cryptocurrency investments is not just a choice, but a necessity in the ever-evolving world of digital finance. Email Technocrate Recovery via the above Information's

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/82eto9pri31rt3jd7hnk.jpeg)
Best ways to stay up to date on web3 event and campaign
Tags: web3, webdev, javascript, jobs
Published: 2024-04-04 22:30:02

There are various ways to stay up to date on web3 events and campaigns 
. Follow trusted sources:
Twitter:
Many web3 event on Twitter for announcement and update 
Discord servers: many project have their own discord servers where they share information
Web3 media outlets:some web3 focus on web3 news and events


Utilize tracking tools:
-Crypto tracking tools

engage with the community:
-using reddit
- telegram groups 
Be cautious and do your own research 
With this tip I believe you can stay informed about event going on in the web3 space
HOW TO HIRE BITCOIN RECOVERY EXPERT GO TO WWW.danielmeulirecoverywizard.online
Published: 2024-04-04 22:21:58

Ah, the age-old tale of woe, lost crypto, shattered dreams, and a lump in your virtual wallet where your Bitcoin used to be. But fear not, intrepid reader, for there are ways to fortify your digital fortress and keep those sneaky crypto thieves at bay. As the dust settles on your epic quest for lost BTC, let me reflect on my journey and glean wisdom for the road ahead. What nuggets of knowledge have I unearthed, and how can we armor ourselves against future crypto calamities. Bitcoin theft is more common than you'd think, with hackers constantly on the prowl to snatch up those coveted digital coins. It's like a virtual game of hide and seek, except you really don't want the hackers to find your stash. Losing Bitcoin is like misplacing your wallet in a huge, crowded amusement park – except your wallet is filled with virtual currency that holds real-world value. It's not just about the numbers on the screen; it's about the cold, hard cash you've lost. It can feel like breaking up with a really great investment – it hurts, it stings, and it leaves you wondering what went wrong. It's not just about the money; it's about the trust you placed in that digital currency and the emotional rollercoaster that comes with watching it disappear. I became involved with a fraudulent bitcoin investing site where I was promised a 10% return on whatever money I invested. I gave in approximately $65,000 since I believed I would make a significant profit. I could watch my money rise, but until I lost access to this platform, I was unable to withdraw it. I missed a lot of feeding since I was unsure of what to do next. Daniel Meuli Web Recovery was a huge help to me in my attempt to reclaim my money. When it comes to recovering lost Bitcoin, you're like a sleuth on a mission to crack the case. You're exploring every nook and cranny of the digital world, hoping to stumble upon that elusive solution that will bring back your precious coins. Engaging Daniel Meuli Web Recovery is like having a heart-to-heart with a trusted advisor who understands your pain and is ready to help. They listen, they assess, and they strategize – all with the goal of bringing your lost Bitcoin back home where it belongs. Once Daniel Meuli Web Recovery has assessed the situation, it's time to roll up those digital sleeves and get to work on a customized recovery plan. It's like crafting a master plan to outsmart the bad guys and reclaim what's rightfully yours – all with the expert guidance of your newfound digital allies. Recover your lost BTC with Daniel Meuli Web Recovery by calling:
Email   hireus @ danielmeulirecoverywizard.online     
Telegram. Danielmeuli     Websites. WWW . danielmeulirecoverywizard.online Regards,
Free Brain Training with Angular
Tags: puzzles, angular, typescript, webdev
Published: 2024-04-04 22:18:51

For fun and learning, I created an endless generator for Brain Training Exercises with Angular. As a Java developer mostly working on backend projects Angular became a kind of second love. I started a few years ago and created some simple tests and prototypes. In 2016 a first full-time Angular project for a major airline that built a new booking application with Angular gave me the chance to learn a lot of good practice.

A few months ago, I reactivated an old project and updated it to the current Angular version.

## Basic framework facts

- Angular 17 + Angular Universal

- Bootstrap 5 + 
With a self-developed extension for a masonry layout. 

- Translation (ngx-translate)
The application and all brain puzzles are available in English and German language. You can switch the language at the bottom of the page.

The English version can be found at: https://puzzles.brainsporthero.com

The German version is published on the Domain: https://denksport.hirnsport.de

## Highlights about the puzzles and brain training exercises.

Letter Chaos
Find the correct word for the letter chaos.

![Brain Puzzle Letter Chaos](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wi5qa03uiqiho3ps9vt7.jpg)


Country Quiz
Identify Countries according to the borders

Country Chaos Quiz
Identify countries according to the borders that are drawn over each other.

![Brain Training Country Chaos](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dikjijfofsvoj1vhv3ha.jpg)


Be sure to have a second look because the shapes of the borders in both exercise types could be rotated and zoomed. The relative sizes could be misleading.

Flag Quiz
Find the correct name of the country flag that is depicted in the puzzle. 

![Quiz Identify the country Flag](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9g5jrmjzjii0ubzsd8wr.png)



Missing Flag Quiz
Three flags are shown. And one is missing. Can you identify the flag that mission according to the presented four answers with country names?

Solve the puzzles to keep your memory, logical thinking, math, and language skills in good shape. Have fun and send me your ideas for more and new exercises and features.
The list shows only a small subset of features I plan to add in the next month. Have fun and get ready for endless exercises.

In the web performance tool from Google Chrome (Lighthouse), the application reached a performance score of 95%.


![Lighthouse Performance Brain Training App](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/26cbn1380zf1qnf2k5nm.png)



## Features

Here are some features I will create in the coming versions in the next months:

-	More exercises: I want to connect a quiz database.
-	Track the score: Count the correct solved brain puzzles.
-	Store score and current selected filters in locale browser store. 

If you have some ideas about cool features send me a message or add a comment.
Have fun and keep your brain in good shape!
Lessons from open-source: How obsessed are you with following Single Responsibility Principle?
Tags: javascript, nextjs, opensource, react
Published: 2024-04-04 21:52:12

This lesson is picked from [Next.js source code](https://github.com/vercel/next.js/blob/canary/packages/next/src/client/index.tsx#L219C7-L219C18). In this article, you will learn how deep the imports are nested for a simple [hasBasepath](https://github.com/vercel/next.js/blob/canary/packages/next/src/client/has-base-path.ts#L5) utility function.

hasBasepath
-----------

![](https://media.licdn.com/dms/image/D4E12AQF4g466mIRzoA/article-inline_image-shrink_1500_2232/0/1712267208594?e=1717632000&v=beta&t=SSoKbDyz-Vga-nmi9UXKlmCZgntNRpWzvdyJSB19MZw)

This above code snippet is from [next/src/client/index.ts](https://github.com/vercel/next.js/blob/canary/packages/next/src/client/index.tsx#L219C7-L219C18). hasBasePath is imported from [base-path.ts](https://github.com/vercel/next.js/blob/canary/packages/next/src/client/has-base-path.ts#L5)

> [_Learn the best practices used in opensource._](https://tthroo.com/)

![level 1 import](https://media.licdn.com/dms/image/D4E12AQHMpxTU_e43fw/article-inline_image-shrink_1500_2232/0/1712267209668?e=1717632000&v=beta&t=H5PHHja6LhEbO1D63TcE_ZTWjNn5Er3xH87EUDvPQxU)

This is level 1. I usually take it 2 levels but never beyond. I resort to put the functions in the same file that are in the “proximity”. all hasBasePath does is call pathHasPrefix

pathHasPrefix is imported from [path-has-prefix](https://github.com/vercel/next.js/blob/canary/packages/next/src/shared/lib/router/utils/path-has-prefix.ts#L10).

![level 2 import](https://media.licdn.com/dms/image/D4E12AQFgDFbTsh3ecQ/article-inline_image-shrink_1000_1488/0/1712267210438?e=1717632000&v=beta&t=5ynWkxIekFxzxPYPRr-nDfQoZsCfFjORKYV_hpRDSbs)

This is level 2 in the nested imports. Again, I would have just the put the parsePath in this path-has-prefix file as it is in “proximity”.

parsePath is imported from [parse-path.ts](https://github.com/vercel/next.js/blob/canary/packages/next/src/shared/lib/router/utils/parse-path.ts#L6)

![level 3 import](https://media.licdn.com/dms/image/D4E12AQEOLeW7gtCVDA/article-inline_image-shrink_1000_1488/0/1712267210688?e=1717632000&v=beta&t=NgKdx3BvGLFl77yJknIe-dZadwBCJd4XKlmJKPU41oA)

This is level 3. Phewww! I never took it this far, but at this level, I realised, the imports are from shared folder that are used in client and server. If you strictly follow SRP ([single responsibility principle](https://en.wikipedia.org/wiki/Single_responsibility_principle)) for your functions and files, you can reuse these functions across your codebase as these do not contain side-effects.

Conclusion:
-----------

hasBasePath, a simple utility function comes from 3 nested imports in Next.js source code. I stop at second level of nested imports and put the functions in the “proximity”. If you strictly follow SRP ([single responsibility principle](https://en.wikipedia.org/wiki/Single_responsibility_principle)) for your functions and files, you can reuse these functions across your codebase as these do not contain side-effects.
Kickstart your development with Bun
Tags: bunjs, webdev, javascript
Published: 2024-04-04 21:50:07

When it comes down to web development there multiple tools and layers of decisions you need to make. Will you choose React or Svelte? Or just use HTML and HTMX? Which database should you choose? MongoDB, MySQL or Redis?

Decisions like those are never easy to answer and always depend on your personal usecase. They affect your performance, scalabilty and especially your developer experience. Over the years, there were various tools to solve the same problems. Today many of them have one thing in common: They require configuration and boilerplate files.

This is were Bun jumps in. Previously you have used node.js to develop, debug and run your applications. But you had always the need for dependencies.
Bun takes quite a different approach: They consider themselves an All-In-One development tool. Bun replaces node.js as runtime, replaces npm as package manager and is able to bundle your code like webpack.
Thats cool enough, but Bun is way faster than every other tool in the list.

![Benchmark of Bun in comparison to npm and yarn](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1605kw9lhzfl8vehgwfd.jpg)

- Bun is written in Zig and is build on top of the WebKit-Engine of Safari making it faster than node.js,which is based on Chrome's V8-Engine
- Bun is a complete toolkit for building JavaScript apps, including a package manager, test runner, and bundler. 
- Bun is designed as a drop-in replacement for Node.js. It natively implements hundreds of Node.js and Web APIs, including fs, path, Buffer and more. 

Install bun by just running 
- `powershell -c "irm bun.sh/install.ps1|iex"`on Windows
- `curl -fsSL https://bun.sh/install | bash`on Linux or MacOS

and always remember:
## Bun is fun!
Telegram bot with Camel & Spring boot
Tags: springboot, java, apachecamel, telegram
Published: 2024-04-04 21:45:17

This project serves as an example of using Apache Camel together with the Spring Boot framework to develop Telegram bots. Apache Camel is a powerful tool for integrating various systems, and Spring Boot simplifies the creation and configuration of Java applications.

https://github.com/silenzzz/spring-camel-tgbot
https://github.com/silenzzz/spring-camel-tgbot
https://github.com/silenzzz/spring-camel-tgbot