teleren/devto huggingface dataset:
The REST Template Project
Tags: webdev, go, api, opensource
Published: 2022-08-03 15:50:45

## Github Repository: [speakeasy-api/rest-template-go](https://github.com/speakeasy-api/rest-template-go)

Building a RESTful API can be daunting for developers who have never done it before (and even those who have). There are a number of choices and best practices that need to be considered as part of an API’s implementation; it can be hard to know where to start. That’s why we’re pleased to announce the [RESTful API template project](https://www.speakeasyapi.dev/templates). Over the coming months, we will release RESTful API templates for the most used programming languages – [starting today with Go](https://github.com/speakeasy-api/rest-template-go).

This is the template that our team forks from when we are building new APIs. The repo contains a CRUD API for a ‘user’ resource which incorporates the best practices needed for a basic REST service. Our hope is that developers can use this as a foundation upon which to build their own sets of APIs.

The service represents our team’s opinionated stance about what makes for good RESTful API code. Specifically, the template gives you a service which is: 

- **Entity-based**: The resources available should represent the domain model. Each resource should have the CRUD methods implemented (even if not all are available to API consumers). In our template, we have a single resource defined (users.go). However other resources could be easily added by copying the template and changing the logic of the service layer.

- **Properly Abstracted**: The transport, service, and data layers are all cleanly abstracted from one another. This makes it easy to apply updates to your API endpoints.

- **Consistent**: It's important that consumers of a service have guaranteed consistency across the entire range of API endpoints and methods. In this service, responses are consistently formatted whether successfully returning a JSON object or responding with an error code. All the service's methods use shared response (http.go) and error (errors.go) handler functions to ensure consistency.

- **Tested**: We believe that a blend of unit and integration testing is important for ensuring that the service maintains its contract with consumers. The service repo therefore contains a collection of unit and integration tests for the various layers of the service.

- **Explorable**: It is important for developers to be able to play with an endpoint in order to understand it. We have provided Postman collections for testing out the REST endpoints exposed by the service. There is a Bootstrap Users collection that can be run using the Run collection tool in Postman that will create 100 users to test the search endpoint with.

We look forward to hearing from the community what they think of the repo. We’d love to know what else people would want to see included in a template: versioning, pagination, authentication?  Would people want to see more advanced features?
What's new in Tailwind DX 2.0
Tags: tailwindcss, css, html, webdev
Published: 2022-08-03 15:35:45

Thought I'd share some upcoming features of my Tailwind CSS DevTools Extension for Chrome.
{% youtube jyt_MSHoAtk %}

[Get the extension here](https://chrome.google.com/webstore/detail/tailwind-dx/fojckembkmaoehhmkiomebhkcengcljl)

[More info on our website](https://gimli.app/tailwinddx.html)
🇬🇧 Webinar: Dive into Process Analytics
Tags: bpmn, visualization, analytics, replay
Published: 2022-08-03 15:27:00

The **[Process Analytics project](https://process-analytics.dev/?utm_source=dev.to&utm_medium=display&utm_campaign=webinar_en)** consists of **open source libraries and components** that allow you to get a visual overview of your business process and the process execution data.

---

On July, 5th 2022, Alejandro Rondón and Thomas Bouffard showcased an integration use case through a ticketing application. 

ℹ️ The presentation is designed to help you understand how your processes are executed and how to optimize your business processes. 

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

🎥 Topics covered include:
* What different process components are available to you
* How the [bpmn-visualization](https://github.com/process-analytics/bpmn-visualization-js/) TypeScript library can be used to monitor processes
* How to leverage execution context of processes
* How to drill down and navigate between the process and the Bonita administration pages

---

In the meantime, if you want to stay on top of the latest news and releases from the Process Analytics project, follow us through:
* Website: [https://process-analytics.dev](https://process-analytics.dev/?utm_source=dev.to&utm_medium=display&utm_campaign=webinar_en)
* Twitter: [@ProcessAnalyti1](https://twitter.com/ProcessAnalyti1)
* GitHub: [https://github.com/process-analytics](https://github.com/process-analytics)
I just started 100DaysOfCode
Tags: beginners, 100daysofcode, programming, learning
Published: 2022-08-03 15:15:34

For the las few weeks I've been struggling with myself and my programming skills. After searching what to do and what to learn I found the 100DaysOfCode challenge and a course in Python about it. I've been doing this course for 7 days now, and even if my general knowledge is superior to the first lessons I'm enjoying it a lot and learning a lot. I think this challenge it's an excellent idea to learn when you are stuck.
Hello World!
Tags: python, azure, aws, hello
Published: 2022-08-03 15:02:00

Hello World! o mejor dicho,
```python
print("Hello World")
```
Estaré escribiendo en este blog artículos asociados a temas que voy revisando en lo que hago o aprendo en mi día a día. Los temas podrían ser acerca de #python, #azure, #aws y #ciberseguridad

![You Rock](https://media.giphy.com/media/jLK74MUW07RaU/giphy.gif)


La idea es ir armando una base técnica de conocimientos online para referencia propia y quien sabe si le puede servir a alguien más, mucho mejor.
Git Doesn't Forget! A Short Story
Tags: git, tutorial, beginners, webdev
Published: 2022-08-03 14:25:49

If you are a web developer, you should be familiar with Git.

Git is useful even if you are working on your own.
It allows you to track files and changes in your project.
You can see it as a diary of whatever happened to your project.

## The Story

I started to work on a project created by other developers. 

Just think of a React or Angular application.
However, for some reasons, package-lock.json was included in .gitignore.

As a consequence, Git would forget about package-lock.json whenever I would commit. 
All in all, this is not a big deal, even though it is a good practice to let Git tracks changes to package-lock.json.

### Changes in CI/CD
Someone decided that package-lock.json should be included and used for some CI/CD purpose. I won't dive on those reasons, but I had to add package-lock.json to the repo.

### Not So Simple
The first thing I tried was to remove package-lock.json from .gitignore. Simple right? But it doesn't work.

My next commits would not include package-lock.json/

### Solution

Thanks to [this answer on SO](https://stackoverflow.com/questions/1274057/how-do-i-make-git-forget-about-a-file-that-was-tracked-but-is-now-in-gitignore), I understood that Git will continue to track any files that are already being tracked.

So, first of all, we need to remove all items from the Git index. This is not affecting files in your directory or repository. It just cleans the Git index.

```
git rm -r --cached .
```

Second, we need to add them back. The following command update the Git index as we would expect.

```
git add .
```

The two commands above remove and update the entire index.
A more elegant solution could just touch the file we are interested in.

```
git rm --cached <file>
// or
git rm -r --cached <folder>
```
Explain the difference between shell, console, terminal, command line, etc. like I'm five
Tags: anonymous, discuss, help
Published: 2022-08-03 14:02:32

_This is an anonymous post sent in by a member who does not want their name disclosed. Please be thoughtful with your responses, as these are usually tough posts to write. Email sloan@dev.to if you'd like to leave an anonymous comment or if you want to ask your own anonymous question._
JavaScript : Mixins
Tags: javascript, webdev, programming, react
Published: 2022-08-03 12:04:00

Hi everyone!... Hope everything is well at your side. Lately I was working with JavaScript objects and came across a scenario to inherit from two different classes. But JavaScript allows to extend from only one class. There will be only one [[prototype]] for an object. So I was in a deadlock to have my class inherit properties from both the object. Let's look at the problem statement first..

##Problem Statement

I have User base class and a extended Admin class having additional functionality along with the base class functionality. Admin is responsible for creating Group, deleting and removing user.
![User class](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yt07om2elll701ss9qke.png)

Now I have User class holding base methods and Admin class that inherits base class methods as well as it has his own method to **setThemes** and **removeUser** methods.

![Admin class](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8s6k4eeud40kpeicmuey.png)

The Group class will have all the methods to create, update, delete group and remove user from group. 

![Group class](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/px4z0p2o1gbxy5szvlfd.png)

Now Admin class needs access to Group class methods to create, update or delete group and remove user from group. Admin cannot extend Group class.

##Proposed Solution

We can create Group class and assign all of its methods to Admin prototype. This way Admin will have access to all of the methods of Group class without inheriting it, this method is what called as Mixin.

 
![Mixin Class](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qjzyb6mxkxi3sn2ouvm3.png)

and this could be used as 


![Mixin class uses](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bqxos0fcn60mz4evlcyr.png)

createGroup, updateGroup, deleteGroup and removeUser methods of Group class got copied to Admin class and we can use them using admin object.
Now if I want inherit another class from User class suppose GroupLead who also need access to Group class methods I can make use of mixin to use those methods without duplicating them in GroupLead class.

###Advantages
- Function Reuse
- Reduce code duplication

###Disadvantage
- Mixed-in Function can led to confusion over the source of methods.

That's all for today until then, Happy Coding!

<img src="https://media.giphy.com/media/kOnoObmFUE0k8/giphy.gif" width="100%"/>
Question Friday #3: What is you average day like?
Published: 2022-08-03 13:54:00

Share what a typical day for you is like.
Even if you think your day is mundane, share anyways.

Let's see if our days are similar :) 
**I'll start**:
I get to the office for 9:30 am (Frontend Developer).
As soon as I get to my desk, I turn on my Mac, check slack, my calendar and my emails to get set for the day. 
Depending on the day I will normally have a chat with my manager, about how I am getting along with work and to see what is to be planned for the week in terms of work. We go through trello, and assign jobs that I will have to do for the week, and see what jobs are coming into our department, so that we can prepare for them.
Once the meeting has concluded, I will commence work.
As everyday is different, I may be working on general site maintenance, site updates, new sites or internal projects.
Through out the day I may have to hop on a call or head to one of our pods for a meeting. 
By 1pm, it’s lunch time which mean our company provides some amazing and delicious hot food. 

On occasion, during lunch during lunch, a group of us will head to the games room and play some pool, till the end of lunch 

After lunch, I make a coffee and head back to my desks and get back to work till 6pm,
Login Authentication
Tags: javascript, webdev, beginners
Published: 2022-08-03 13:52:47

//disclaimer, introduction
//overview of the project
//explain each the techs
//show code
This project is a beginner's overview on how to create a login 
authentication.
# Overview
Login authentication is how the web keeps track on users preference by storing individual the data in a server.
This project is done by using JWT, express.js, and bcrypt.

### What is JWT?
JWT, or JSON Web Token, is an open standard used to share security information between two parties — a client and a server. Each JWT contains encoded JSON objects, including a set of claims. JWTs are signed using a cryptographic algorithm to ensure that the claims cannot be altered after the token is issued. In other words JWT connects the server and the user.

### What is crypt?
A library to help you hash passwords. It's slowness and multiple rounds ensures that an attacker must deploy massive funds and hardware to be able to crack your passwords.

### What is NodeJs?
Is an open-source, cross-platform runtime environment that allows developers to create all kinds of server-side tools and applications in JavaScript.

### What is ExpressJs?
Is the most popular Node web framework, and is the underlying library for a number of other popular Node web frameworks. It is used for designing web apps, apps that run on web browser, easily and quickly.
SonarQube windows setup
Tags: programming, tutorial, testing
Published: 2022-08-03 13:52:42

- Download [sonarcube](https://www.sonarqube.org/downloads/?gads_campaign=Asia-SonarQube&gads_ad_group=SonarQube&gads_keyword=sonarqube) and [sonar-scanner](https://docs.sonarqube.org/latest/analysis/scan/sonarscanner/). 
Extract both zip files to to C:\

- At `C:\sonar-scanner\conf\sonar-scanner.properties` paste this:

```
#Configure here general information about the environment, such as SonarQube server connection details for example
#No information about specific project should appear here

#----- Default SonarQube server
sonar.host.url=http://localhost:9000

#----- Default source code encoding
sonar.sourceEncoding=UTF-8
```

- Add window environment variables
`ControlPanel > SystemAndSecurity > System > AdvanceSystemSettings > Environment > EnvironmentVariables`
add new path:
```
C:\sonar-scanner\bin
```

- Create a sonarqube project

In your browser go to:
```
http://localhost:9000/
```
Create a project, then save the generated token and the generated command. We will need the command to run the project later.

- On your code, create file called `sonar-project.properties`, paste this:

```
# must be unique in a given SonarQube instance
sonar.projectKey=my:project

# --- optional properties ---

# defaults to project key
# sonar.projectName=My project
# defaults to 'not provided'
#sonar.projectVersion=1.0
 
# Path is relative to the sonar-project.properties file. Defaults to .
sonar.sources=.
 
# Encoding of the source code. Default is default system encoding
#sonar.sourceEncoding=UTF-8
```
Change projectKey same with the name of created sonarqube project.

- Run the sonarqube

Run `C:\sonarqube\bin\windows-x86-64\StartSonar.bat`

Paste the saved generated command inside your project to run the sonarqube.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dctpslkr04tbix4ohyzt.PNG)

Go back to `http://localhost:9000`
Now you can see the vulnerabilities and given suggestion by sonarqube.
ReactJS + ViteJS
Published: 2022-08-03 13:52:41

<h2>What is ViteJS?</h2>

<p>In simple terms, it is a web builder that focuses on speed</p>
<p>Compared to the traditional way of using create-react-app that uses webpack, this has much faster build time</p>

<h2>How to Install?</h2>

```
npm create @vitejs/app
```

it will prompt you on the settings that you want, or if you want to use default settings, use this:

```
npm init vite@latest [app name] -- --template react
```

cd [app name], then install the dependecies:

```
npm install
```

time to run the project by typing:

```
npm run dev
```
Day 2 of Elm- Partial Application
Tags: webdev, beginners, elm, functional
Published: 2022-08-03 13:50:22

Today, we learned about **Lists** and **Partial Application**. Lists are similar to Javascript arrays except that they cannot contain elements of the same type. It is defined similarly as Javascript arrays with square brackets `[]`. Boring stuff.

The interesting thing we learned today was **Partial Application**. A partially applied function is a function called with some of its arguments omitted. This is a fairly standard issue in Javascript, PHP, and I imagine other programming languages. What I find interesting is how Elm deals with the problem as a functional programming language.

The difficulty in learning Functional Programming as say, a Javascript or PHP developer, is the conflict between your mental model of different concepts and how they are actually applied in FP.

In Javascript, when an argument is omitted, the function uses a default argument in its place. The default argument is `undefined` [unless the developer specifies one] and the function executes with this default argument. Boring stuff. For example:

```javascript
function pluralize(singular, plural, quantity){
  // ...
}

pluralize('boy', 'boys') // the third argument here will be `undefined`.
```

```javascript
function pluralize(singular, plural, quantity = 1){
  // ...
}

pluralize('boy', 'boys') // the value 1 will be passed to pluralize as the third argument.
```

In Elm, the concept is entirely different. If you omit an argument, the function will be partially executed and another function will be returned to you that takes the missing argument and completes the evaluation. Let's see the same example in Elm:

```elm
pluralize singular plural quantity = 
  if quantity === 1 then
    singular
  else
    plural

pluralize "boy" "boys" -- will return an anonymous function that I will express as `f` that takes a number and finishes the evaluation of pluralize:

f quantity = pluralize "boy" "boys" quantity.
```

This is so interesting and different from what I am used to I have written various versions of this to make it stick. 

Another example I adapted from the [the intro to elm](https://frontendmasters.com/courses/intro-elm/) to make it sink in:

![Partial Application in Elm explained in code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xqomrjueyn8wg3mjro7q.png)

Elm is great. Pass it on!
Communities Need Support
Tags: codenewbie, devrel, community
Published: 2022-08-03 13:50:11

---
title: Communities Need Support
published: true
description: Building Community is a long game that requires support every step of the way.
tags: codenewbie, devrel, community
canonical_url: https://bekahhw.github.io/Communities-Need-Support
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
---


I've been spending a lot of time engaging with different types of communities, taking to community builders, learning more about community building, and organically growing a couple of communities. And one of the takeaways I have from these experiences is that communities don’t scale if they only has one person supporting it. So what do communities need to grow?
  
## Buy-in
You can’t scale unless there’s buy-in. You need to have a many-to-many relationship. That shouldn’t be people just from your team or company. But while your community is being built, you’ll need people from your company/team to be the support structure. To hold things up until they’re settled. And remember, your team will be the example for the community. Great leaders create great leaders.
    
## Responsivity
You need to be responsive. There’s almost nothing worse than entering a quiet slack or discord. It’s almost like entering a large cafeteria and everyone is eating in silence. They’re there, you can see them, but no one is talking. I don't know about you, but I'd turn around and walk the other way. You don’t need to immediately respond, and you should give your community the opportunity to respond to each other, but unanswered questions are a sign of an unhealthy community.
    
## Time
Community is a long game. You don’t grow a thriving community overnight. It takes time and there often aren’t clear metrics to track what you’re doing. Community needs to grow authentically. Unless you already have an invested community--like Jamstack did, for example--then you have to build it from the base, brick by brick, learning about what your community wants, who they are, where they want to be, what they need.
        
Just a note on the challenges you might face if you don’t have buy-in: Not only will you have to carry more of the weight of the community, but you’ll be constantly trying to prove yourself and beg for support from people who don’t understand or want to have community interaction added to their plates. This may be the biggest impediment to your success. Starting with support is the best way to grow a community. It's not the only way, and you can certainly start without that, but the challenge to growing a community and maintaining community health will be greater.
Bootstrap Progress Bar Percentage Using Jquery
Tags: javascript, webdev, html, css
Published: 2022-08-03 13:48:12

In this bootstrap progress bar, we used jquery with a javascript method. For increment, we used the javascript setTimeout method, and also we used some basic javascript DOM to change value dynamically.

We used bootstrap 4 animated and background progress bar components. Also, we used some background classes for the progress bar with different colours.

Make it yours now by using it, downloading it, and please share it. we will design more elements for you.

[Source code](https://w3hubs.com/bootstrap-progress-bar-percentage-using-jquery/)
Paste CSS code, save and host it online
Tags: css, paste, hosting
Published: 2022-08-03 13:44:00

Are you a web developer who is looking for an easy way to save and host your CSS code? If so, then you should check out [StaticSave.com](https://staticsave.com). 

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

With StaticSave, you can easily paste your CSS code and save it online. Plus, StaticSave makes it easy to share your code with others by providing a link that you can send to them.

What's great about StaticSave is that it's free to use and there are no ads or pop-ups in your hosted conent. Plus, your code is stored securely on our servers so you don't have to worry about losing it. 

And if you ever need to access your code again, simply login to your account and retrieve it from there. Also you can update the code whenever you like.

Read More: [Paste CSS code, save and host it online with Staticsave](https://staticsave.com/blog/paste-css-code-save-and-host-it-online)