teleren/devto huggingface dataset:
Bad code or No code, which is the lesser evil?
Tags: jokes, cleancode, discuss
Published: 2022-12-10 14:20:39



![cartoon removing bad code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/32ay3n612egye8oo292c.jpeg)

"If you are not embarrassed by the first version of your product, you’ve launched too late.”

And when a bad code comes out of a good intention, it is called a **Necessary Evil**.

---

"Just as George Lucas said,
>“Movies are never finished, only abandoned."

…the same goes for software.

---

There will always be incremental improvements, new technologies, unexpected problems, competitive challenges, and other excuses to keep working on your code.

|

### LET'S KEEP WRITING!

---
###### _...what's your thought on this?_
Advent of Code Day 9
Tags: adventofcode, elixir
Published: 2022-12-10 14:19:59

### Links

- [Intro](https://dev.to/sethcalebweeks/advent-of-code-2022-in-elixir-34i8)
- [Problem Statement](https://adventofcode.com/2022/day/9)
- [Code](https://github.com/sethcalebweeks/advent-of-code-2022/blob/main/lib/Day09.ex)

### Highlights

- So... I got stuck. I didn't think it was possible for any knot to be a full diagonal away from the preceding knot, but I was wrong. I had to reach out on Reddit to ask for help.
- Other than that, I'm pretty okay with my code. I used `map_reduce` for the first time, and it was the perfect tool for the job.

```elixir
defmodule Day09 do
  use AOC

  def step("R"), do: {1, 0}
  def step("L"), do: {-1, 0}
  def step("U"), do: {0, 1}
  def step("D"), do: {0, -1}

  def new_tail({head_x, head_y}, {tail_x, tail_y}) do
     case {tail_x - head_x, tail_y - head_y} do
      {-2, -2} -> {head_x - 1, head_y - 1}
      {-2, 2} -> {head_x - 1, head_y + 1}
      {2, -2} -> {head_x + 1, head_y - 1}
      {2, 2} -> {head_x + 1, head_y + 1}
      {-2, _} -> {head_x - 1, head_y}
      {2, _} -> {head_x + 1, head_y}
      {_, -2} -> {head_x, head_y - 1}
      {_, 2} -> {head_x, head_y + 1}
      _ -> {tail_x, tail_y}
     end
  end

  def part1 do
    input(9)
    |> String.split("\n")
    |> Enum.reduce({{0, 0}, {0, 0}, []}, fn motions, state ->
      [direction, steps] = String.split(motions)
      make_move_1(step(direction), String.to_integer(steps), state)
    end)
    |> elem(2)
    |> Enum.uniq
    |> Enum.count
  end

  def make_move_1({step_x, step_y}, move, state) do
    Enum.reduce(1..move, state, fn _, {{head_x, head_y}, tail, tail_positions} ->
      new_head = {head_x + step_x, head_y + step_y}
      new_tail = new_tail(new_head, tail)
      {new_head, new_tail, [new_tail | tail_positions]}
    end)
  end

  def part2 do
    input(9)
    |> String.split("\n", trim: true)
    |> Enum.reduce({[], (for _ <- 1..10, do: {0, 0})}, fn motions, state ->
      [direction, steps] = String.split(motions)
      make_move_2(step(direction), String.to_integer(steps), state)
    end)
    |> elem(0)
    |> Enum.uniq
    |> Enum.count
  end

  def make_move_2({step_x, step_y}, move, state) do
    Enum.reduce(1..move, state, fn _, {tail_positions, [{head_x, head_y} | knots]} ->
      new_head = {head_x + step_x, head_y + step_y}
      {new_knots, new_tail} = Enum.map_reduce(knots, new_head, fn knot, last_knot ->
        new_knot = new_tail(last_knot, knot)
        {new_knot, new_knot}
      end)
      {[new_tail | tail_positions], [new_head | new_knots]}
    end)
  end

end
```
A strategic approach to Internet marketing
Published: 2022-12-10 14:19:02

To realise the benefits of Internet marketing that we have described, an organization needs to develop a planned, structured approach. As we will see in Chapter 4, which covers Internet marketing strategy, there are many risks if an ad-hoc rather than strategic approach to managing online channels is used. Some of the problems that we have commonly seen in organizations are:

Unclear responsibilities for the many different Internet marketing activities shown in Figure 1;

No specific objectives are set for Internet marketing;
Insufficient budget is allocated for Internet marketing as customer demand for online services is underestimated and competitors potentially gain market share through superior online activities;

Budget is wasted as different parts of an organization experiment with using different tools or suppliers without achieving economies of scale;

New online value propositions for customers are not developed since the Internet is treated as ‘just another channel to market’ without review of opportunities to offer improved, differentiated online services;

Results from digital marketing are not measured or reviewed adequately, so actions cannot be taken to improve effectiveness;
an experimental rather than planned approach is taken to using e-communications with poor integration between online and offline marketing communications.

Consequently, this book defines a strategic approach to Internet marketing which is intended to manage these risks and deliver the opportunities available from online channels. In Figure 1.9 we suggest a process for developing and implementing an Internet marketing which is based on our experience of strategy definition in a wide range of companies.


**Conclusion**

This diagram highlights the key activities and their dependencies which are involved for creation of a typical Internet marketing. The purpose of strategic Internet marketing activities and the main point at which these topics are covered in this book are as follows:

Read Trending News At- <a href="https://webstoryhunt.com/">WebStoryHunt</a>And <a href="https://theinctimes.com/">TheINCTimes</a>
I created my own custom blog, Does it cool?
Tags: webdev, javascript, news, testing
Published: 2022-12-10 14:13:19

About a week ago, I was fascinated by the thought that why not create my custom own blog and share about tech news and stuff, So i did. Here's how I did it.

## First things first.
I've built this whole custom blog on HTML, CSS and Javascript. And used a free template for frontend.

## The Design
I followed a design similar to a wordpress blog named TechCrunch and it goes like this.

`Blog/index.html -> main page`
`Blog/2022/12/ -> all blogs which published in Dec 2022.`


![Tech Crunch URL Structirt](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uq80wvk6hwgh4b805kl7.jpg)

For doing something like this, I've created a master folder in the root to store css and javascript files. And all HTML files will be blogs and I will have to be replicated.

I know this may sound a little tricky so see the screenshot below.

![Blog Structure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ncbnpnthtnbdhadj9o3x.jpg)

So each blog HTML will get it's css and js files from assets folder. That's it how it's done. And the custom blog is ready.

---

Each time I do have to publish a blog I'll duplicate the old one and then edit the Title, Meta Description, Image, And Content Inside it. It takes a few minutes to do it.

And then push it to github and it is published. And the next step is to goto google search console and request indexing of my new blog's URL.

## How Do I Write A Blog?
First I get the idea (Of course) and then I write my blog in  Markdown using any online tool (Not decided which to use for permanent) and then I convert that Markdown into HTML using [this ](https://markdowntohtml.com/)tool.

And then I replace it with the content in HTML and then time to post.

> I didn't create any panel like in Dev.to just edit and post it.

How is it?
Oh the link of [blog is here](https://anasdew.tech/blog), check out and comment here if you got any feedbacks.

## 🎈 Thanks for reading...

Follow me if you're interested in web dev and about tech stuff and interesting projects. 

This weekend I'm going to build a google clone. And I'll share about this only on Devto. So follow me to not MISS OUT!
Testando routes em RSpec Rails
Tags: rails, rspec, testing
Published: 2022-12-10 14:01:17

Bem, eu estava pensando que realmente vale a pena fazer esse post, tipo, é algo tão simples, mas tão simples que basta eu mostrar o código que você já entenderia o que está acontecendo.

Mas um certo alguém falou, "Melhor um código testado, por mais que seja bobo", e concordo com ele, vai que acontece algo imprevisível por esse motivo bobo?

Mas eu só vou mostrar o código e explicar o que esse código faz e pronto, só isso, porque não tem muito explicar, se você não entendeu, então prova que está faltando conhecimento em rotas em rails.

Se você quer saber mais de rotas, basta ler a documentação oficial do rails que tem português, aqui está o link, [Rotas do Rails de Fora pra Dentro
] (https://guiarails.com.br/routing.html)

Bem, aqui está o código.

```ruby
require "rails_helper"

RSpec.describe "rotas para Produtos", :type => :routing do
  let(:produto) { Produto.create(name: "colar") }

  it "rotas /produtos para action index de controller Produtos" do
    expect(get("/produtos")).
      to route_to(:controller => "produtos", :action => "index")
  end

  it "rotas /produtos/:id para action show de controller Produtos" do
    expect(get("/produtos/#{produto.id}")).
      to route_to(:controller => "produtos", :action => "show", id: produto.id)
  end

  it "rotas /produtos/new para action new de controller Produtos" do
    expect(get("/produtos/new")).
      to route_to(:controller => "produtos", :action => "new")
  end

  it "rotas /produtos/:id/edit para action edit de controller Produtos" do
    expect(get("/produtos/#{produto.id}/edit")).
      to route_to(:controller => "produtos", :action => "edit", id: produto.id)
  end

  it "rotas /produtos para action create de controller Produtos" do
    expect(post("/produtos")).
      to route_to(:controller => "produtos", :action => "create")
  end

  it "rotas /produtos para action update de controller Produtos" do
    expect(put("/produtos/#{produto.id}")).
      to route_to(:controller => "produtos", :action => "update", id: produto.id)
  end

  it "rotas /produtos para action delete de controller Produtos" do
    expect(delete("/produtos/#{produto.id}")).
      to route_to(:controller => "produtos", :action => "destroy", id: produto.id)
  end
end
```

Bem, como que eu explico isso.

Serio, eu não sei como que explicar algo obvio.

Eu vou acabar aqui, justamente por isso, então se tiver algumas dúvidas, pode colocar no cometário, que eu vou responder e quem sabe eu coloco a resposta nessa postagem.

Então é isso, tchau!
How to find IP Address on Windows, macOS and Linux
Tags: beginners, linux, cloud
Published: 2022-12-10 13:52:21

## How to check IP address on Linux

Go find Terminal or Command Prompt on menu. Alternatively you can hit Ctrl + Alt + T on keyboard at the same time
Type in ifconfig
Your IP Address information will show up.
This post explains more about [how to check ip address in Linux](https://www.howtouselinux.com/post/check-ip-address-in-linux).

## How to check IP address on Windows

Right click on Wifi icon (located on bottom left of the screen), and then choose Open Network and Sharing Center

You will see a new Network and Sharing Center dialog page, double click on current connection. See picture bellow.
Wi-Fi Status page will show up, click on Details.

Your IP Address are listed on IPv4 Address Property row.

[This post](https://support.microsoft.com/en-us/windows/find-your-ip-address-in-windows-f21a9bbc-c582-55cd-35e0-73431160a1b9) explains more.

## How to check IP address on macOS

Go right click on Apple logo (located on top left of the screen), then click on System Preferences

On System Preferences, click on Network icon.

On Network page, click on connected menu on left side of the dialog page, connected interface has green-dot-mark.
Click on Advanced (located on bottom right of the dialog box)
Find TCP-IP tab on the top row. see picture bellow.

Your IP Address are listed on IPv4 Address Property row.
Using Git for version control in software development
Published: 2022-12-10 13:47:41

Git is a popular version control system that is widely used in the software development process. It allows developers to track and manage changes to their codebase over time, making it easier to collaborate on projects and maintain a history of their work.

What is Git version control?
To use Git, developers first need to initialize a local repository on their own computer. This is done using the git init command, which creates a new directory where all the files and changes will be tracked. The repository can then be linked to a remote repository, such as one hosted on GitHub, using the git remote add command.

Using Git for collaboration in software development
Once the local repository is set up, developers can begin adding files to it using the git add command. This stages the files for commit, meaning they are ready to be saved to the repository. Developers can then use the git commit command to save the staged files to the repository, along with a message describing the changes that were made.

Git also allows developers to create branches, which are separate lines of development that can be worked on concurrently. This is useful for implementing new features or experimenting with different approaches to a problem without affecting the main codebase. To create a new branch, developers can use the git branch command, and then use the git checkout command to switch between branches.

Git also provides a number of tools for collaborating with other developers. For example, the git clone command allows developers to create a local copy of a remote repository, and the git push and git pull commands can be used to synchronize changes between the local and remote repositories. This makes it easy for multiple developers to work on the same codebase and share their changes with each other.

Conclusion
Overall, Git is an essential tool for managing the software development process. It allows developers to track and manage changes to their codebase, collaborate with others, and maintain a history of their work. By using Git, developers can work more efficiently and effectively, and can ensure that their projects are well-organized and easy to maintain.
How to render markdown in terminal using pandoc
Published: 2022-12-10 13:31:18

To render a markdown file through the terminal, you can use the pandoc command to convert the markdown file into a format that can be easily displayed by the terminal, such as HTML or ANSI. For example, if you want to convert a file called file.md to HTML and display the result in your browser, you can use the following command:

Before that do:

``sudo apt install pandoc``

later

``pandoc -o file.html file.md && xdg-open file.html``


To list in markdown do:

``pandoc -t asciidoc file.md | cat``

Here is a list of other possibilities that pandoc can offer.

``pandoc --list-output-formats``

<br />

[![Texto alternativo da imagem](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ds4alkts3uxq0dsco0nv.png))](https://www.linkedin.com/in/israel-lopes-419a32189)
Learn Test Driven Development with Django - Part 8 Create a User SignUp Form
Tags: django, tdd, testing, webdev
Published: 2022-12-10 13:30:56

In this video, I show you how to use a test-driven approach with Django's UserCreationForm to create a user sign up form. I then demonstrate how to use Django's built-in testing tools to write tests for your user sign up form, including tests for form validation and form submission. I show you how to use the UserCreationForm in your tests and how to ensure that your form is working correctly. 
{%youtube 0oCceBUaTiY%}
On-premise vs Managed IT Services
Tags: cloud, productivity, devops, operations
Published: 2022-12-10 13:14:23

[facebook.com/Trinwhocode](https://facebook.com/Trinwhocode)

As the use of technology continues to expand in government operations, it is crucial that certain types of data and information be protected. While it may be tempting for government agencies to implement their own chat servers or other systems, it is important to evaluate whether or not these are truly necessary and worth the resources required to maintain them.

Here are five types of data and information that should be protected in the government:

1. Confidential and sensitive information – This includes classified documents, personal information, and other data that should not be publicly available.

2. Intellectual property – Government agencies often develop and use unique technology, software, and other intellectual property that should be protected from unauthorized use or access.

3. Critical infrastructure data – This includes information about the infrastructure that is essential to the functioning of government agencies, such as power grids, transportation systems, and communication networks.

4. Financial information – Government agencies handle large amounts of financial data, including budget information, contracts, and other sensitive financial information that should be protected.

5. National security information – This includes information related to the security of the nation, including military operations, intelligence, and other sensitive data.

While it may be tempting to implement new chat servers or other systems in order to protect this data, it is important to consider whether or not these systems are truly necessary. Many popular messaging platforms, such as Viber, Messenger, WhatsApp, Gmail, and Google Workplace, already have robust security measures in place and are widely used in government operations.

Furthermore, implementing and maintaining new systems can be costly and time-consuming. Instead of reinventing the wheel, government agencies should evaluate their current systems and prioritize the efficient use of resources. In many cases, utilizing existing systems that are already working well may be the most effective and cost-efficient approach.

[linkedin.com/in/trinmar/](https://www.linkedin.com/in/trinmar/)
Why should developers join a game jam?
Tags: gamejam
Published: 2022-12-10 13:07:11

---
title: Why should developers join a game jam?
published: true
description: 
tags: gamejam
cover_image: https://img.itch.zone/aW1hZ2UyL2phbS8zMTY3NTQvMTA3MTUxOTIucG5n/original/KzXcNZ.png
# Use a ratio of 100:42 for best results.
# published_at: 2022-12-10 13:02 +0000
---

I asked ChatGTP why developers should join a game jam. It knows what's up!

I'll leave it's answer below, but if you have ever wanted to try making a game then there's a great Jam coming up January 20-23.

[The 3rd annual Coding Blocks Game Jam](https://itch.io/jam/coding-blocks-j-j-j-jamuary)

Check out the games from last year for some inspiration!
{% youtube 7Ub5wcvFO2U %}

## ChatGPT's Answer
There are several reasons why developers might want to join a game jam. First and foremost, a game jam is an event where developers come together to create games within a short period of time, typically over the course of a weekend. This can be a great opportunity for developers to push themselves to think creatively and work quickly, as well as to learn new skills and techniques.

Another reason why developers might want to join a game jam is that it can be a great way to interact with other developers. During a game jam, developers have the chance to collaborate with others, exchange ideas, and learn from one another. This can be a valuable opportunity for developers to network and learn from their peers, as well as to gain exposure for their work.

Finally, participating in a game jam can be a fun and enjoyable experience in itself. It can be a great way to take a break from the daily grind of work and to do something different and challenging. Additionally, many game jams have a friendly and supportive atmosphere, which can make the experience even more enjoyable.

Overall, participating in a game jam can be a fun and inspiring experience for developers. It can provide an opportunity to learn new skills, interact with other developers, and challenge themselves in a creative and enjoyable way.
HTTPS protocol and data encryption
Tags: https, browser
Published: 2022-12-10 13:06:18

It is known, that 

In HTTPS, the communication protocol is encrypted using Transport Layer Security (TLS) or, formerly, Secure Sockets Layer (SSL)

My question is - having a simple `html` login form hosted on the `HTTPS` enabled server when the user enters the address starting `https://` i'm i right that the browser automatically encrypts the login data (login and password) thus allowing for a secure communication (the browser sees the `HTTPS` as a protocol and understands that the data send HAVE to be encrypted)?

Thx for explanation.
SaveGPT: Auto-save your ChatGPT conversations
Tags: chatgpt, browserextension, chrome, firefox
Published: 2022-12-10 12:59:31

---
title: SaveGPT: Auto-save your ChatGPT conversations
published: true
description: 
tags: chatgpt, browserextension, chrome, firefox
# cover_image: https://i.ytimg.com/vi_webp/B1lhcUoqxXo/maxresdefault.webp
# Use a ratio of 100:42 for best results.
# published_at: 2022-12-10 12:50 +0000
---

📣 SaveGPT 📣

💡 How would you like to have your ChatGPT conversations saved? Introducing [SaveGPT](https://savegpt.com), a browser extension for ChatGPT users. It automatically saves your ChatGPT conversations in real time. It's incredibly easy to use - just click the "Chat History" button on the ChatGPT website to access your saved conversations. 

👨‍💻 Here's a quick demo -

{% embed https://www.youtube.com/watch?v=B1lhcUoqxXo %}


⬇️ So whether you're planning to write a movie script, create a new app, or just have the usual wild conversations with ChatGPT; SaveGPT has you covered. Download SaveGPT from the website or the Chrome Web Store, and stay tuned for the upcoming Firefox addon. Let me know what you think!

🔗 [Link](https://chrome.google.com/webstore/detail/savegpt/openekjijmgjlhodnlbofmbmhhcogdli) to the chrome webstore.