teleren/devto huggingface dataset:
How to survive GPT-3 as a developer —a quick guide
Tags: chatgpt, ai, developers, webdev
Published: 2023-02-03 01:59:28

So by now, the web is flooded with tutorials on how to use chatGPT for work, potential uses aside from work, ideas for researchers, and for almost anything we can imagine. Honestly, I feel as excited as I feel scared. This is creepy: _the thing_ (as I call it fondly), helped me today solve a few bugs much faster than my usual workflow would have allowed (Google » StackOverflow » check potential answers » understand » blatantly copy code samples that don’t work » tweak again » fix the typo » enjoy life for about 5 seconds).

And the best part is that it explained it to me. It taught me and I’m a better developer now thanks to _that thing_.

I’m scared, I admit it. Life is going to change in so many ways that people can’t even imagine. But let’s go back to being a developer, there’s time for prophecies later.

Our job used to be coveted. Overpaid? Yes, we developers are (were?) overpaid, and that’s in part because until now, few were capable of translating human language into machine instructions. So we learned about patterns, and learned about syntax, and did all those things because we like to overcomplicate things. And now, our job is in danger. Some say that translators and copywriters are the first to fall. I’d say it’s the developers: the thing is capable of producing impeccable prose, but it’s mostly soulless. It’s boring. Yes, you can feed it with better ideas, tweak it, and enhance it, but everything that I’ve read so far is boring and _machined_. It feels like used plastic in the hands, it lacks something. But code? Oh, dear. The thing can write code. It can identify patterns. It can write with perfect syntax, it can make you cry when you give it a challenge. It’s like seeing those prodigy children playing piano better than you will ever be able to play in your lifetime —and they are just 2 years old.

So how can we survive? I’d argue that, as usual, if all we learned was how to write code, we’re dead. But if we are able to understand the needs of our society, and of our fellow human beings, then we might be ahead. _The thing_ can make us stronger, more capable, albeit more dependent. It’s like the moment you are on an island, waiting to be rescued, and then a survival kit arrives, but it’s sealed, with those plastic seals that are impossible to open unless you have a knife. 

> We (developers) are not the survivor. We are the kit. We will become better developers and will be able to write applications much faster, but we will be more or less useless without the knife.

The good thing is that we can go back to the basics. We can go back to being humans and will rejoice at the opportunity to serve others with a humbled heart. We will reconnect with them, we will look them in the eyes, those who struggled to create a dynamic table, those who struggled with a software update; because now, we will all be equal.

**Equally dependent, maybe, but equally at last.**
Verifying My OpenPGP Key
Published: 2023-02-03 01:53:10

