teleren/devto huggingface dataset:
My first properly planned python project
Tags: beginners, python, codecademy, oop
Published: 2023-03-17 13:28:32

[Link to GitHub](https://github.com/Emile317/tic-tac-toe)

Why did I do this project?
Well, it's part of the Codecademy CS course. But it's interesting because, while this is not my first project in python, it is the first one that I made a proper planning for. I did this by lining out how the program was going to look and what features it was going to have.
While doing the coding, I still had the urge to implement all kinds of features that I hadn't planned, but I stayed true to my planning and saved those for the next git commit.

![GIF preview of the project](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xi1w5fw8hb9qjq3eu56h.gif)
(Sped up a bit so it could be a GIF)

Right before this project, I had learned all about object oriented programming thanks to Codecademy. I could really see this coming back in the code, as it is made up of mostly classes, functions and outside of that just a few lines to initialize and get the functions going. Once you build a project this way you really realize how great it is, because adding and testing a new feature is just so easy this way.

In conclusion, doing a project this way and properly planning it is great for programmers trying to learn from the internet, since it's the kind of stuff they probably teach in college, so this way you don't miss out on it.
And object oriented programming is just great. Goodbye.
Be a Superhuman with ChatGPT 🚀🔥
Tags: ai, chatgpt, programming, codenewbie
Published: 2023-03-17 13:20:26

##Introduction
ChatGPT is a revolutionary OpenAI-trained language model based on the GPT-3.5 architecture, capable of producing human-like responses to text prompts. It promises to revolutionize the way we interact with machines and can bring us many advantages such as improved daily life efficiency and exciting prospects for learning.

How ChatGPT is building the future of Tomorrow
ChatGPT is revolutionizing the world of technology through its advanced AI capabilities. Combining natural language processing and machine learning, this cutting-edge platform enables chat applications to understand user intent and provide customized conversations for all users. The ability to interact with customers and deliver personalized dialogue is allowing businesses to create unique customer experiences. Through its wide array of capabilities, ChatGPT is transforming how companies engage with their customers, enabling them to provide enhanced service while building meaningful relationships. Simultaneously, ChatGPT simplifies customer service by providing a seamless and efficient approach that reduces manual labor. This tech leader continues to revolutionize the way businesses operate and interact with their customers through the development of innovative AI solutions that are shaping the future.


##Here are some list of keywords that you can use to enhance your search
![img](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fu5eei2mzphcnlwng4q4.png)



##Uses
ChatGPT can be a great help when we are feeling idle and unmotivated. It can offer us the support and motivation needed to overcome that inertia, including personalized messages to get us out of bed in the morning!

Relationships may also be enriched by using ChatGPT. Whether one is having difficulty communicating with a significant other or seeking advice on how to approach a complex situation, ChatGPT can offer advantageous guidance and ideas. By taking into account your conversation record, the AI technology will identify any recurring dynamics of your interactions and provide tailored advice on how to nurture your relationships.(tbh I actually tried this one)

ChatGPT can be a great asset in personal development and coding. It can offer guidance to programmers tackling difficult bugs, supplying relevant examples so they can tackle the issue successfully. With its assistance, even the most complex programming problems can be solved.

The potential for AI to reshape how we live and interact as a society is clear. However, it is essential to acknowledge that the strength of AI lies in the people who create them. By collaborating, we can ensure that AI works to benefit all of humanity, instead of just a small fraction.

##Conclusion
In conclusion, ChatGPT offers an abundance of opportunities for growth. From personal enrichment to technical aid and ways to stay productive, this powerful tool can provide the necessary support and direction for success. AI is a global game-changer, and it’s up to us to ensure its use positively contributes to the world around us.
How to: install ngrok on your Raspberry Pi
Tags: raspberrypi, tutorial, howto, notsponsored
Published: 2023-03-17 13:16:05

Ngrok is a fantastic tool that creates secure tunnels from public URLs to your localhost. It allows you to test webhook integrations, share your progress, and collaborate on projects without deploying your code to a remote server. With just a single command, ngrok generates a unique public URL that forwards requests to your local development environment.

However, there's a small catch when using the free version of ngrok: it assigns random URLs each time you create a tunnel. This can be inconvenient for certain use cases.

https://ngrok.com/

---

## Free plan steps ##

Here's a step-by-step guide on how to install and run ngrok on your Raspberry Pi:

1. Download ngrok for Linux ARM:

```bash
wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-arm.zip
```

2. Unzip the downloaded file:
```bash
unzip ngrok-stable-linux-arm.zip
```
This will extract the ngrok executable in the current directory.

- (Optional) Move the ngrok executable to a directory in your system's PATH. This way, you can run ngrok from anywhere in your terminal without specifying its full path. For example, you can move it to /usr/local/bin:
```bash
sudo mv ngrok /usr/local/bin
```

3. To run ngrok, simply type ngrok followed by the command and arguments. In your case, you want to expose your Flask server running on port 5000:

```bash
ngrok http 5000
```
Now, ngrok should create a secure tunnel, and you should see the HTTPS URL provided by ngrok.

---

However, the anonymous plan only allows you to create a tunnel for 2 hours. To prevent this we can create a free account.

## Extend the options with an account ##
To get started with custom subdomains, you'll first need to sign up for a paid ngrok plan. The Basic plan is a great starting point and can be found on the ngrok pricing page: https://ngrok.com/pricing

Once you have signed up for a basic or plan, you'll need to authenticate your local ngrok client. Head over to your ngrok dashboard and find your unique authtoken. Then, run the following command in your terminal to authenticate:

```sh
./ngrok authtoken <your_ngrok_authtoken>
```

---

## Creating a custom subdomain using the paid plan ##
With authentication out of the way, we can now create a custom subdomain for our tunnel. Use the --subdomain flag while starting the ngrok tunnel:

```sh
./ngrok http -subdomain=mycustomsubdomain 5000
```
This command will create an HTTP tunnel with the subdomain mycustomsubdomain.ngrok.io, forwarding to port 5000 on your local machine. Voilà! Now you have a consistent URL that you can use and share for your projects.
Catatan Belajar dari kelas "Belajar Membuat Aplikasi BE untuk Pemula"
Tags: javascript, node, beginners
Published: 2023-03-17 13:12:52

- Untuk URL gunakan kata benda daripada kata kerja, serta jamak. Kemudian gunakan hirarki. Misal, `/articles/:id/comments`

- Pisahkan dev dan prod dengan `NODE_ENV=production node app.js`

- Gunakan ESlint agar code lebih rapih
```
npm i eslint -D
npx eslint --init

//kemudian taruh ini di property script pada package.json
"lint": "eslint ./"

npm run lint

//taruh ini di property rules pada .eslintrc.json agar tak ada warning pada console.log
"no-console": "off"
```

- Gunakan NVM agar lebih mudah dalam  memilih versi node js

- response dari API yaitu status, message (biasanya tidak digunakan pada method GET kecuali jika status fail), dan data (tergantung)
```javascript

res.status(200).json({
    status: 'success',
    message: 'Artikel berhasil ditambahkan',
    data: {
        articleId: 1
    }
})

res.status(200).json({
    status: 'success',
    data: {
        articles: [{
            /*   */
        }]
    }
})
```
Processing promises in Batch
Tags: javascript, node, promise, performance
Published: 2023-03-17 12:58:31

## Running code concurrently

To make execution faster, we usually run code concurrently.
One way to run code concurrently in JavaScript is to call many promises at the same time without waiting for their results, then you use `Promise.all` to await all the promises to finish. Check the example below:

```jsx
const promiseA = asyncFnA();
const promiseB = asyncFnB();

const results = await Promise.all([promiseA, promiseB]);
```

The code above will execute `asyncFnA` and `asyncFnB` concurrently, and `Promise.all` will await both execution to resolve.

## Running many promises at the same time

Let's take a look at this code

```jsx
const users = await User.find(); // return all users in the database

const results = await Promise.all(users.map(async (user) => processUser(user));
```

This code will run as many promises as `users` in your database. Node and JavaScript does not handle so well many promises running concurrently, Go handles this well. 
This code will probably consume a lot of CPU and memory and will run out of memory.
To solve this, we need to process all these promises in batch

## Processing promises in Batch

```tsx
export async function processPromisesBatch(
  items: Array<any>,
  limit: number,
  fn: (item: any) => Promise<any>,
): Promise<any> {
  let results = [];
  for (let start = 0; start < items.length; start += limit) {
    const end = start + limit > items.length ? items.length : start + limit;

    const slicedResults = await Promise.all(items.slice(start, end).map(fn));

    results = [
      ...results,
      ...slicedResults,
    ]
  }

  return results;
}
```

Usage

```jsx
const results = await processPromisesBatch(users, 100, processUser)
```

`processPromisesBatch` will slice your items in chunks of size N, and will execute N promises at the same time. 
This ensures it won't consume a lot of CPU and memory, and exhaust the event loop.

## In Conclusion
Understanding the limitation of your programming language and runtime, can help you design a solution to workaround them.

Share solutions that you design based on limitations of your programming language, runtime or framework.

---
Woovi
[Woovi](https://www.woovi.com) is a Startup that enables shoppers to pay as they like. To make this possible, Woovi provides instant payment solutions for merchants to accept orders.

If you want to work with us, we are [hiring](https://woovi.com/jobs/)!

---
Photo by <a href="https://unsplash.com/@elevatebeer?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Elevate</a> on <a href="https://unsplash.com/photos/dI-aXC7DWpQ?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
Transição de Carreira
Tags: beginners, python, pt
Published: 2023-03-17 12:50:35

Iniciei minha carreira em 2008, quando tinha 14 anos de idade, em um programa de estágio chamado ‘Jovem Aprendiz’ na empresa 'Ultragaz', onde tive a oportunidade de conhecer e ter a vivência no mercado de trabalho. Em 2011 iniciei a graduação de Administração de Empresas, em uma Universidade Federal, do qual realizei dois estágios, um no programa social do Governo Federal do Brasil chamado “Minha Casa Minha Vida”, no qual tive a oportunidade de trabalhar com o atendimento ao cliente. O outro estágio foi executado em um Shopping Center (Parnaíba Shopping) na área de auditor de lojas, do qual trabalhei minhas habilidades analíticas ao relatar as vendas, valores, quantidades e ambiente das lojas. Em 2015, após os referidos estágios, iniciei uma carreira de gestão na empresa Companhia Eletromecânica e Gerenciamento de Dados S/A, que durou 7 anos. Nesta empresa iniciei minhas funções no cargo de Supervisor, do qual trabalhava com uma equipa de 30 colaboradores de campo, adquirindo experiência de liderança, trabalho em equipa, planejamento de atividades e nessa atividade o foco principal era a coleta de dados mensais de mais de 100.000 clientes. Após 15 meses recebi uma promoção para o cargo de Coordenador das atividades operacionais, nesta função a meta era a coleta de dados de mais de 1.000.000 de clientes mensais, com uma equipa de 350 colaboradores e atribuições de contato direto com clientes e demais setores administrativos da empresa. Em 2021 fui promovido a Gerente Regional, com uma função macro sobre o processo operacional da empresa e organização dos demais processos e setores, contato direto com a diretoria da empresa, tomada de decisões na contratação de fornecedores, negociações com sindicato e com a concessionária de energia.

Há cerca de 2 anos estudo programação, lógica, algoritmos, banco de dados, sql,  linux, git atualmente estou focando os estudos na linguagem Python e nos frameworks webs Django, Flask e FAST API  e estou em transição de carreira para área de tecnologia. Ao longo desses anos apliquei os meus conhecimentos em tecnologia na rotina de trabalho e para facilitar o dia a dia fiz uma automação que executava processos repetitivos dentro de um sistema ERP, além de script para inserir base de dados em csv para um banco de dados na AWS para conectar ao Power BI. 

Atualmente utilizo a plataforma da Alura para estudar, também faço uma formação na LinuxTips que são 3 cursos, Python Base (Concluído), Web (Em andamento) e Expert, além de vídeos no youtube, documentação e sites de exercícios. Fiz um repositório no [github]( https://github.com/joseevilasio/roadmap) de roadmap para ser um guia dos meus estudos e isso me ajuda há não perder o foco.

A transição de carreia para qualquer área não é fácil, ser inserido em um mercado de trabalho não é fácil, por isso persistir e manter o foco é fundamental. Ainda não tenho a tão sonhada vaga, mas estou seguindo e aprendendo cada dia mais e mais.
Catatan belajar "Belajar Dasar Pemrograman Javascript" dari dicoding
Published: 2023-03-17 12:48:59



- Menamai variabel "data" itu buruk. Penamaan variabel harus sesuai makna dari variabel itu sendiri

```javascript
//Ini contoh yang salah
data.forEach(data => {/* */});
//Ini contoh yang benar
articles.forEach(article => {/* */});

```

- Trailing coma pada property terakhir dari objek itu membantu. Sebaiknya dilakukan
```javascript
const article = {
    id: 1,
    title: 'Peran AI dalam Pendidikan',
    slug: 'peran-ai-dalam-pendidikan',
    author: 'Budi S', //ini contoh trailing coma
}
```

- Throw error digunakan untuk menciptakan error sendiri. Contohnya variabel undifined, itu tidak dianggap error oleh runtime maka bisa kita buat error dengan menggunakan throw error 
```javascript
throw new Error('variable undifined');
```

- Kita bisa membuat Custom Error sendiri dengan membuat class turunan dari class Error
```javascript
class ValidationError extends Error {
    constructor(message){
        super(message)
        this.name = 'Validation Error'
    }
}
```

- Unit testing adalah pengujian pada bagian kecil

- Integration testing adalah pengujian fungsi yang bergantung pada fungsi lainnya 

- End to end testing adalah pengujian flow dari hulu ke hilir 

- Promise all menjalankan promise secara paralel. Jika salah satu promise reject maka akan me return promise tersebut tanpa promise lain

- Promise allSettle sama seperti all tapi me return semua promise baik yang resolve maupun failed

- Asin await sangat dianjurkan karena membuat code lebih enak untuk dibaca. Asin await itu menulis code asynchronous dengan style synchronous
C++ Increment and Decrement Operators
Published: 2023-03-17 12:44:23

The increment operator ++ adds 1 to its operand, and the decrement operator -- subtracts 1 from its operand. Thus −

```
x = x+1;
 
is the same as
 
x++;
```
And similarly −

```
x = x-1;
 
is the same as
 
x--;
```
Both the increment and decrement operators can either precede (prefix) or follow (postfix) the operand. For example −

```
x = x+1;
 
can be written as
 
++x; // prefix form
```
or as −

```
x++; // postfix form
```
When an increment or decrement is used as part of an expression, there is an important difference in prefix and postfix forms. If you are using prefix form then increment or decrement will be done before rest of the expression, and if you are using postfix form, then increment or decrement will be done after the complete expression is evaluated.
In programming `(Java, C, C++, JavaScript etc.)`, the increment operator ++ increases the value of a variable by 1. Similarly, the decrement operator -- decreases the value of a variable by 1.

```
#include <iostream>

using namespace std;

int main() {
   int var1 = 5, var2 = 5;

   // 5 is displayed
   // Then, var1 is increased to 6.
   cout << var1++ << endl;

   // var2 is increased to 6
   // Then, it is displayed.
   cout << ++var2 << endl;

   return 0;
}

```
Salesforce Commerce Cloud – An Introductory Guide
Tags: salesforce, commercecloud, b2bcommerce, commercecloudconsultant
Published: 2023-03-17 12:41:04

[Salesforce Commerce Cloud](https://www.innovadeltech.com/salesforce-commerce-cloud/) is a SaaS e-commerce platform that enables businesses to connect with customers on multiple channels. It provides solutions for refining the customer experience and has features such as AI, order management, and content management to help businesses grow and expand globally.

Read an amazing blog on [Salesforce Commerce Cloud – An Introductory Guide](https://www.innovadeltech.com/sffcc-an-introductory-guide/)
How to reference a variable inside a `.env` file
Tags: webdev, env, laravel, php
Published: 2023-03-17 12:38:59

`.env` files are environment-specific files, used to house variables specific to the environment you're running in. You keep them out of version control.

Let's take a look at Laravel's default `.env` file:

```
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=

BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DISK=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

MEMCACHED_HOST=127.0.0.1

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=smtp
MAIL_HOST=mailpit
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="Laravel"

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_HOST=
PUSHER_PORT=443
PUSHER_SCHEME=https
PUSHER_APP_CLUSTER=mt1
```

In a typical application this will grow over time, with more and more variables being added all the time.

In an example application that integrates with a service like Shopify, you'll likely need to maintain an absolute URL that differs for each environment (local, dev,staging, QA, production, etc).

We, of course, want to implement DRY (Don't Repeat Yourself), so repeating the domain name lots of times in the same file isn't an option - it will lead to human error when duplicating environments, and it's just not a good use of time.

## Using variables inside `.env` files

We can resolve this issue by using variables in `.env` files.

The magic for this is to wrap the URL in curly braces and prefix with a `$` symbol. 

Let's have a look at the Shopify example above.

Set an `APP_URL`:
```
APP_URL=https://example.com
```

Now reference that later on:
```
SHOPIFY_WEBHOOKS="${APP_URL}/shopify/webhook"
```

This would resolve to:
```
SHOPIFY_WEBHOOKS="https://example.com/shopify/webhook"
```

In Laravel `APP_URL` is a common variable you will reuse, but `APP_NAME` is also likely to be used a lot, especially for things like `MAIL_FROM_NAME` and such. It's useful to use variables wherever possible, even for things that like an `APP_NAME` which you may think will never change, but you might wish to change this to something specific per environment, such as:

```
APP_NAME="My App (Staging - staging.example.com)"
```

This way you're able to identify things like email coming from staging or QA environments easily.
10 of the most useful websites on the internet that you’ve likely never heard
Tags: programming, frontend, productivity, webdev
Published: 2023-03-17 12:38:05

## [tldv.io](https://tldv.io/)
Record meetings for free with our Zoom app or Google Meet Chrome Extension. Capture calls in high quality video and sound, then access them immediately afterwards in your meetings library. Our meeting recorder makes it easier than ever to share call moments.

• Access the recording immediately after the call 
• Timestamp key moments during meetings 
• Transcribe in 20+ languages 
• Clip parts of calls for sharing

## [eesel.app](https://www.eesel.app/)

Find any doc, create new ones, and follow your teammates' projects—all from your new tab.
Don’t ever hunt for that link again. Quickly access your work when you need it.
Find anything you’ve worked on recently in a few keystrokes.

## [mailbrew.com](https://mailbrew.com/)

Turn off the firehose of news feeds with one daily email from Mailbrew (that includes all your news feeds in one place).
Your favorite sources. 
Your favorite newsletters. 
Saved links. All in one place.

## [plausible.io](https://plausible.io/)
Finding Google Analytics too complicated or looking for a lightweight alternative?Plausible is your answer.

• Simple to use 
• Lightweight and open source 
• No cookies and fully compliant with GDPR, CCPA, and PECR

## [poet.so](https://poet.so/)
Capture and share Twitter or LinkedIn posts as beautiful images.
Steps: 

(1) Drop the link in 
(2) Change the colour or background 
(3) Re-size and toggle on/off the responses 
(4) Download and share wherever you

## [tango.us](https://www.tango.us/)
An extension that generates beautiful step-by-step guides with screenshots, while you work.Catch up on your documentation, cut down on meetings and interruptions, and save hours every week.

• Save hours of screenshots and writing instructions 
• Answer questions quickly—no more repetitive training sessions

## [risescience.com](https://www.risescience.com/)

Built around the two principles that sleep researchers agree affect how we feel and perform: sleep debt and circadian rhythm.
RISE tracks how much sleep you owe your body & predicts your daily energy schedule.
Real performance, real wellbeing.


## [tinypng.com](https://tinypng.com/)

Use TinyPNG to shrink images for your apps and sites—without sacrificing image quality.
Tiny PNG’s will use less bandwidth and help 

## [bardeen.ai](https://www.bardeen.ai/)
Bardeen saves you time by automating repetitive tasks with a shortcut.

• Hundreds of pre-built automations for all your favorite web apps 
• Scrape data from any web page with one-click 
• Run manual tasks automatically

## [sunsama.com](https://www.sunsama.com/)
Bring in tasks from all your tools into one place, and onto your calendar.It helps you keep track of everything and make sure the most important things get  

• Pull in tasks from Trello, Gmail, Asana, and more 
• Track your tasks & calendar in one place 
• Prioritize your work day by day
• Guided daily planning
• Realistic daily goals
• Unified daily view
• Timeboxing