teleren/devto huggingface dataset:
How to fix nested git submodules
Tags: git
Published: 2024-03-19 20:10:48

---
title: How to fix nested git submodules
published: true
description: fixing nested git submodules
tags: git
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5nnjh85ap03z4oh3iwtz.jpeg
# Use a ratio of 100:42 for best results.
# published_at: 2024-03-19 20:00 +0000
---

What to do when you accidentally initialized a git inside another git and you can not push to GitHub...


{% embed https://youtu.be/5Nnxsqj8QFo?si=AXE05KCA4FK8jndo %}
Embracing Innovation: How SMMpanelReviews Transformed My Dev Journey
Published: 2024-03-19 20:06:01

Within the thriving developer community on dev.to, innovation is a way of life rather than simply a catchphrase. As an enthusiastic participant in this vibrant community, I'm always searching for cutting-edge methods and resources to further my own growth. I had no idea that my search for creativity would take me to the world of SMM panels and SMMpanelReviews, which would change my life.

An Inquiry into Innovation:

My path on dev.to has been marked by a constant quest for education and an insatiable curiosity about new ideas. In the company of like-minded people who shared their perspectives and experiences, I was motivated to push the limits of technology and development.

Joining the Pieces:

While investigating state-of-the-art development tools and techniques, I stumbled into conversations about the nexus between marketing and technology. I first heard about SMM panels and their ability to completely change social media strategy here. Enthralled by the prospects, I set out on a quest of exploration, keen to ascertain their pertinence to my developmental pursuits.


Let me introduce you to [SMMpanelReviews](https://smmpanelreviews.org/), a brand that in the field of SMM panels is known for quality and originality. I became aware of their unrealized potential as I dug more into their services for developers just like myself. I recognized a chance to use their services to connect with a wider audience and extend the impact of my development programs, going beyond their main purpose of improving social media presence.

Opening Up New Routes:

SMMpanelReviews has really been a life-changing event for me. Their services have pushed me ahead and provided doors to new prospects, from making my coding projects more visible to encouraging cooperation within the dev community. Furthermore, the smooth assimilation of social media marketing tactics into my development process has improved my capacity to exhibit my work and establish connections with other developers worldwide.
Parameter!
Tags: parameter, ai, gpt3
Published: 2024-03-19 20:00:30

"What does the term 'parameter' mean in the field of artificial intelligence? (For beginners) 🤔 Have you ever come across the phrase 'The large language model contains billions of parameters' and wondered about the meaning of the word 'parameter' in this context? 🤔 Well, in the world of artificial intelligence, especially in the field of large language models like GPT-4, the word 'parameter' refers to an adjustable value used to adjust the behavior of the model. ⚙️

Imagine parameters as small buttons used to adjust the settings of the model. Each button affects how the model processes information and makes decisions. 🧠 The more parameters there are, the more capable the model becomes at learning and adapting to different tasks. 💪

For example, when we say that GPT-4 has 1.7 trillion parameters, it means that it has 1.7 trillion of these 'parameters' finely tuned to make it a powerful and efficient language model. 🤯 Parameters are what enable large language models to understand human language and interact with it naturally, making them an important factor in evaluating the performance of these models. 🗣️

Remember, the more parameters there are, the more flexible the model becomes and the better its learning capability!"

Jaber Said
Custom Meta Titles in Rails: A quick guide
Tags: rails
Published: 2024-03-19 20:00:00

_This article was previously published on [Rails Designer](https://railsdesigner.com/meta-titles/)._

---

Meta titles are one of those stone age tools, browsers have had for ages. It was introduced in HTML 2.0, around 1995 (and supported by Mosaic, Netscape Navigator and Internet Explorer—good times!). It is still used, today, by web browsers to label the window or tab in which the web page is displayed. This helps users to identify and switch between pages they have open.

This is commonly the only (visible/user-focused) meta tag I add to my Rails apps. I might also add a meta-description for some public-facing pages, like the log in and sign up pages. This is all assuming the Rails app is only accessible through authentication.

When you create a new Rails, the title is set to the application's name you gave it. This means, for an app named **Rails Designer**, _every_ title would be **Rails Designer** too. This is hardly useful for your users.

So, let's add a few lines so every page has its own page title. And make your users a bit happier using your app.


## Add a custom title-tag to your Rails app

First, find the the `<title>` tag in your Rails app, typically it's in `app/views/layouts/application.html.erb`, but maybe you extracted the code into its own partial, eg. `app/views/shared/_head.html.erb`.

Replace the name with the following:

```ruby
<⁠%= content_for?(:page_title)? "#{yield(:page_title)} - Rails Designer" : "Rails Designer" %>
```

Rails' `content_for` is a helper method that allows you to insert content into a specific placeholder in your layout, enabling dynamic content rendering within your application's views. In above code, it check if `page_title` value is present. If it is set, `yield` it and append `- Rails Designer`. If it is not set, just display `Rails Designer`.

If you refresh the page, all pages' titles now should display `Rails Designer`. If that was the name you have your Rails app, not much has changed.

So now let's change that. For every page you want to display a unique, open it and add the following (preferably at the top):

```ruby
<⁠% content_for :page_title, "Dashboard" %>
```

Where `Dashboard` could be any value that makes sense for the page.

And that's all you need to do to add meta title to your Rails apps. An easy change, but one that makes a big difference to the users of your Rails app.
HTTP and React requests
Published: 2024-03-19 19:34:22


**- Using the JSON server**
JSON Server is a tool that allows you to quickly create a complete and functional REST API with just a few commands, using a JSON file as a data source. It is very useful during application development, especially when you need to simulate a backend while working on the frontend.


**Rescuing data from the "API"**

1. First of all, we must have a place to save them. (**useState**);

2. Render the "API" call only once. (**useEffect)**;

3. A means of making the request asynchronously. (**Fetch API**);

Saving the data via hook: "**useState**"

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


Rendering the API call only once with the hook: "**useEffect**". Performing the asynchronous request. ("**fetch**")
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bcc3qi8gjlkh8fpdnp4v.PNG)

**Adding Data**

- To add an item, we'll need to retrieve the form data with the useState

- We have to merge the data into a function after submitting and sending a "POST" request to our API;

- The process is very similar to data rescue, but now we're sending data.

Retrieving data from the form...

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

Function after submit and a POST request to our API

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

- The data is sent in the request body to the server. This can include form data, such as username and password, or any other type of information that the client wishes to send to the server. The server receives the POST request and processes the sent data. This may involve validating the data, saving it to a database, or performing other operations according to the application's business logic. The server responds to the POST request, usually with an HTTP status code indicating whether the operation was successful or not. The server can also send additional data in the response body if necessary.
Code coverage. You keep using that word. I do not think it means what you think it means
Tags: testing, devops
Published: 2024-03-19 19:32:30

Most companies use the code coverage metric to have some indication of how well their code has been tested. However, as many have pointed out, code coverage is a very poor metric for indicating whether or not your code has been tested well.

## 100% code coverage = 0% code tested

Indeed, observe the following test:

```cpp
int AddOne(int in)
{
  return in - 1;
}

TEST(MyTest, TestsAbsolutelyNothing)
{
  const auto val = AddOne(1);
}
```

This example is a bit extreme, but in a large legacy code base, situations like this can easily occur. This test will have 100% code coverage of AddOne, but due to the missing expectation, it will not test anything.

> There is no direct correlation between code coverage and the amount of code that has been tested.

This doesn’t mean that code coverage is a useless metric. Code with a high code coverage tends to be better tested than code with a very low code coverage metric. But relying on high code coverage can lull us into a false sense of security.

## Inconcievable!

The problem is that code coverage is a poor term. The issue stems from the term coverage. When you have in your head that something is “covered”, you immediately think that it has been taken care of (testing wise). With code coverage, as we have seen, this is not the truth.

Let’s look at a different example:

```cpp
int Add(int in, int value)
{
    return in + value;
}

int Subtract(int in, int value)
{
  return in - 1;
}

TEST(MyTest, TestAddAndSubtract)
{
  EXPECT_EQ(2, Add(1, 1));
  EXPECT_EQ(0, Subtract(1, 1));
}
```

In this test we have added expectations, and still have 100% code coverage. This will suggest that the code is tested, but there is an obvious error in the code still.

## Inverting the term

Instead, we should invert the metric, and use another term. In lack of a better name, I will use the term “Legacy Code”. This term, I have borrowed from Dean Martins excellent book “Working effectve with legacy code”, wherein he describes legacy code as code with no tests. “Legacy code%” is then equal to “100% - code coverage%”. And this metric accurately tells us how many percent of the code has not been tested at all.

So, where previously your CI tool would report 80% code coverage, now should now report 20% legacy code.

> Legacy code% = 100% - code coverage%

Now, having 0% legacy code still does not mean that code has been tested well. It could still be tested poorly as in the second example. So the metric is still fairly flawed. In the end, tests can never prove the absense of errors.

However, I believe that getting rid of the word “coverage” will impove peoples understanding of what this metric actually means.
Your Git Commit Messages Suck! Here's What To Fix 🛠
Tags: github, git, tutorial, programming
Published: 2024-03-19 19:30:00

Writing commit messages is like a daily exercise you have to practice as a programmer.

Even if you are writing code for fun, it's important to realise this small detail reflects your _developer personality_ in general.

Writing quality commits is what separates the _average_ developer from the _extraordinary_ one.

***

### Do this! 👇

Write better Git commit messages with these things in mind:

- Start with a **verb** and use the **present tense**.

1. ❌ Improved, Fixed, Updated
2. ✅ **Improve, Fix, Update**

- Describe why the commit is **necessary**.

- Describe what the commit **does**. Refer to **tickets/issues** if applicable.

Example:

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

***

### Final Thoughts 🙌

**Comment down some tips on writing Git commits you use as a Software Developer!**

Also, insights on this short-form content would be appreciated.

I hope you liked the article! ❤️

Connect with me on [linktree](https://linktr.ee/arjuncodess).

Happy Coding! 🚀
Thanks for 23102! 🤗
what the heck are passkeys?
Published: 2024-03-19 19:07:04

According to CSS tricks, passkeys secure passwords, or public keys, using cloud based technology that protects from phishing and data breaching. Since public keys are easily generated by anyone, public keys receive a layer of protection by require a paired private key. This is the essence of passkey technology. 

More specifically, passkeys are an iteration of WebAuthn. Webauthn uses asymmetric public key cryptography which requires the pairing of a public key and a private key. The difference between Passkeys and WebAuthn is that private keys generated by WebAuthn are single-device keys and are therefore device-dependent. Loss of the original device prevents access to private keys generated by WebAuthn. On the other hand, private keys generated by passkeys work seamlessly between devices. Passkeys allow users to utilize asymmetric public key cryptography between devices, rendering for a more fluid experience.

Another difference between passkeys and WebAuthn is its authentication process. WebAuthn sends the user an "Allow Credentials" list to allow the user to login while passkeys skip this step. CSS tricks explains with further detail the process of attestation and assertion but the details are a bit complex for me to fully understand at my entry level interpretation. 

Finally, CSS tricks discusses the current limitations and future potential of passkeys. Currently, there is no interoperability between the two major users, iOS and Android. Passkeys are less flexible when switching between types of phones. However, CSS tricks does state that if passkeys are integrated into the operating system rather than the various vendors, it can provide interoperability. More optimistically, if more operating systems adopt passkeys, users can eliminate the need for passwords and keep information more secure.
Live reloading in Go
Tags: 100daystooffload, go, air, reloading
Published: 2024-03-19 18:54:27

When writing code you want a fast feedback loop on your changes in the code. **Live reloading** is one feature that can enable that in your coding process.

The purpose of **live reloading** is to have an automatic reload of your application when a source file of the application is being changed. This is a common tool if you are working with web front-end development, but still useful for other types of applications.

To enable **live reloading** in Go we will checkout the command tool, [Air - Live reload for Go apps](https://github.com/cosmtrek/air).

> Air is yet another live-reloading command line utility for developing Go applications. Run `air` in your project root directory, leave it alone, and focus on your code.

We start with the installation.

```bash
go version
// go version go1.22.0 linux/amd64

go install github.com/cosmtrek/air@latest 
```

Next up is to create an example application to play with.

```bash
mkdir air-example && cd $_
go mod init example/air
touch main.go

code .
```

Enter this simple application into the `main.go` file.

```golang
package main

import (
	"fmt"
)

func main() {
	fmt.Println("Hello Air!")
}
```

Now we can start `air` by just typing `air` in the terminal, be sure that you are in the root directory of the application.

This will start the application and prompt you with the text, `Hello Air`.

![Starting air](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ixtzevicl9hskfieiwqi.png)

If we now change the text in the given `Println` argument to, `Hello, Air!!`, and save the file, Air will automatically restart the application and print the new text.

![updating air](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/izobo2ahegj1k490ni4l.png)

So that is how it basically works. There is one problem when it comes to running CLI applications in Air, and that is when you want to use IO operations like `Scanf`. Air do not support that now (at least in v1.51.0), but it has plans for that in a future release. However developing web applications and services work great with Air right now.

There is also possible to configure Air with a `.air.toml` file, which can be created like this.

```bash
air init
```

More details about the file can be found [here](https://github.com/cosmtrek/air/blob/master/air_example.toml).

As you might have noticed, `Air` creates a `tmp` folder that holds the compiled version of the application. This is one of several things you can configure in the toml file.

Overall `Air` is an easy tool to get started with and it's convenient to have your application restarted automatically, so give it a try.

Happy coding!
What is the worst advice you've ever received?: CodeNewbie Podcast
Tags: discuss, codenewbie, podcast, career
Published: 2024-03-19 18:43:00

Hey y'all! Welcome to CodeNewbie Podcast, our little corner of DEV in which we share weekly interviews with tech professionals to give you supportive advice to further your development career.

Last week we released our first episode of this season with @shawnbasquiat, all about the influx of AI's impact on job hunts, keeping an open mind, and reframing our scope for networking.

-----

_**PSSST**: If you'd like to listen, be my guest!_

- [Listen on Apple Podcasts](https://podcasts.apple.com/us/podcast/codenewbie/id919219256?i=1000649083149)

- [Listen on Spotify](https://open.spotify.com/episode/4MEwHLaYWY5AgP1sZ1VEAh?si=66ad80974e0a40c2&nd=1&dlsi=77a6348b190b4d0e)

- Listen right here on DEV:

{% podcast https://dev.to/codenewbie/s27e1-nurturing-relationships-for-ai-excellence-shawn-charles %}

-----

At the end of each episode we have four main questions we ask our guests. You'll have to tune in to hear the full answers, but in the meantime, I would love to hear y'alls responses to my favorite question in the roundup this week. 

**The question is: "What is the worst advice you've ever received?"**

Shawn shared with us that in his opinion, saying "I can't" when someone gives you advice is the worst. Not only does this hold back the conversation, but it fails at providing an opportunity for growth. He posits that instead of "I can't", we can instead ask the question "how can I?". 

---

**Let me know the worst advice you've ever received, I'd love to hear it. 🤪 Have a great rest of your day y'all!**

See ya tomorrow with our new episode as well.


![GIF of corgi with sunglasses on overlayed by a bunch of code.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/298qcjrgeneseab58jo9.gif)
Get $300 in AWS credits
Published: 2024-03-19 18:13:54

I just got $300 in AWS credits for my [side hustle](https://passlock.dev). It only took a couple of minutes to apply so don't miss out!

![AWS credit confirmation](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y15yuqyfdvsnq0pi5t1e.jpeg)

I actually received an email inviting me to apply, but I think you can apply directly [here](https://aws-experience.com/amer/smb/). Good luck!

## Other credits

If you’re working on a startup it’s worth applying to an accelerator as most will be able to get you $10,000 in AWS credits. Here in the UK I managed to get 10k from Barclays Eagle Labs for another gig I previously worked on.
Best Furniture Companies in Kerala
Published: 2024-03-19 18:06:21

Classy Furniture stands as one of the [best furniture companies in Kerala](https://classy.co.in/), offering a wide selection of high-quality furniture pieces crafted with excellence and attention to detail. With our diverse range of designs and commitment to customer satisfaction, we provide stylish and functional furniture solutions for every space, be it your home or office. Experience the difference with Classy Furniture and elevate your interior décor with our classy and timeless pieces. Shop now and discover why we're among the best furniture companies in Kerala, dedicated to delivering excellence in every aspect of our products and services.
Getting Started with llama.cpp on Linux! (Updated)
Tags: llm, llama, arch, guide
Published: 2024-03-19 17:58:06

## Introduction
llama.cpp is a wonderful project for running llms locally on your system. It is lightweight and provide state-of-the-art performance. It comes with GPU offloading support allowing you to use your GPU capabilities to run llms. 

I am personally using it for running llms on my arch system and I found it better than ollama in terms of performance, while trying to set this it up, I found their documentation confusing and there were no guides specifically for arch linux, that's why I decided to write an article after figuring things out.
So, lets gets started with it. 

## Guide

1. lets start by cloning the repo and cd into that

``` 
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
```

2. After that we need to build this, it can be done by using `make`, but like me if you have nvidia GPU then for using it to for offloading you will need to build it with cuBLAS and for that we need cuda toolkit, You can download it from your Linux distro's package manager. 
(e.g. `apt install nvidia-cuda-toolkit`)
here I am using aur helper, you can also install it manually.

```
paru -S cuda
```

now to build project with cuda run
```
make GGML_CUDA=1
```
Using `CMake`:
```
cmake -B build -DGGML_CUDA=ON
cmake --build build --config Release
```
It might take a while, after build is finished we can now finally run llms.

##How to use 
In llama.cpp folder you will find a executable named `llama-server` and `llama-cli`
which can be used to run the model
for cli mode just run
```
./llama-cli -m path-to-model -n no-of-tokens -ngl no-of-layers-to-offload-to-gpu
``` 
And for server run this
```
./llama-server -m path-to-model -n no-of-tokens -ngl no-of-layers-to-offload-to-gpu
``` 
You can now open your browser and in the URL section type http://localhost:8080/ and a web UI will appear.



![lamma web ui](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ihjjr8tmfkgk69jmdlj2.png)

Now you can have fun with your local llm.
Hope you will find this article helpful.
عالم الحياة البرية
Tags: webdev, javascript, beginners
Published: 2024-03-19 17:54:44

[سمك الريمورا,اسماك الريمورا,القرش وسمكة الريمورا,سر عدم مهاجمة أسماك القرش للغواصين.. ما علاقة البدلة؟,سمكة الريمورا التي تلتصق على القرش,سمك اسفل سمك القرش,مهاجمة أسماك القرش,مهاجمة أسماك القرش للغواصين,سر عدم مهاجمة أسماك القرش للغواصين,سمك القرش,ريمورا,سمك الرمورة,سمكة ريمورا,الاسماك,سمكة الريمورا,الريمورا](https://www.wildhub2.com/)