This is an OpenPGP proof that connects [my OpenPGP key](https://keyoxide.org/7B03D8A1D6B3D7A5129FB36C457BF5D69ECE0883) to [this dev.to account](https://dev.to/bonychops). For details check out https://keyoxide.org/guides/openpgp-proofs

[Verifying my OpenPGP key: openpgp4fpr:7B03D8A1D6B3D7A5129FB36C457BF5D69ECE0883]
Spark to Google Cloud Storage
Published: 2023-04-29 21:22:33

---
title: Spark to Google Cloud Storage
published: true
date: 2023-02-03 01:51:00 UTC
tags: 
canonical_url: https://mikestaszel.com/2023/02/02/spark-to-google.html
---

This is the last post in my series of how to connect Spark to various data sources.

Here is how to connect to Google Cloud Storage using Spark 3.x.

First, create a service account in GCP, then download the JSON key file. Save it somewhere secure (e.g. import it into Vault or Secrets Manager).

Grant that service account permission to read and write to the bucket.

Grab the Hadoop 3.x JAR (`gcs-connector-hadoop3-latest.jar`) from [Google](https://cloud.google.com/dataproc/docs/concepts/connectors/cloud-storage).

Place that JAR into Spark’s `jars` directory.

Finally, fire up a Spark shell (or PySpark as in this example), and run:

```
from pyspark.sql import SparkSession

spark = SparkSession.builder.getOrCreate()

spark.conf.set("google.cloud.auth.service.account.enable", "true")
spark.conf.set("google.cloud.auth.service.account.json.keyfile", "PATH-TO-JSON-KEYFILE.json")

df = spark.createDataFrame([{"num": x} for x in range (10000)])
df.write.mode("overwrite").parquet("gs://BUCKET-NAME/hello/")

```

That’s all there is to it.

This was a quick post mainly for myself if I ever need to come back to it.
Chaining in Javascript
Tags: javascript, webdev, beginners
Published: 2023-01-21 07:11:20

Chaining is a means of simplifying the process to map, filter, extrapolate or reduce the data in a effective and user friendly manner.

Being widely utilized in Javascript libraries in the early days with Jquery and Underscore.js, its usage even in the present highly benefits many modern Javascript Libraries and Frameworks like React,  Vue and Angular in making applications which are simple to design, keeping data abstract and code more modular.

Though the terminology might not be frequently used, one would have come across this to filter or map data sets. Backbone of Data Analytical and streaming applications is based out of this concept ( Eg: MapReduce in distributed file system processing)

One can build custom libraries based on its ease of implementing one using Javascript Objects. In fact all the inbuilt functions from Prototype Inheritance that Javascript Arrays and Objects provide is based out of Chaining. Example is as shown below

Snap a: Chaining process using Javascript Object
```
let chain = {
  result: 0,
  sum: function (param) {
    this.result = this.result + param;
    return this;
  },
  sub: function (param) {
    this.result = this.result - param;
    return this;
  },
  mul: function (param) {
    this.result = this.result * param;
    return this;
  },
  print: function () {
    console.log(`Result = ${this.result}`);
  },
};

chain.sum(5).mul(50).print();
```
Compare Hash Passwords Using Crypto Module using the Node.js [part 2]
Tags: node, javascript, beginners
Published: 2023-02-03 01:48:30

This article is a continuation of my previous article on [Hash Passwords Using Crypto Module using Node.js](https://dev.to/jobizil/hash-passwords-using-crypto-module-using-the-nodejs-part-1-4l01). This aims at teaching you how to convert crypto hash passwords into their original form using the Crypto Module.

In the previous article, we discussed how to hash passwords using the Crypto module in Node.js. In this article, we'll be discussing how to compare the hashed password with the original password.

From the previous article, we created a simple function that takes a password as input and returns its hashed version. Let's use this function to hash a password and store it in a variable.

    const crypto = require('crypto')
    const hashPassword = password => {
        return crypto.createHash('sha256').update(password).digest('hex')
    }
    const password = hashPassword('secret')
    console.log(password)

Compare Hash Passwords Using Crypto Module using the Node.js

    const hashedPassword = '2bb80d537b1da3e38bd30361aa855686bde0eacd7162fef6a25fe97bf527a25b'

    // Compare the hashed password with the original password


    const compareHashPassword = (password, hashedPassword) => {
        if (hashPassword(password) === hashedPassword) {
            return { success: true, message: 'Password matched' }
        }
        return { success: false, message: 'Password not matched' }
    }

    const result = compareHashPassword('secret', hashedPassword)
    console.log(result)

    // Output
    // { success: true, message: 'Password matched' }

In this article, we discussed how to compare the hashed password with the original password using the Crypto module in Node.js.

Note: This article is a continuation of my previous article on [Hash Passwords Using Crypto Module using Node.js](). This aims at teaching you how to convert crypto hash passwords into their original form using the Crypto Module and it is important to note that this is just a basic example of how to compare hashed passwords in a Node.js application using the crypto module.

You can find the previous article on [Hash Passwords Using Crypto Module using the Node.js](https://dev.to/jobizil/hash-passwords-using-crypto-module-using-the-nodejs-part-1-4l01) here.

If you enjoyed this article, you might also like:

- [Encrypting and decrypting data in nodejs using aes-256 algorithm](https://dev.to/jobizil/encrypt-and-decrypt-data-in-nodejs-using-aes-256-cbc-2l6d)
Hash Passwords Using Crypto Module using the Node.js [part 1]
Tags: javascript, node, beginners
Published: 2023-02-03 01:47:18

**This article aims at teaching you how to hash passwords into the database using the _crypto module_**

Password security is critical in any web application. Passwords must be encrypted and securely stored in a database so that they cannot be easily decrypted if the database is compromised. 

The use of hash functions is a common method of encrypting passwords.

In this article, we'll look at how to hash passwords in a Node.js and Express.js application using the Crypto module.

The crypto module, which is built into Node.js, provides various cryptographic functionalities, including the ability to hash passwords.

### Prerequisites

To follow along with this article, you'll need the following:

- Node.js installed on your computer. If you don't have Node.js installed, you can download it from the official Node.js website.
- A code editor. I'll be using Visual Studio Code.
- Basic knowledge of JavaScript and Node.js.

### Getting Started

Since the crypto module is built into Node.js, you don't need to install it. You can simply require it in your application.

I'll create a file called index.js and create a function that takes a password as input and returns its hashed version.

    const crypto = require('crypto')
    const hashPassword = password => {
        return crypto.createHash('sha256').update(password).digest('hex')
    }
    const password = hashPassword('secret')
    console.log(password)

In this function, we use crypto.createHash method to create a SHA-256 hash object. The update method is then used to add the password to the hash object, and the digest method is used to get the final hexadecimal representation of the hash.

To run the code above, open your terminal and locate the directory where your file is and run the command below:

    node index.js

We should have the hashed password printed in the terminal.

Note: It is important to note that this is just a basic example of how to hash passwords in a Node.js application using the Crypto module. In a real-world application, you would want to store hashed passwords in a database and use a more secure hashing method, such as bcrypt or scrypt. You should also use a salt to make the hashes more secure.

### Conclusion

In this article, we discussed how to hash passwords in Node.js using the Crypto module. We've also talked about some of the factors to consider when hashing passwords in a real-world application.

If you enjoyed this article, you might also like:

[Encrypting and decrypting data in nodejs using aes-256 algorithm](https://dev.to/jobizil/encrypt-and-decrypt-data-in-nodejs-using-aes-256-cbc-2l6d)


### Resources

- [Node.js Crypto Documentation](https://nodejs.org/api/crypto.html)
Reduce the cost of ChatGPT API in TronFAQ Bot
Tags: chatgpt, tron, api, blog
Published: 2023-02-03 01:19:36

ChatGPT-3 is made by OpenAI which partnerships with [Microsoft (Azure)](https://helloacm.com/welcome-pack-swag-from-microsoft-research-cambridge/)

ChatGPT Free Trial $18 that will expire at 1/April/2023.

![image.png](https://cdn.steemitimages.com/DQmRSMru62hKs5xoY2K6uHZxHF4nTZVAUcZAuQBXrLN2G35/image.png)

The Plus is coming soon with $20/month subscription
https://openai.com/blog/chatgpt-plus/

## Reduce the cost of API in TronFAQ Bot
1. Cached previous answers
2. One question per 60 seconds


![image.png](https://cdn.steemitimages.com/DQmVpmmwhQbEtjY9Ay7q7q41MNbGb5XzyDskiGrDzTeekny/image.png)

Command !ask to invoke the ChatGPT API in the Telegram Chat:
[Install the ChatGPT Bot](https://steemyy.com/bots.php)

<hr/>

### [Steem](https://steemyy.com) to the Moon!
You can swap the STEEM/SBD to USDT (TRC-20) via [Steem2USDT](https://steemyy.com/steem2usdt.php)
Explorando o keyword (this)
Tags: javascript
Published: 2023-01-27 15:35:27

No decorrer da criação de um código, conseguimos criar muitas funções e arrays. Muitas vezes, temos a necessidade execução, para analisar o funcionamento do que estamos criando, seja numa tela de celular, seja num console pelo navegador. Com isso poderíamos decidir o que queremos analisar,talvez um objeto, mas como dizer exatamente aquele? Existem outros diversos no seu código! Para isso, existe o `this`.

Em JavaScript, o `this` é um pouco diferente em comparação com outras linguagens. Refere-se a um objeto, mas depende de como ou onde está sendo invocado. Ele também tem algumas diferenças entre o strict mode(caso queira saber mais a respeito do strict mode, pode analisar o artigo:https://dev.to/altencirsilvajr/o-que-e-use-strict-a-variante-independente-do-javascript-g32) e o modo padrão. Por exemplo:




_Lista de formas que o this pode ser invocado:_

- **Quando chamado dentro de um método, ele se refere a um objeto**. 



```
let user = {
  name: "John",
  age: 30,

  sayHi() {
    // "this" no objeto
    alert(this.name);
  }

};

user.sayHi(); // John´
```

- **Sozinho, se refere a um objeto global. (em uma janela do navegador, o objeto global é o objeto window.**

-  **Em uma função, também a um objeto global. Exemplo:**


```
function myFunction() {
  return this;
}
```

- **No modo strict, ele é `undefined`**


-  **Em um event, se refere a um elemento que recebeu o this.**


-  **Em casos de métodos como: call(), apply() e bind() podem se referir a qualquer objeto.**

É possível também usar o `"bind"`, `"call"` ou `"apply"` para mudar o contexto de `"this"`. O "bind" cria uma nova função com o "this" definido, enquanto "call" e "apply" chamam a função imediatamente com "this" definido. Por exemplo:



```
let pessoa = {nome: 'João'};
let exibirNome = function() {console.log(this.nome)}.bind(pessoa);
exibirNome(); // Exibe "João"

```

Em resumo, "this" é uma palavra-chave importante no JavaScript, que se refere ao objeto que está sendo manipulado no momento, e sua referência pode variar dependendo do contexto. Aproveitando sua flexibilidade, é possível mudar seu contexto e evitar problemas de referência.
How Express.json() works....
Tags: express, webdev, productivity, deeplearning
Published: 2023-02-03 01:04:16

When a client sends a request to an Express.js server with JSON data, the express.json() middleware comes into play. Here's how the flow of data works in this case:

1.The client sends a request to the server with JSON data in the request body.

2.The Express.js server receives the request and passes it to the express.json() middleware.

3.The express.json() middleware reads the request body and parses it as JSON.

4.The parsed JSON data is then stored in the req.body property of the request object.

5.The request then moves on to the next middleware in the middleware chain, or to the relevant route handler, depending on the configuration of your Express.js application.

In the route handler, you can access the parsed JSON data by using req.body. For example, you could access individual properties of the JSON object like this: req.body.propertyName.

Finally, the route handler returns a response to the client, which typically includes information generated from the parsed JSON data.

In summary, the express.json() middleware parses incoming request data as JSON, makes it available as a JavaScript object in the req.body property, and makes it easy for the route handler to access and use the data.
How To Fix Docker Container DNS /Internet Issues
Tags: selfhosting, docker
Published: 2023-02-03 00:28:50

---
title: "How To Fix Docker Container DNS /Internet Issues"
published: true
description: "A simple fix for internet connection issues in Docker containers"
tags: ["selfhosting", "docker"]
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hjyka0z22rq0irvubni2.png
canonical_url: https://confidence.sh/blog/fix-docker-container-dns-internet-issues/
# Use a ratio of 100:42 for best results.
# published_at: 2023-02-03 01:28 +0000
---
Your Docker containers don't seem to have internet connection or can't resolve DNS queries?

TLDR; This issue is most likely due to the fact that your containers can’t resolve DNS queries using your host’s DNS servers (which may be unreachable from the containers). You can fix this in two ways:

- Globally for all Docker containers
- Locally for an individual container

## Fixing DNS Or Internet Issues Globally For All Docker Containers

Edit the Docker daemon configuration file at `/etc/docker/daemon.json` or create it if it doesn’t exist. Then, add new custom DNS servers:

```json
{
    "dns": ["8.8.8.8", "1.1.1.1"]
}
```

In this example, Google’s  `8.8.8.8` and Cloudflare’s `1.1.1.1` DNS servers will be used in place of the host’s DNS servers for *all* containers.

Save the file and restart the Docker daemon with:

```sh
sudo service docker restart
```

## Fixing DNS Or Internet Issues Locally For An Affected Container

If you’d only want to change the DNS server for a single container, you can directly add the new addresses to the container as shown below:

```json
yourcontainer:
    image: you/yourimage
		# regular container config...
    dns:
      - "8.8.8.8"
      - "1.1.1.1"
```

## Conclusion

This was a really straightforward fix and I hope this helps. If you’d love to learn more, check out this article by Robin [https://robinwinslow.uk/fix-docker-networking-dns](https://robinwinslow.uk/fix-docker-networking-dns)

Till we meet again, bye!
Work with Me
Tags: programming
Published: 2023-02-09 16:20:25

---
title: Work with Me
published: true
date: 2023-02-03 00:00:00 UTC
tags: programming
canonical_url: http://calebhearth.com/work-with-me
---

<p>I’m a developer, conference speaker and organizer, technical blogger, and mentor with over 11 years of experience in Ruby on Rails and Postgres. I’ve recently been learning iOS development with Swift and SwiftUI. Across my career I’ve also worked in Go and Node.js projects.</p>
<p>My career has been a split between consulting through well-known firms and product companies such as Heroku and Square.</p>
<p>In a recent project, I planned and implemented a modified Gale-Shapley algorithm / Deferred Acceptance Algorithm for matching hundreds of thousands of families with thousands of daycare providers in the State of Colorado, Multnomah County, and various other locales.</p>
<p>In the past, I’ve worked on a wide variety of projects. Here are a few highlights:</p>
<ul>
<li>Overhauling large systems</li>
<li>Consolidating services into monoliths</li>
<li>Finding performance improvements in Rails and Postgres SQL queries</li>
<li>Applying machine learning to optimize search systems</li>
</ul>
<p>I’m looking for fully remote, staff level or higher position where I can participate on a team as a mentor, take ownership of large projects, and deliver high quality code. I’m most happy when my work is clearly contributing good to the world. I’m not currently interested in working on anything blockchain or cryptocurrency related or projects with military or police applications.</p>
<p>Feel free to take a look at my <a href="https://calebhearth.com/Caleb-Hearth-Resume.pdf">Résumé</a>. You can also find me on <a href="https://www.linkedin.com/in/calebhearth/">LinkedIn</a>.</p>
<p>If you’re interested in working together, know of roles that could be a good fit, or would otherwise like to discuss this, please <a href="mailto:workwith@calebhearth.com">send me an email</a> and I’ll be happy to share my availability for a chat.</p>
Day 687 : Dead Battery
Tags: hiphop, code, coding, lifelongdev
Published: 2023-02-02 23:43:40

_liner notes_:
- Professional : Whew... what a day. Got up early to attend a meeting, then went back to sleep. haha Got up to attend a couple of more meetings. Double checked the updates I made yesterday and made a pull request to be reviewed and hopefully merged. Then I got a message about a ticket to check out. It was said to be a possible issue with a library, but I think it's more with how they are using it in a library because I was able to use Web Components and work properly. Hopefully going to try and get the user to switch over to using the Web Components. It'll be too difficult to try an keep up with all different frameworks, their updates and how to implement the library all the different ways. With Web Components, we just have to maintain the components and they work in all the different frameworks. So after banging my head against the wall trying to figure out their code, I just suggest the Web Components and gave a link to the working sample application. We'll see.

- Personal : Went through a bunch of tracks for the radio show and also paid my bills for the month. Think that was it. Then I went to sleep.

![A rocky river flowing through a forest in Abkhazia](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o1v6rimu8feu1hjyjw9y.jpg)

I think I got enough tracks for the next radio show and future shows. Going to put together sets of songs so that I'll just have to type them up and get the social media accounts tomorrow. Just noticed that it looks like the battery on my laptop is messed up. There was an update I think I did recently. It says that the battery is at 94% and charging, but if I unplug it, it turns off. Could be a dead battery. Too tired to worry about it. Going to eat and get started.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube 3rWL6ObYQN4 %}
Building "LinkedIn for the game industry"
Tags: gamedev
Published: 2023-02-02 23:38:24

10 months ago me our small team of 3 co-founders started building Semble.gg, a professional community and talent marketplace for game devs. The goal is to build "LinkedIn for the game industry".

It's a massive industry, with a lot of depth, which LinkedIn is less than great at addressing. Currently it's still very early days, with less than 1K game devs on the platform. But we're adding more each day, and it's always exciting to see what new arrivals are up to.

If you want to check us out, you can register for free at [Semble.gg](https://www.semble.gg/)

GG,
Team Semble