teleren/devto huggingface dataset:
Baby Coder's First Game: Mancala
Tags: python, beginners, codenewbie, gamedev
Published: 2023-05-23 19:20:39

I have done the thing!

I've had the idea for this [Mancala](https://github.com/LCerulean/Mancala) project for a while. In the process of learning my first coding language (Python) I've come across a few game tutorials that I really enjoyed working through, although they seemed monumentally complicated to me at that early stage in my learning journey. Coding the computer to make not only random game moves, but to find the best moves fascinated me, so I tucked that information away for a day when I would understand and be proficient enough with Python to implement the concept in my own work. Now at the end of [Codecademy's](https://www.codecademy.com/learn) fantastic _Intro to Programming_ course, I finally have the skills to do just that.

Why Mancala? I've seen games like Rock, Paper, Scissors and Tic-Tac-Toe everywhere, and although I'm sure someone has already built Mancala with Python, I have not yet come across it yet. I wanted to make sure I was making something different enough from the tutorials I had already seen or worked through to ensure that I could build, from scratch, a well functioning game that had the computer making good choices for its moves _most _of the time. To give the human player a fighting chance at winning the game I implemented the 'best moves' for the computer for any available free moves and used 'random moves' otherwise (rather than have it steal all the player's stones). I plan to in the future further build upon this project to implement different levels of difficulty for the player to choose from. Mostly because I'm a perfectionist and can't leave stuff alone.

There's still a lot to learn, but this felt like a monumental success and I'm excited for the future.
PHP variadic
Tags: php, beginners, programming
Published: 2023-05-23 19:08:06

Variadic functions accept a "non-fixed" (a.k.a. variable) number of arguments.

The term is used for [variable-length argument lists](https://www.php.net/manual/en/functions.arguments.php#functions.variable-arg-list).

## Old fashion vs. `...`

The old way of writing variadic functions would be:

```PHP
function myFunc()
{
    $args = func_get_args();
    print_r($args);
}
```

But you can use the `...` token instead (since 5.6):

```PHP
function myFunc(...$args)
{
    print_r($args);
}
```

You can even have several "fixed" arguments and **a** variadic argument:

```PHP
function myFunc($param1, $param2, ...$args)
{
    print_r($param1);
    print_r($param2);
    print_r($args);
}
```

In such case, there can be **only one variadic argument**, though, and it must be placed **after** other fixed arguments.

_N.B.: To prevent any fatal error, always place the variadic argument at the end of the signature._

## When to use?

When you need to pass an unlimited number of arguments to a function.

The inbuilt `printf` or `sprintf` are good examples of variadic functions.

## Typehinting

```PHP
function myFunc(Post ...$posts)
{
    print_r($posts);
}
```

You can typehint variadic arguments, but the variadic parameter will be treated as an array, which is convenient to create loops and conduct common operations on arguments.

## Variadic arguments in constructors

```PHP
class Bike {
    private $color;

    public function __construct(private string $model, ...$options) {
        $this->color = $options['color'] ?? 'Blue';
    }
}
```

_N.B.: you can't promote variadic arguments._
Code Zen Track Action
Tags: githubhack23, gpt3, githubactions, productivity
Published: 2023-05-23 19:04:52

## What I built 
A Github action that responds with jokes, motivational quotes or any advice from your favourite character using GPT API leveraging the Github API to analyze the developer's GitHub history. This can be really helpful for developers to maintain their code zen by providing helpful suggestions to help them avoid burnout and frustration. 

It aims to prioritise mental health and provide tailored prompts and responses to empower developers in their journey towards better well-being, productivity, and overall satisfaction. 


### Category Submission: 
Maintainer Must-Haves

### App Link
https://github.com/marketplace/actions/code-zen-track-action

### Screenshots 


![Code Zen Track Issue 1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/snkfgm5qixfzg2t7h63w.png)


![Code Zen Track Issue 2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o8feo1g3d1m9wrvc6qfd.png)


### Description 

Code Zen Track Action is a Github action that provides GPT responses for the prompt generated using the user's Github usage history. This enables developers to find scheduled reminders in their repository's issues to let them know to prioritise their mental health using quotes, jokes or any advice. The action can be configured to what persona, tone and operative clause that the response should take !

### Link to Source Code 
https://github.com/antoprince001/code-zen-track-action

### Permissive License 
MIT

## Background (What made you decide to build this particular app? What inspired you?) 

Developers tend to be highly invested in their work at times and forget to take occasional breaks or get anxious over a lot of things. It could be maybe if a ci/cd pipeline keeps failing or they feel their github contributions are not getting appreciated. Feeling under appreciated might make the devs lose their motivation. 
So similar to apps that remind devs to take a break, this github action can provide suggestions based on the user github history and be scheduled to trigger in periodic intervals and create an issue in the repo. But instead of just receiving a generic recommendation, you can set the words to follow the pattern of your favorite character , set the tone and define whether you want some wise words or a joke or even just honest opinion 

### How I built it (How did you utilize GitHub Actions or GitHub Codespaces? Did you learn something new along the way? Pick up a new skill?) 
It is developed as an custom Github Action using javascript template as a starting point. It also makes use of Github and OpenAI API for the action to run. 

### Additional Resources/Info
Created with love and passion. I am grateful for developers
@sharmilas22 and @hemanthhari2000 , who collaborated on this open source project.
Eco-Friendly Packaging and Sustainable Solutions for a Greener Future
Published: 2023-05-23 18:50:56

In today's world, the importance of eco-friendly practices and sustainability cannot be emphasized enough. As consumers become more conscious about the environmental impact of their choices, businesses are stepping up to the challenge by adopting eco-friendly packaging solutions. In this blog post, we will explore the significance of [eco-friendly boxes](https://blackbirdpackaging.co.uk/product-category/custom-eco-friendly-boxes/
) and discuss sustainable solutions that can contribute to a greener future.

**The Environmental Impact of Packaging**:
Packaging plays a crucial role in our daily lives, but it also has a significant environmental footprint. From excessive use of plastic and non-recyclable materials to the emission of greenhouse gases during production, traditional packaging practices contribute to pollution, waste, and resource depletion. By understanding the environmental impact of packaging, we can better appreciate the need for eco-friendly alternatives.

**Benefits of Eco-Friendly Packaging**:
Eco-friendly packaging offers a multitude of benefits that extend beyond reducing environmental harm. Firstly, it helps minimize waste by utilizing recycled or biodegradable materials, thereby decreasing landfill contributions. Secondly, sustainable packaging solutions can help conserve natural resources by utilizing renewable materials or employing efficient manufacturing processes. Lastly, eco-friendly packaging aligns with consumer preferences, allowing businesses to attract environmentally conscious customers and build brand loyalty.

**Recyclable and Biodegradable Materials**:
One of the most effective ways to achieve eco-friendly packaging is by using materials that are easily recyclable or biodegradable. Materials like cardboard, paper, and plant-based plastics provide viable alternatives to traditional packaging materials, reducing the environmental impact significantly.

**Minimalist and Efficient Design**: 
Another sustainable approach is to focus on minimalist packaging designs that eliminate unnecessary components and excess materials. Streamlined packaging not only reduces waste but also lowers transportation costs and energy consumption during production.

**Renewable and Compostable Resources**: 
Embracing renewable resources such as bamboo, hemp, or corn-based plastics can contribute to sustainable packaging practices. Additionally, compostable packaging made from organic materials allows for safe dihttps://blackbirdpackaging.co.uk/product/custom-printed-two-piece-boxes/
sposal, minimizing the burden on landfills.
[More information visit blog](url)
Entendiendo Docker.
Tags: docker, devops, spanish
Published: 2023-05-23 18:42:19

Los contenedores son una tecnología que ha venido a revolucionar muchos de los aspectos de como es que se maneja la infraestructura tecnológica y el desarrollo de software. Docker es la tecnología de contenedores que yo personalmente ocupo.

![Docker logo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m5kucpoz0383stjqvsff.png)

El concepto es relativamente sencillo, un contenedor es un ambiente controlado en donde tienes la posibilidad de configurar un sistema operativo, un framework o una herramienta y funcione dentro del mismo contenedor sin que sepa que hay en el exterior. Sinceramente hay un antes y un después del uso de contenedores, por ejemplo al desarrollar en un Stack de tecnología Linux, Apache, PHP y MySQL (LAMP) yo tenia que instalar todo eso por separado y uno de los mayores inconvenientes que tenia era la incompatibilidad. Con Docker eso se soluciona ya que puedes crear un Stack (conjunto de contenedores) que corran por ejemplo con una versión especifica de PHP y MySQL y otro Stack que corra en diferentes versiones y no haya problema porque están por separado no habría conflictos.


![Pull Docker image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hwoqbuofmnyippcw3pww.png)

Vamos a hacer un ejemplo sencillo de como correr un contenedor con Ubuntu. Debes de tener instalado Docker en tu computadora si aún no lo tienes puedes ir a este sitio: https://docker.com/products/docker-desktop/… hay para todos los sabores y colores de SO. En tu terminal debes de ejecutar lo siguientes comandos.

1. Obtener le imagen de Docker Hub.


![Pull Docker image with version](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rimz7l6st0zgofoxmuwj.png)

Esto obtendrá la última versión de Ubuntu disponible en Docker Hub aún que también puede especificar la versión como se muestra a continuación.

![Run container](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kbnmt70wc1t6chmzopp5.png)

2. Levantar el contenedor de Ubuntu.

Acá lo que estamos haciendo es decirle que vamos a levantar la imagen que hemos ido a descargar de Docker Hub y que la corra, la opción --rm quiere decir que cuando nos salgamos del contenedor este dejara de existir.


![Run container](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nzs1ln0fh7fpm4he6rgm.png)

Y así ya tendrás corriendo un contenedor con Ubuntu para lo que necesites, como por ejemplo hacer pruebas o lo que se te ocurra. Hay muchas imágenes disponibles en https://hub.docker.com desde MongoDB hasta Composer, Apache, etc. Si este articulo te gusto o aprendiste algo nuevo te agradecería que me siguieras y compartieras mi contenido. Gracias.
PR Summary using Open AI and Github actions
Tags: githubhack23
Published: 2023-05-23 18:19:06

## What I built 

PR Summary is a GitHub Action that generates a summary of a pull request (PR) and adds it as a comment to the PR. The summary includes the PR title, description, and a generated summary of the changes made in the PR.


### Category Submission: 

Maintainers Must-Have: Make the lives of Open Source maintainers easier.


### App Link


[https://github.com/skarthikeyan96/PR-Summary](https://github.com/skarthikeyan96/PR-Summary)


## How to use the action

```
name: PR summary
on:
  pull_request:
    types:
      - "opened"

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - name: Check out repo
      uses: actions/checkout@v2
    - name: Use Node
      uses: actions/setup-node@v2
      with:
        node-version: '16.x'
    - name: Install deps
      run: npm install
    - name: Run PR summary action
      uses: skarthikeyan96/typescript-custom-action@0.0.1
      with:
        OPENAI_API_KEY:  ${{ secrets.OPENAI_API_KEY }}
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```

### Screenshots 


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



### Permissive License 

MIT
Beep too loud? A Quick Fix.
Tags: windows, tips
Published: 2023-05-23 17:56:02

---
title: Beep too loud? A Quick Fix.
published: true
description: Tired of that annoying "beep" in Windows? You are not the only one!
tags: windows, tips
cover_image: https://cdn.midjourney.com/1155e8f2-5f96-4e5c-9e93-5cf25e26f4be/0_2.png
---

The annoying "beep" error sound in Windows can be quite annoying, and I'm not the only one who thinks so. There are two excellent open source tools that can help with this problem: [EarTrumpet](https://github.com/File-New-Project/EarTrumpet) i [Volume2](https://github.com/irzyxa/Volume2) and both can be easily installed using the Scoop command `scoop install eartrumpet volume2`. 

If you're specifically looking to reduce the volume of that one annoying "bing" Windows error notification, I've opted to implement a solution from the post on [how to reduce the volume of annoying Windows notifications](https://blog.zhaytam.com/2019/02/08/lower-windows-10-notifications-volume/) as this is my preference.

You need to open a PowerShell window as an Administrator and copy and paste the following

```
$n="Windows Notify System Generic"; $p = "${Env:WINDIR}\Media"; cp "$p\$n.wav" "$p\$n.wav.bak"; taskkill /f /im explorer.exe; explorer.exe; curl.exe -o "${p}\${n}.wav" "https://blog.zhaytam.com/audio/Windows-Notify-System-Generic.wav"
```

Don't worry, there needs to be a "glitch" as the Explorer process needs to be restarted as it probably holds a lock on the desired audio file.
CONNEXT
Tags: githubhack23, beginners, opensource, flutter
Published: 2023-05-23 17:54:32

###What I built
An app that helps you crack India’s top competitive exams, where you can share your queries and concerns with people in the same area of interest.

### Category Submission: Phone Friendly

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

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

### Description 
The number of aspirants appearing for competitive exams, especially in medical and engineering fields is very high in India. Around 8 lakhs candidates appear for Joint Entrance Examination (JEE) to get into the top engineering colleges like IITs and NITs and around 20 lakhs for National Eligibility cum Entrance Test (NEET) for medical schools every year in India. It’s crucial to have proper guidance and planning to crack these tests. To resolve this, we have planned for an application that can be used by both students and the experts to have a better communication, further leading the aspirants to pass these tests with flying colors.

Most of the applications that are available in the market only focus on the study materials and mock test, but not the mental health and stress the students endure during their preparation. It will be helpful to have a community that goes through same phase and share the stories and inspirations you have attained during the journey.

### Link to Source Code    [Github](https://github.com/binshadhbu/connext)


### Permissive License 
https://github.com/binshadhbu/connext/blob/master/LICENSE

### How I built it 
Through GitHub, we learned how to create branches and merge our projects, Grasped some knowledge of flutter as a new skill. We collaborated via github codespaces to complete it. We learned how to manage time, as we were new to flutter and it took time to apply certain widgets, dependencies and plugins to our project. Dart language was also crucial in the making. We used firebase to store the chats and comments into the cloud and display it.

### Additional Resources/Info
Figma for design
Flutter for front end
Firebase for database and authorisation
git and github for version controller
CodeSpace for collaboration

###participants
Binshadh Bashher [@binshadh](https://dev.to/binshadh) [Link](https://www.linkedin.com/in/binshadh-basheer-369476227?lipi=urn%3Ali%3Apage%3Ad_flagship3_profile_view_base_contact_details%3BHb6Bh3veS0uNy6kw%2BSPXZA%3D%3D)
Sana  [@anascmohamed ](https://dev.to/anascmohamed )
Design Sprints: A Proven Framework for Rapid Problem-Solving and User-Centric Design
Published: 2023-05-23 17:44:20

Design sprints are time-constrained, collaborative workshops that help teams rapidly iterate and find solutions to design challenges. They were popularized by Google Ventures and are commonly used in the field of user experience (UX) design.

During a design sprint, cross-functional teams, including UX designers, product managers, developers, and stakeholders, work together intensively over a short period, usually five days, to address a specific problem or develop a new product or feature. The goal is to quickly validate ideas, gather feedback, and make informed decisions about the design direction.

For an entry-level UX designer, participating in a design sprint can have several benefits:

1. Immersive Learning Experience: Design sprints expose entry-level designers to a fast-paced, collaborative environment where they can gain hands-on experience. They get to work closely with experienced professionals from different disciplines, observe their workflows, and learn best practices.

2. Holistic Understanding: Design sprints emphasize cross-functional collaboration, enabling entry-level designers to see the bigger picture. They learn to consider not just the design aspect but also the technical, business, and user perspectives, enhancing their ability to create well-rounded solutions.

3. Rapid Prototyping and Validation: Design sprints emphasize quick iteration and prototyping. Entry-level designers get the opportunity to rapidly ideate, sketch, wireframe, and build interactive prototypes. They can observe how their designs are validated or invalidated through user feedback and testing, gaining insights into the iterative design process.

4. Collaboration and Communication Skills: Design sprints require active participation and collaboration with team members. Entry-level designers learn to effectively communicate their ideas, actively contribute to discussions, and incorporate feedback from stakeholders. These skills are essential for success in the field of UX design.

5. Problem-Solving and Decision-Making: Design sprints involve tackling complex problems and making design decisions within a tight timeframe. Entry-level designers learn to think critically, analyze options, and make informed choices. This experience hones their problem-solving and decision-making skills, which are vital in the UX design process.

6. Portfolio Enhancement: Participating in design sprints provides entry-level designers with tangible outcomes, such as prototypes, wireframes, or user insights, which can be showcased in their portfolios. These artifacts demonstrate their ability to contribute to real-world projects and enhance their employability.

In General, design sprints offer entry-level UX designers an immersive, collaborative experience that accelerates their learning, expands their skill set, and prepares them for the challenges of the industry. It equips them with practical knowledge, exposes them to different perspectives, and helps them build a strong foundation in UX design methodology.
Builtin token generator in Node
Tags: javascript, beginners, node, tutorial
Published: 2023-05-23 17:37:34

_For those who are already familiar with the concept, you can skip the explanation and directly access the code snippet: <a href="#code">Go to Code</a>. For those who are interested in learning about it, I encourage you to continue reading below._

<h2 id="Introduction">Introduction</h2>
In modern web applications, JSON Web Token (JWT) authentication is a widely adopted method to secure APIs and authenticate users. The tokens are generated using cryptographic algorithms, such as HMAC or RSA, among others, to ensure both their uniqueness and security. These algorithms play a crucial role in generating secure tokens that can be trusted for authentication and data integrity.
For the generation of these tokens, it requires a secret. secret is a key that is used sign and verify the integrity of the token. 

Choosing a strong secret key is crucial for secure token verification. Using simple and easily guessable secrets like "secret123" or "catdog123" can make the token verification process vulnerable to unauthorized intruders. In the early stages of my Node.js journey, I had used such secrets. It is important to select a unique and complex secret key to enhance the security of the tokens and in this blog post, we will explore how to generate secure random token easily in the console using NodeJs and it's builtin crypto module.

**Prerequisites**:
Before proceeding, make sure you have Node.js installed on your machine. You can download the latest version from the official Node.js website (https://nodejs.org).

<h2 id="code">Code</h2>
To generate a secure secret key, you can follow these steps:
```javascript
require('crypto').randomBytes(64).toString('hex')
```
1. Copy the above line of code:
2. Open terminal or console.
3. Run `node` on the terminal or console.
4. Paste the code.
5. Press enter to run the code.

![example of running crypto to create secret](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/72e7cycxbo4dc9jlrdnx.png)

Remember to save and bookmark this blog post so that you can easily refer back to it whenever you need to generate a secret key for your future projects.