teleren/devto huggingface dataset:
Faker Gem in Ruby 💎💎
Published: 2023-02-13 14:29:39

Ruby is a dynamic object oriented programming language. It has an elegant yet simple syntax that is easy to use. In ruby, I was introduced to faker. Faker is a tool that allows us to generate as much fake data to test out methods. It is very easy to use and I will be demonstrating that for you right now. 

To begin using faker, you need to install the gem, which is simply done by running "gem install faker". You should see this message in the terminal:

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

After you do that, you should add "gem "faker"" to your gem file to ensure correct usage, otherwise you may get an error.

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

Once thats done you can head over to the seeding file and add require "faker" to the top of the page.

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

In the seeding file is where you would start to "fake" your data and we use the [faker library](https://github.com/faker-ruby/faker) to pick out random dummy data. Your going to start implementing the dummy data that you selected from the faker library, which should look like this

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

Once thats done you can check sqlite explorer to make sure that you correctly retrieved all the data that you pulled from the [faker library](https://github.com/faker-ruby/faker). Have fun and "fake it till you make it"!
Five Game-Changing 🎮 tips for Technical Blogging 💻✍️
Tags: tutorial, beginners, blogging
Published: 2023-02-13 14:28:33

Everyone can agree that reading a **giant** wall of text is **not** fun, and likewise reading a **ton** of code you don't understand can be harsh as well.  Let's spice up your next batch of posts with these **five simple tips**:

## 1. Use **lots** of pictures 📷
Most humans are _visual_, meaning that our eyes are first drawn to an _image_ rather than _text_.  Include a cover image in your post and also use images more frequently to separate your text into smaller, easier-to-read chunks.

Using animated GIFs can also turn in helpful, provide humor, and make your post a longer-lasting memory for the reader.

![a random gif](https://media.tenor.com/KN_iee4xqPQAAAAC/dancing-boy-cowboy.gif)

## 2. Bring on the **emojis** ⚡️😜🔥!
Similarly to how humans enjoy seeing images in long educational content, emojis can play a part as well.  Use them to spice up **titles**, **headings**, and **code comments** as well.

I'm not sure if y'all feel the same way, but I personally would be more likely to click on an article that utilizes emojis in its title than an article that uses plain text as its title.

Emojis, however, shouldn't be used **over-excessively** since they can make text harder to read.  A best practice would be suffixing **keywords** or **sentences** with them.

## 3. Make it funny 🤣
Funny things are the **easiest to remember**.  As stated above, use GIFs to spice up your post, and throw in a couple of jokes and funny acronyms.

## 4. Demos + Results 👊
If you're writing tutorial on a complex topic, put working examples, or demos in your post so users can track progress and see where they are.  Demos can range from screenshots to pens on [codepen](https://codepen.io).

## 5. Writing style ✍️🎨
Everyone has a unique and interesting writing style, and the goal in technical blogging is to be more engaging and keep people reading.

I have a pretty small list of things, but hopefully they'll turn in helpful.

### 1. Make the introduction paragraph interesting
This is the first thing the user will read.  Keep it short, impactful, and make them want to read more.

### 2. Space out paragraphs
Try to avoid using paragraphs consisting of more than 7 lines.  Large blocks of text tend to trigger intimidation and the feeling of "I don't want to read this"

### 3. **Accent** your **text**
I'm not sure if you've noticed, but I've been using a bunch of extra **bold** and _italic_ emphasized wording in this article.  Using emphasized words gives the impression of passion, and a small illusion of a real person talking.

### 4. ChatGPT rewording
There's no pain in asking ChatGPT to shorten and improve your grammar/wording.  This can improve your writing style by a massive amount.

---

Thanks for reading 🙏

I'm open to feedback! If you have any other tips or thoughts, share them in the comments below 👇

[🐱 Github](https://github.com/Conner1115) • [🦜 Twitter](https://twitter.com/IroncladDev) • [⠕ Replit](https://replit.com/@IroncladDev) • [🌐 Website](https://www.connerow.dev) • [✉️ Email](mailto:connerow1115@gmail.com)
Liman Eklentilerinde istenilen bilgilerin log olarak gönderilmesi
Tags: liman, log, eklenti
Published: 2023-02-13 12:54:00

Liman MYS'de sunucu detayları kısmında "**Erişim Kayıtları**" adında bir sekme bulunmaktadır. Bu tab o sunucuda çalıştırılan eklentilerde kullanılan fonksiyonların **log detayları**nı barındırır. Zaten hali hazırda birçok bilgi log detayında görülmektedir. 

Bazı durumlarda ekstra bilgileri loglamak isteyebiliriz. Böyle bir durumda tek yapmamız gereken bir fonksiyon kullanmaktır. Eklenti geliştirirken php fonksiyonlarını **app/Controllers** dizini altında oluşturduğumuz php dosyalarına yazarız. Burada yazdığımız **fonksiyonun** içerisinde aşağıdaki fonksiyonu çağırdığımızda Log detayı yukarıda bahsettiğimiz sekmede görünecektir. 

```php
sendLog(title,message,data);
```

Bu fonksiyon Liman'ın kendi içinde hazır bulunan bir fonksiyondur. Bu sebeple fonksiyonu çağırmamız yeterlidir. Örnek verecek olursak;

```php
sendLog("İsim","Kullanıcı ismi","Yakup");
```

dediğimizde İsim title'ına sahip log'da "Kullanıcı ismi" ve "Yakup" parametreleri görünecektir.
Making the Dummy Component
Tags: javascript, svelte, boxicons, css
Published: 2023-02-13 14:21:09

In the last part of this series, we made the Navbar component which returns a nav element that has reactive variables. So in this part, I will explain the Dummy component. You may be wondering why it's called a "Dummy"; this is because this component will return some style dummy text i.e (Lorem ipsum dolor...).

Let's get started!!!

First, make a file called 'Dummy.svelte' in the lib directory.
```bash
  touch Dummy.svelte
```

We are going to create two h3 elements that have some text inside them and style the elements.

**Dummy.svelte**
```html
  <h3>
    Lorem ipsum dolor sit amet consectetur adipisicing elit. Cum quia quas voluptate assumenda quae ipsum incidunt, temporibus ducimus molestias, atque sunt amet sequi distinctio enim nostrum dolorum, culpa deleniti animi!
  </h3>

  <h3>
    Lorem ipsum dolor sit, amet consectetur adipisicing elit. Nulla dolor architecto facere expedita amet ex eum. Odit magni repellendus consequatur beatae. Animi voluptates quo, accusamus consequuntur soluta deserunt eius iure?
  </h3>

  <style>
    h3 {
      padding: 0 20px;
      line-height: 1.3;
      font-family: 'Trebuchet MS';
      z-index: 0;
      position: relative;
    }
  </style>
```

Notice that the h3 has a CSS z-index property of '0' and a position of 'relative'. In the [Navbar component](https://dev.to/michthebrandofficial/making-the-navbar-component-945) we set the z-index of the 'nav.nav-bar' element to 1. We did this so that the  nav element will stay on top of the dummy text when it appears. To better understand what I mean, here's a link to the [CSS z-index property](https://css-tricks.com/almanac/properties/z/z-index/). 

***Tip for VSCode users: type 'lorem' and hit tab to give you some dummy text. Powered by Emmet.***

To test this in the browser, we will render the component we just made. Let's go into App.svelte and import 'Dummy', declare and import some styles in App.css. 

**App.svelte**
```svelte
  <script>
    import Dummy from './lib/Dummy.svelte';
  </script>

  <style>
    main {
      padding: 5px;
    }
  </style>

  <main>
    <Dummy />
  </main>
```
Notice that we did not declare any exports in the 'Dummy.svelte' file, that is just how svelte works.

**App.css**
```css 
  body {
    background-color: #000;
    color: whitesmoke;
  }
```

**main.js**
```javascript
  import App from './App.svelte';
  import './App.css';

  const app = new App({
    target: document.body
  });

  export default app;
```

So, we have just made the main element have a padding of 5px to give some space from the sides. Type in the terminal:
```bash
  npm run dev
```

Click on the 'localhost:5173/' to see it in your browser.

![Dummy text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s0f1efl8wp6wkdd45jf5.png)

That is it for the Dummy component, in the next part we will  import the Navbar component into App.svelte and finish up the navigation bar.

Thank you for reading and stay tuned for the next part.
Paracetamol.ts💊| #10: Explica este código TypeScript
Tags: typescript, spanish, webdev, programming
Published: 2023-02-13 14:20:35

## **<center>Explica este código TypeScript</center>**
#### <center>**Dificultad:** <mark>Básico</mark> </center>


```ts
const fn = (name?:string, edad:number) => {
  return `${name} - ${edad}`
}

console.log(fn("Carlos", 25))
console.log(fn(25))
```

A. `Carlos - 25`, `undefined - 25`
B. `Carlos - 25`, `25 - undefined`
C. `Carlos - 25`, `TypeError`
D. `Carlos - 25`, `undefined - undefined`

Respuesta en el primer comentario.

---
Listado de páginas para programador y diseñador freelance que están buscando trabajo 🥳
Tags: programming, developer, designer, programmer
Published: 2023-02-13 14:06:54

- Torre: https://torre.co/
- Fiverr: https://www.fiverr.com/
- Indeed: https://ar.indeed.com/
- Upwork: https://www.upwork.com/
- Workana: https://www.workana.com/
- Talently: https://talently.tech/
Unleash the Power of Apache FOP: A Beginner's Guide to Creating PDFs Like a Pro!
Published: 2023-02-13 14:04:38

---
title: Unleash the Power of Apache FOP: A Beginner's Guide to Creating PDFs Like a Pro!
published: true
description: In this video we create a invoice template that looks alot like an invoice from one of my first videos. We will go through all the different parts of a invoice that is required and how to go from a data XML to an PDF.
tags:
cover_image: https://i.ytimg.com/vi/7JIyk_CEvUg/maxresdefault.jpg
---

{% youtube 7JIyk_CEvUg %}

In this video we create a invoice template that looks alot like an invoice from one of my first videos. We will go through all the different parts of a invoice that is required and how to go from a data XML to an PDF.
💎 How to use the Ruby Faker Gem 💎
Tags: ruby, beginners, programming
Published: 2023-02-13 14:00:53

What is the Ruby Faker Gem? It's a handy little tool that allows you to be able to easily create as much dummy data as you need to test out your methods. You can use this blog as a beginners guide to using Faker!


To start, add the faker gem to your project by running "gem install faker" in your project terminal. 

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

Be sure to check that your Gemfile has a line for the faker gem (i.e. `gem "faker"`). If it doesn't, be sure to add it.


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

Add "require 'faker'" to the top of your seeds.rb file:

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

From here, you can use the [handy dandy faker documentation](https://github.com/faker-ruby/faker) to guide you through creating your data. 

Here's how I set up data using Faker for a table called "Chefs":

In my Chefs table, I have 3 fields: `first_name`, `last_name`, and `current_restaurant`. 

To get a Faker generated `first_name`, I checked the [documentation](https://github.com/faker-ruby/faker), found the "Name" category, and saw there was an option to generate a first name: `Faker::Name.first_name`. You can do pretty much the same thing to generate a last name by using: `Faker:: Name.last_name`.

Finally, for `current_restaurant` I searched the documentation and found there is a Faker category for Restaurant! I go ahead and use `Faker::Restaurant.name` for the `current_restaurant` field:

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

From here, you can seed your data like you normally would (`rake db:seed`). Once your data is done seeding, you'll see randomly generated first names, last names, and current restaurants in your database:


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

Pretty nifty!
Getting Started with HTML: Your First Steps towards Building a Website #1
Tags: html, webdev, devops, learn
Published: 2023-02-13 14:00:00

HTML (Hypertext Markup Language) is the standard language used to create web pages. It's the foundation upon which all websites are built. In this article, we will explore how to create your first HTML page from scratch.

Getting Started with HTML:

1. Choose a text editor: Before you can start writing HTML, you need a text editor. There are many free text editors available such as Notepad++, Sublime Text, or Visual Studio Code.
2. Start with the basic structure: Every HTML page starts with a basic structure that includes the following elements:

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

`The <!DOCTYPE html> declaration defines the version of HTML being used.
The <html> element is the root element of the page and contains all other elements.
The <head> element contains information about the document, such as the title that is displayed in the browser tab.
The <body> element contains all the visible content of the page.
Add some content: Now that you have the basic structure in place, you can start adding content to the page. For example:`

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

`The <h1> element defines a heading, and the <p> element defines a paragraph.`

Save and preview: Save the file with an .html extension and preview it in a web browser to see your first HTML page.
That's the basic process for creating an HTML page. From here, you can continue to add more elements and styles to make your page look exactly how you want it.

Learning HTML:

1. Read a beginner's guide: There are many resources available online that can help you learn HTML from scratch. Start with a beginner's guide to get a good understanding of the basics.

2. Practice, practice, practice: The best way to learn HTML is to practice writing code. Create new pages and experiment with different elements and styles.

3. Use online tutorials: There are many online tutorials and courses available that can help you learn HTML in depth. You can also find tutorials on specific topics such as creating forms, adding images, or working with CSS.

4. Keep learning: HTML is constantly evolving, and new features are being added all the time. Stay up to date with the latest developments by reading articles and following industry leaders on social media.

In conclusion, HTML is a fundamental technology for creating websites, and learning it is a valuable skill for anyone looking to build their own website or work in the tech industry. With a text editor, a beginner's guide, and some practice, you can create your first HTML page in no time. And from there, the possibilities are endless!
Escape the Wave, Week Two Development Update
Tags: programming, opensource, gamedev, news
Published: 2023-02-13 14:00:00

It's the second week of development for the game "[Escape the Wave](https://github.com/EmilienLeroy/EscapeTheWave)" and this week was focused on creating the base mob for the game. The goal of the game is to escape the waves of enemies that come at you, and this week was dedicated to creating the foundation for these enemies.

## Creating the Base Mob

The first step in creating the base mob was to create a simple red square with some health. This square will serve as the foundation for all future mobs in the game. When a bullet from the player hits the mob, it will lose some health, and when its health reaches zero, it will be removed from the game. This basic mechanic sets the foundation for creating more complex and challenging enemies in the future.

![mob](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9npq4pvb8msm2jhtf1c0.gif)

## Adding the Pathfinding System

The next step was to work on the pathfinding system for the mobs. This system allows the mobs to follow the player, making the game more challenging and engaging. Currently, an old method is used to find the path to the player, which works with a tileset. However, in a future version, this pathfinding system will be improved using the new navigation system in Godot. This will make the pathfinding more sophisticated and accurate, providing a better gaming experience for the player.

![path](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h9cid60ffmfcqa6dw522.gif)

## Adding the Player Score System

Finally, the player score system was added to the game. Now, when an enemy is killed, the player will earn points towards their score. This score system is simple for now, but it will be improved in the coming weeks to make the game even more engaging and rewarding.

![score](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/crjspe4x4j00xi1464je.gif)

In conclusion, this week was a productive one for the development of Escape the Wave. The base mob was created, the pathfinding system was improved, and the player score system was added, providing a solid foundation for creating more challenging enemies and a more engaging gaming experience.
My experiences with Ambassador programs
Tags: webdev, javascript, opensource, programming
Published: 2023-02-13 13:57:37

When I first heard the term `Ambassador` I was instantly interested into learning more about it. How does it work, what do you get from it, how you can become one, and more questions were running through my head.

Currently, I am an active ambassador of three organizations and I have also participated in creation of Ambassador programs from scratch.

In this article, I would like to share with you my experiences with them so that you can verify whether this would be something for you.

## My story

My road to becoming an ambassador started from Storyblok Headless CMS. I have worked with this tool for some time back then, written few articles, and created few smaller development projects with it. I also spoked at the Vue.js Live conference about it. So, I have contacted Storyblok's Ambassador Program form to see if I am eliglible to get the title of an Ambassador. And they accepted it ;)


![Vue.js Live talk](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/804un9kc9h9g5b6dhd6p.png)

Since then, I have created even more content about this product that is becoming more and more popular over time. Storyblok Dev Rel team is investing much more nowadays to the Ambassador program to allow ambassadors to grow and that is also why I recommend you to try it out :)

![Discussing about VSF Vendure Storyblok](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cwjcpro8kv54habqesk1.png)

After Storyblok, I was working on a Algolia module for Nuxt 3. There was no module like this before so I decided to create one from scratch and I am maintaining it until today. Because Algolia company is not that active in Vue community, they decided to make me an Ambassador of their brand so that I could represent Algolia in Vue & Nuxt communities. Since then I was creating developer content and I have also conducted few conference talks about Algolia as well.

![Nuxt Algolia](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zjrbmq53nyw26rf6l1sa.png)

After that, I contributed a lot into Nuxt ecosystem in terms of other modules, articles, videos and conference talks so the guys decided to make me an ambassador.

In summary, I would say that becoming an Ambassador for each of these organizations was something like an award for my contribution to their ecosystems which allows me to grow as well.

## Should you become an Ambassador?

I would say yes! If you enjoy working with certain project/product start creating content about it. You will find more interesting use cases that will require you to learn new approaches and concepts.

Sooner or later, you will be able to contact the organization to talk about your contribution. Or they will contact you directly. My point is that if you like to create developer content you are basically one step closer to becoming an ambassador. And this opens a lot of doors in terms of contacting right people, funds for attending conferences, channel sponsorships and many more!
Using BaaS with custom Backend
Tags: help, webdev, svelte
Published: 2023-02-13 13:54:45

Let me preface this by saying that I have little experience with Authentication on the front-end side, as my professional work is mostly backend/cloud or has authentication already set up so I rarely have to deal with setting up an authentication flow from front- to backend myself.
However, I wanted to expand my knowledge on this, and looked up a few modern solutions for authentication solutions in the frontend - this is where I am a bit confused and could use some guidance.
From my research, it looks like a lot of project are using BaaS like Firebase or Supabase, which looks very promising for the type of side-project I am planning to do. Unfortunately it looks like the platform are (more or less) strictly BaaS, where you would write you backend logic using either SSR or with serverless functions on each respective platform. I understand the appeal of this - and I thinks it's quite a clean approach - but it not something I would like to do for my current project, as I have quite a perfectly working API written in Rust which I'd like to use as part of this project.

So my question would be: 

What would be a clean, modern approach for perform frontend authentication? I am using Svelte for my frontend, and I've taken a look at NextAuth.js. But as this is still im Beta, there must be some better options available as well, right?

Is it possible to use a platform like Supabase to only perform Authentication, i.e. provide the frontend which credentials, which can then be used in my own, custom backend? Or are people usually only using these service as part of a "full-stack" application with SSR - in contrast to a more traditional approach with a custom backend.

Any tips/help would be appreciated, thanks!