teleren/devto huggingface dataset:
Manual Trigger on Github action - #2
Tags: github, githubactions, triggers, cicd
Published: 2023-07-03 15:15:12

### Intro
In the Github action session, In this article we will be learning about Manual Trigger action for the specific task.

**Why we need this?**
We often require some short of actions that we only do when we need any specific action.
For example, you wanna release your app from `dev` env to `qa` env after fixing a new bug.
In this case we can use Manual trigger that will deploy app from `dev` to `qa` once we trigger the action.

**Also Read**
In the last article We learnt [Greet on first PR and Issue](https://dev.to/hidaytrahman/greet-to-the-new-pr-and-issue-creator-in-github-action-1-k89)

**How can we do that?**
We can achieve the manual trigger feature using [Workflow Dispatch](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch) It enables a workflow to be triggered manually, you need to configure the `workflow_dispatch` event. You can manually trigger a workflow run using the `GitHub API`, `GitHub CLI`, or `GitHub browser` interface


Lets create a brand new workflow under the `.github/workflows/manualTrigger.yml`

Paste the below code and push your changes to the `main` branch.

```javascript
name: "Workflow Manual Trigger"

on: 
  workflow_dispatch:
    inputs:
      author:
       description: 'Choose author'
       required: true
       type: choice
       options:
                - admin
                - editor
                - contributor
      location:
        description: 'Choose Location'     
        required: true
        default: 'in'
        options:
                - us
                - uk
                - in
      
        
        
jobs:
  printInputs:
    runs-on: ubuntu-latest
    steps:
    - run: |
        echo "Author : ${{ github.event.inputs.author }}"
        echo "Location : ${{ github.event.inputs.location }}" 
```

Now go the `actions` tab and select `Workflow Manual Trigger`

Click on the `Run Workflow` button

![Run workflow image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dyzink0z1q5jtbrwoaxk.png)


Choose the fields.

![Opened workflow image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yhordekd6njdi0rc7e1b.png)

After selecting the specific field click on green `Run workflow` button

It will start running the workflow. Once done you can verify the actions while opening the logs.

![Action logs](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tf6l7cv3ikb56chsuunz.png)

You can see we have the selected data in the logs.

Feel free to utilise the action based on your requirement. 

Happy Action!
Caption This! 🤔💭
Tags: watercooler
Published: 2023-07-03 15:00:00

Can you come up with the wittiest caption to explain what's happening here?

![Image of an animated person clenching their teeth](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hbz7oh3sw3myy3f07ywz.jpg)

---

Follow The DEV Team for more discussions and online camaraderie!

{% embed [https://dev.to/devteam](https://dev.to/devteam) %}
Price projections for Bazaars BZR
Tags: bazaars, bzr, cryptocurrency, defi
Published: 2023-07-03 14:37:35

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

Price projections for [Bazaars BZR](https://bazaars.io/) are highly speculative, as the cryptocurrency is still in its early stages of development. However, some analysts believe that Bazaars BZR has the potential to reach $10 or even $100 in the long term.
Here are some factors that could influence the future price of Bazaars BZR:
The growth of the decentralized finance (DeFi) market: DeFi is a rapidly growing market that allows users to access financial services without the need for a central authority. Bazaars BZR is a DeFi token, so its price could be correlated with the growth of the DeFi market.
The adoption of Bazaars BZR by merchants and consumers: If more merchants and consumers start using Bazaars BZR to buy and sell goods and services, the demand for Bazaars BZR could increase, driving up its price.
The development of new features and applications for Bazaars BZR: If the Bazaars BZR platform adds new features and applications, it could attract more users and increase the demand for Bazaars BZR.
Of course, there are also some risks that could impact the price of Bazaars BZR. These include:
The volatility of the cryptocurrency market: Cryptocurrencies are known for their high volatility, which means that their prices can fluctuate wildly in a short period of time. This could make Bazaars BZR a risky investment for some investors.
The competition from other DeFi tokens: There are a number of other DeFi tokens on the market, and some of these tokens have larger market capitalizations than Bazaars BZR. This could make it difficult for Bazaars BZR to gain traction and attract new users.
The failure of the Bazaars BZR platform: If the Bazaars BZR platform fails, it could have a negative impact on the price of Bazaars BZR.
Overall, the future price of Bazaars BZR is uncertain. However, if the project is successful and the DeFi market continues to grow, Bazaars BZR could have the potential to reach significant price levels in the long term.
Rust Lifetimes Overview
Tags: rust
Published: 2023-07-03 14:30:57

---
title: Rust Lifetimes Overview
published: true
description: 
tags: Rust
# cover_image: https://i.imgur.com/JirQzWs.png
# Use a ratio of 100:42 for best results.
# published_at: 2023-07-03 14:28 +0000
---
![Rust Lifetimes overview](https://i.imgur.com/JirQzWs.png)
Featurevisor: Git-based feature flag & experiments management
Tags: javascript, react, featureflags, experiments
Published: 2023-07-03 14:30:00

---
title: Featurevisor: Git-based feature flag & experiments management
published: true
description: Manage your feature flags and experiments declaratively as YAMLs from a Git repository
tags: 
  - javascript
  - react
  - featureflags
  - experiments
cover_image: https://featurevisor.com/img/og-dark-bordered.png
# Use a ratio of 100:42 for best results.
published_at: 2023-07-03 14:30 +0000
---

Recently released an Open Source Git-based feature flagging and experiments management tool, where you can define everything in a Git repository as YAMLs and then evaluate your features in your application.

## Links

- GitHub: https://github.com/fahad19/featurevisor
- Documentation: https://featurevisor.com/

## Why?

- Decouple your application releases from deployments
- Have team and organization level reviews and approvals

## Features

- Feature flags
- Experiments (A/B and Multivariates)
- Segmentation for targeting users
- Gradual rollouts
- Conditional variables
- Consistent bucketing
- Multiple environments
- Tagging
- Force bucketing
- Tracking
- Status site generator
- Universal SDKs (for Node.js & browsers)

## Roadmap

- Get more tests in
- Release a stable v1.0 API
- Expand SDK support for Swift and Kotlin, and more

Please reach out with any feedback and opinions that can help me make this tool better over time! Thanks <3
How to use ChatGPT in Python - Unofficial ChatGPT Python API Guide
Tags: discuss, webdev, programming, python
Published: 2023-07-03 14:12:25

To use ChatGPT in Python, you can make use of the OpenAI API to interact with the model. Here's an unofficial guide to get you started:

1. Install the required libraries:
   ```bash
   pip install openai
   ```

2. Import the necessary modules:
   ```python
   import openai
   import json
   ```

3. Set up your API key:
   ```python
   openai.api_key = 'YOUR_API_KEY'
   ```

   Make sure to replace `'YOUR_API_KEY'` with your actual OpenAI API key. If you don't have one, you can sign up for access on the OpenAI website.

4. Make a function to send a message to ChatGPT:
   ```python
   def send_message(message):
       response = openai.Completion.create(
           engine='text-davinci-003',
           prompt=message,
           max_tokens=100,
           temperature=0.7,
           top_p=1.0,
           n=1,
           stop=None,
           timeout=15
       )
       reply = response.choices[0].text.strip()
       return reply
   ```

   In this function, we use the `openai.Completion.create` method to send a prompt to the ChatGPT model and retrieve a response. You can adjust the parameters according to your needs.

5. Use the `send_message` function to start a conversation:
   ```python
   conversation = [
       {'role': 'system', 'content': 'You are a helpful assistant.'},
       {'role': 'user', 'content': 'Who won the world series in 2020?'}
   ]

   messages = [{'role': role, 'content': content} for role, content in conversation]
   prompt = json.dumps(messages)

   reply = send_message(prompt)
   print(reply)
   ```

   The conversation is represented as a list of messages, where each message has a role ('system', 'user', or 'assistant') and content (the text of the message). You can modify the `conversation` list to suit your own conversation.

   The messages are then converted to a JSON format and passed to the `send_message` function, which returns the assistant's reply.

That's it! You now have a basic setup to interact with ChatGPT using Python. Remember to be mindful of OpenAI's API usage guidelines and respect any rate limits or restrictions in place.
What are your goals for the week of July 4?
Tags: discuss, motivation
Published: 2023-07-03 14:08:00

## What are your goals for this week?

Holiday in The US. Many will have a short week. Do you work Mon, off Tue, then work three days?


![Action figure of Captain America as a Werewolf. ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6zsnwckozo4e2rqnshl1.jpg)

- What are you building? 
- What will be a good result by week's end?
- Are you attending any events this week? 
  * Any suggestions of events to attend?
- Did you meet your goals last week?


I'll start with how I did last week.

### Last Week's Goals

- [:white_check_mark:] Continue Job Search.
- [:x:] Blog Random ideas, logged stuff in my TIL journal that I sometimes use to generate topics ideas.
- [:white_check_mark:] Code Challenges two CSS battles. I shared my screen on the VC group and did some of this live.
I will blog about this soon.
![screenshot: has two windows. Both have 4 triangles in them.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9iygxgj09u7d5lz15008.jpg)
- [:white_check_mark:] Project work: Fixed What I broke, Got more info from the API to display on screen.
- Events
  * [:white_check_mark:] Attend Virtual Coffee(VC) Thursday.
  * [:white_check_mark:] Other VC events if I can.
  * ~~Zapier event~~ Postponed. 
       * Turns out this was the day they announced Layoffs. Not a good time to hold a webinar on salary negotiations.
       * Indirectly led me to miss another event. I had two things back to back. Thought this was the first one so When I learned it was cancelled I did other stuff and forgot about thing two. 
  * [:white_check_mark:] Dallas Software Developers Meetup Thursday, June 29 at 7:00 PM Night of JavaScript. (Virtual)


### This Week's Goals

- Continue Job Search.
- Blog
- Code Challenges
- Project work
- Events
  * Attend Virtual Coffee(VC) Thursday.
  * Other VC events if I can.

### Your Goals for the week


You've read my goals so I'll throw the questions back to you.


- What are you building? 
- What will be a good result by week's end?
- Are you attending any events this week? 
  * Any suggestions of events to attend?
- Did you meet your goals last week?


![July 3 is independence day eve. Don't forget to leave out wings and beer for Captain America](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9li2awy2hxe610ywghy5.jpg)

```html
-$JarvisScript git push
```
Criando um grupo
Tags: sdelements, beginners, security, devops
Published: 2023-07-03 13:54:00

Na aba superior clique em **Manage** e depois em **Groups**.
Clique no símbolo **+** e insira as informações no formulário:
- Nome
- Descrição
- Role padrão para todos no grupo
![Form grupos](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rrxyrvsmo2flair6d7o1.png)
Criando uma Global Role
Tags: sdelements, beginners, tutorial, security
Published: 2023-07-03 13:54:00

**O que é?**
Uma Global Role é uma coleção de permissões que controlam o acesso aos recursos do aplicativo.

**Como fazer?**
Na barra superior, clique em **Manage** e depois em **Global Roles**.

Nessa tela vai conseguir visualizar todas as atuais bastando clicar no ícone com o símbolo **+**.

No formulário, coloque um nome e idealmente uma descrição.
Na seção de permissões, pode configurar ativando ou desativando os recursos dentro das categorias disponíveis.
![Form Global Roles](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2m1yksrge5xsdrqkezza.png)
Criando usuários
Tags: sdelements, beginners, tutorial, security
Published: 2023-07-03 13:53:00

Para criar um usuário, é preciso ter a role **Manage Users & Groups**.

Na barra superior, clique em Manager e depois em **Users**.
Depois clique no botão com o símbolo **+** e depois na opção **Add User**.

Precisamos colocar no formulário, as informações:
- Email
- Primeiro nome
- Segundo nome
- Global Role
- Grupo (Opcional)
![Form usuario](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ocgvzi55hx5zgh0nzrq6.png)

Para mais detalhes, consulte a [documentação](https://docs.sdelements.com/release/2023.1/guide/docs/users/).
Cleaning an object
Tags: beginners, javascript, webdev
Published: 2023-07-03 13:34:56

Let's say we have a javascript object or JSON object literal that we use to do some task. And let's say those object values weren't predicted which means it can cause problems in the task execution due to nullish values. These nullish values may consist of the follwing.

```
undefined, null, ""
```

Our goal is to change the given object to a clean record.

![suspended bridge , Pakding, Nepal](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r2mdss7ec6zvtywcxqqf.jpg)
**[Photo by Sebastian Pena Lambarri](https://unsplash.com/@sebaspenalambarri)**

Let's assume we are given the following object.

```
const obj = {
    "foo": "",
    "bar": null,
    "max": undefined,
    "firstName": "John",
    "lastName": "Doe",
    "age": 42
};
```

### Points to consider

1. The `for-in loop` takes an object and makes it an iterable of keys. In other words it returns the indexes/keys of that object. We can use this to iterate the object and access each element.

2. The built-in function `includes` uses to check if an element contains in the given array. In here we are using it to check if the value given available within the items we have.

3. The operator/function `delete` removes an element/value by the key of the object given.

### How to do it

With this below function we can achieve our goal.

```
for (const i in obj) {
    if ([null, undefined, ""].includes(obj[i])) {
        delete obj[i];
    }
}
```
This function demonstrates the points mentioned above. It iterates the object via the keys (for-in loop) and checks the value contains in the array given (includes). If so it removes the key-value pair from the object (delete).

Finally we are left with the object containing clean values.
```
{ firstName: 'John', lastName: 'Doe', age: 42 }
```

Thanks for reading!
Raku Blog Posts 2023.27
Tags: programming, rakulang, summary
Published: 2023-07-03 13:28:20

- [EBNF::Grammar](https://rakuforprediction.wordpress.com/2023/06/26/ebnfgrammar/)

*Anton Antonov* introduces their new module for converting an ENBF form into a Raku grammar.

- [Moving printf formats forward](https://dev.to/lizmat/moving-printf-formats-forward-1m3p)

*Elizabeth Mattijsen* introduces the new `Formatter` / `Format` classes and the new `:o` / `:format` quoting construct adverb.

- [CoreDev Class Part 1 Video Published](https://vrurg.github.io/2023/06/28/coredev-class-part-1-video-published)

*Vadim Belman* published the video of the first Raku CoreDev Class, with all its warts and glitches.

- [Saying them apart](https://gfldex.wordpress.com/2023/07/02/saying-them-apart/)

*Wenzel P.P. Peppmeyer* introduces an `is renamed` trait to give multi-dispatch candidates an easier recognisable name.

- [I take issue with enshittification](https://gfldex.wordpress.com/2023/07/02/i-take-issue-with-enshittification/)

in which *Wenzel P.P. Peppmeyer* forays into the issues around enshittification.

- [Revising Rakudoc](https://dev.to/finanalyst/revising-rakudoc-29d4)

*Richard Hainsworth* gives background into Pod6, their attempts to improve renderers for it, and how it is now all coming together in a new RakuDoc standard.

- [Reinventing Pod6: Moving Forward](https://dev.to/zag/reinventing-pod6-moving-forward-5gee)

*Alexandr Zahatski*, the author of [PodLite](https://github.com/podlite/podlite-desktop#readme) (a Pod6 editor), looks forward to the results of the RakuDoc standardisation process. 

- [Rakudo Weekly News 2023.27](https://rakudoweekly.blog/2023/07/03/2023-27-revising-rakudoc/)
with all recent developments around Rakudo, an implementation of the Raku Programming Language.
My key learnings of 20 years of software engineering
Tags: 20years, php, learning, programming
Published: 2023-07-03 13:27:53

Oh wow, today is the day. 20 years ago, on the first Monday of July I entered the professional world of software engineering  as a 19 year old uni dropout. From the tight quarters of a starting web agency in Amsterdam staring at a modest 14-inch CRT screen my journey began. Even though I had been tinkering with Q-basic all my high school years and done some spare web dev jobs for a few guilders as a young adolescent from that moment it had grown into something more - my profession

Today is not my birthday but I'm marking an important milestone. I’ve been a software engineer longer than not. It feels like a celebration all its own.
This journey has been filled with lessons. Many mistakes were made. Stress threatened my passion. But I've learned, grown, and found joy in this craft.

Here are a few lessons I've come to understand over these years:

**Mental energy**
1: Mental energy is the most precious resource. It powers our ideas, fuels our creativity, and drives our resilience. Nurturing it is paramount.  

**Unique privillege**
2: Software engineering is a magical craft. We create solutions out of nothing but thought and code, transforming digital ether into concrete problem-solving marvels. It’s a unique privilege.

**Learning never stops**
3: The learning never ceases. There’s no plateau of knowledge, every day offers an invitation to understand something new, to refine our skills, and expand our horizons.

**It'll always take longer than expected**
4: The first 80% of the project takes 80% of the time, the last 20% of the project takes 80% of the time 

**Teamwork = dreamwork**
5: Teamwork is the foundation of success. The unity in brainstorming, coding, debugging, and ultimately, creating solutions is a thrill. It’s a reminder that together we make the impossible possible.

**Trust your tools**
6: Trust your tools. PHP (with Laravel and Symfony as the big guns) has been my trusted ally, demonstrating time and again its efficiency for me against other inflated tech stacks. Don't let trends overshadow the tools that truly empower you. 

**Imposter syndrome isn't that bad**
7: And yes, the whisper of imposter syndrome is a reality. It can keep us grounded, spark our curiosity, and push us to strive for better, reminding us that there’s always room to grow.

I'm thrilled about what lies ahead. Celebrating this 20-year milestone I look forward to 20+ more years of crafting solutions, chasing down bugs like a bloodhound for my clients and delving deeper into this craft. The journey continues, and the future excites me. Here's to the next 20 years! 🚀👨‍💻🥳
CloudFormation: Simplifying Infrastructure as Code in AWS
Published: 2023-07-03 13:23:12

In the era of cloud computing, automating the deployment and management of infrastructure resources is crucial for scalability, efficiency, and consistency. AWS CloudFormation provides a powerful solution by allowing you to define and provision AWS resources in a declarative manner using code.

Examples of how CloudFormation is used:

Provisioning a web server: CloudFormation can be used to provision a web server with a single command. The template would define the resources needed to create the server, such as an EC2 instance, an S3 bucket, and a load balancer. CloudFormation would then create and configure these resources, ensuring that they are all in the correct state.
Deploying a mobile application: CloudFormation can be used to deploy a mobile application to a variety of environments, such as development, staging, and production. The template would define the resources needed to deploy the application, such as an ECS cluster, an ALB, and a database. CloudFormation would then deploy the application to the specified environment, ensuring that it is available to users.
Scaling a database: CloudFormation can be used to scale a database up or down as needed. The template would define the resources needed to scale the database, such as EC2 instances and RDS instances. CloudFormation would then scale the database up or down, ensuring that it is always available to users.
Benefits of using CloudFormation:

Automation: CloudFormation automates the provisioning and management of AWS resources, reducing the need for manual intervention. This can save time and resources, and help to ensure that infrastructure is deployed and managed consistently across environments.
Scalability: CloudFormation can be used to provision and manage resources at scale. This makes it a good choice for organizations that need to deploy and manage large-scale infrastructure.
Consistency: CloudFormation templates can be used to define the desired state of your infrastructure. This can help to ensure that infrastructure is deployed and managed consistently across environments, reducing the risk of errors.
Reproducibility: CloudFormation templates can be used to reproduce infrastructure deployments. This can be useful for testing new deployments, or for recovering from infrastructure failures.
Auditability: CloudFormation templates can be used to audit infrastructure deployments. This can help to ensure that infrastructure is deployed and managed according to security and compliance requirements.
How to get started with CloudFormation:

To get started with CloudFormation, you will need to create a CloudFormation template. This template will define the resources that you want to provision. You can create a template using the AWS CloudFormation console, the AWS CLI, or an AWS SDK.

Once you have created a template, you can deploy it using the AWS CloudFormation console, the AWS CLI, or an AWS SDK. CloudFormation will then provision and manage the resources in your template, ensuring that they are always in the desired state.
How Do Agile And DevOps Interrelate
Tags: devops, agile, programming
Published: 2023-07-03 13:06:27

Supercharge your software development process by understanding the dynamic relationship between Agile and DevOps. Learn how Agile principles foster collaboration and iterative development, while DevOps practices enhance delivery speed and operational efficiency. Gain insights into how these two methodologies complement each other to create a seamless, high-performing software development ecosystem. Don't miss out on this opportunity to unravel the secrets of Agile-DevOps synergy and revolutionize your organization's software delivery. [Click here](https://technogeekscs.com/how-do-agile-and-devops-interrelate/) to dive into the captivating world of Agile and DevOps interrelation.