teleren/devto huggingface dataset:
Formatting and linting in Go 📜
Tags: opensource, ssgo, go
Published: 2022-11-03 21:55:07

Hey there! Thanks for checking in again! This week, I've been trying to set up formatting and linting for my [SSGo](https://github.com/devils2ndself/SSGo) project. Maybe you'll get some valuable information from my experience!

## Formatter

Unlike many languages, Go actually has a built-in formatter called [gofmt](https://pkg.go.dev/cmd/gofmt). You can run `gofmt -s -w .` in order to format all files in current directory.

But, unlike many formatters  for other languages, Go actually has a specific pre-defined setting for all files. This was actually Go development team's standpoint to have all Go code look the same, so developers aren't confused by formatting differences.

## Linter

Unlike gofmt, Go does not have a built-in linter. It does have `go vet` command, which checks for checking actual errors in code, but most of the times it isn't enough to keep the project clean. 

There is however a tool called [golangci-lint](https://golangci-lint.run/) that does a great job, however it needs to be downloaded separately.

Being a JS/TS developer, I am used to being able to add dependencies/tools via package managers, and having to download a linter separately isn't very convenient for the contributors.

But other than that, using `golangci-lint run` command did a great job, and all of the settings for the linter can be defined in `.golangci.yaml` file.

## VS Code integration

Before I saw any of the separate tools, I was using an official Go extension for VS Code under the code of `golang.go`. It was formatting and linting all my code for me, so I included it to be the formatter in `settings.json` and set the linter as "golang-ci".

This allows for automatic formatting on save and linting, and is much more convenient than having to download linter and run it in CLI manually.

## Summary

When I added everything and wrote a proper CONTRIBUTING.md file, I squashed everything into [one commit](https://github.com/devils2ndself/SSGo/commit/27e773ce57057bd68636eda524aeb9c7f3bede51) and pushed.

There wasn't much to fix to pass the linter, and the formatter simply changed spaces to tabs in variable definition.

If you are a Go developer and know any better solutions then what I have done, please leave a comment. In the end, we are always learning.
Frontend: Starter pack and some...
Tags: webdev, beginners
Published: 2022-11-03 21:45:44

**Software Checklist**
VS Code (lovely environment for interactive coding)
Git (either Gitlab or Github, the alpha dumpsite for all your projects)
LinkedIn (gotta get your name out there... it's never too early)

**About HTML**
HTML is the background which determines what elements/contents are displayed on the page. 
<> - html is always written in these tags
html is 'marked up' because of the tags. it is not a language
each tag correspond to a box or portion.

**About CSS**
CSS is the abbreviation for Cascading Style Sheets. It describes how the html tags are to behave, such as the font size, font colours and many more page characteristics.
CSS is a selector language which allows us to select common tags and describe their properties.

**About JS**
Java Script (JS) is for more dynamic controls or events, such as buttons, toggles, dropdowns, etc.

**Other useful tips:**

- Software developers are never keen on repeating themselves; this means that what's used today stands the chance of being used forever. And here comes Bootstrap, the framework which helps save time and money. Nevertheless, understanding the foundations of using HTML and CSS is the key to an enterprising frontend developer.

- Curious about what's going on those shady sites you visit, try right clicking and select: View source (raw, can allow code to be copied but is not interactive), Inspect (much more presentable, scripts of JS and CSS are embedded).

- On inspecting webpages, you will see common elements: 

  1. The exclamation ! which is a declaration symbol.
  2. The DOCTYPE which must start every page and initiates the html.
  3. A link which loads style files (either bootstrap or custom css) unto the html
  4. a head is the metadata i.e. data that describes the contents of the page.

And on it goes...
Bayarno ID
Tags: nextjs
Published: 2022-11-03 21:44:51

Web App Called "Bayarno ID" Fast Service Access For Shooping, Kon Butuh Opo Tak #Bayarno. Contributions are welcome : [github.com/rasvanjaya21/bayarno-id](https://github.com/rasvanjaya21/bayarno-id)
AWS vs GCP vs Azure
Published: 2022-11-03 21:28:43

When it comes to cloud computing, there are three major players: Amazon Web Services (AWS), Google Cloud Platform (GCP), and Microsoft Azure. Each provider has its own strengths and weaknesses, so it's important to choose the right one for your needs.

Here's a quick overview of the key differences between these three providers:

Amazon Web Services:

- AWS is the biggest and most popular cloud computing platform, with over a million customers worldwide.

- It offers a wide range of services, including storage, databases, networking, and analytics.

- AWS is known for its high availability and reliability.

- Pricing can be complex, with some services being more expensive than others.

Google Cloud Platform:

- GCP is a close second to AWS in terms of size and popularity.

- It offers many of the same services as AWS, but with some unique offerings, such as BigQuery and Google App Engine.

- GCP is known for its ease of use and simple pricing structure.

- Some services can be more expensive than AWS, but overall GCP is often cheaper.

Microsoft Azure:

- Azure is the third largest cloud platform, behind AWS and GCP.

- It offers a wide range of services, including storage, databases, networking, and analytics.

- Azure is known for its strong security features and integration with other Microsoft products.

- Pricing is often cheaper than AWS, but can be complex due to the many services offered.

So, which cloud provider is right for you? It depends on your needs and budget. If you're looking for the largest selection of services, AWS is the clear choice. If you want the simplest pricing structure, GCP is a good option. And if you need strong security features or integration with other Microsoft products, Azure is worth considering.

 Whichever provider you choose, make sure you do your research and select the one that's best for your specific needs.
Pods running in GKE are not mounting their PVs.
Tags: kubernetes, devops, troubleshouting, gke
Published: 2022-11-03 21:17:49

If you have faced the following problem (see the screenshot), then you know probably the specific node where the persistent volume resides is not working properly and more specifically the kubelet is not working properly!

So, I would suggest the following two actions:

- Check the Volume Attachments more details can be found in the following link: https://veducate.co.uk/kubelet-unable-attach-volumes/

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

See also the Google Documentation how to add a new node to the nodepool
https://cloud.google.com/kubernetes-engine/docs/how-to/node-pools

- 
Add a new node in the nodepool and drain the problematic one!

```
kubectl drain <node-name> --ignore daemonsets -- delete-emptydir-data
```

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


I hope you like the tutorial, if you do give a thumps up! and follow me in [Twitter](https://twitter.com/TVelmachos), also you can subscribe to my [Newsletter](https://dashboard.mailerlite.com/forms/167581/67759331736553243/share) in order to avoid missing any of the upcoming tutorials.


#### Media Attribution
I would like to thank [Clark Tibbs](https://unsplash.com/@clarktibbs) for designing the awesome [photo ](https://unsplash.com/photos/oqStl2L5oxI)I am using in my posts.
Cloud Computing : Pros and Cons
Published: 2022-11-03 21:04:15

There's no doubt that cloud computing is becoming increasingly popular, with more and more businesses making the switch to this new way of working. But what exactly is cloud computing, and what are the pros and cons of moving your business over to the cloud?




Cloud computing is simply the delivery of computing services—including servers, storage, databases, networking, software, analytics, and intelligence—over the Internet (“the cloud”) to offer faster innovation, flexible resources, and economies of scale.



There are many advantages to moving your business to the cloud, including:



<u>1. Cost savings:</u> Cloud computing can be a more cost-effective solution than traditional on-premises infrastructure.

<u>2. Scalability:</u> The cloud is highly scalable, so you can easily adjust your computing resources to meet changing business needs.

<u>3. Flexibility:</u> The cloud offers great flexibility, allowing you to quickly deploy new applications and services.

<u>4. Collaboration:</u> Cloud-based solutions make it easier for employees to collaborate and work together on projects.

<u>5. Security:</u> The cloud is a very secure way to store and access data, with multiple layers of security to protect your information.




However, there are also some disadvantages to consider before making the switch to the cloud, including:

<u>1. Dependence on Internet connectivity:</u> Cloud computing requires a reliable and high-speed Internet connection. If your Internet connection is down, so is your access to the cloud.

<u>2. Security risks:</u> Although the cloud is generally a very secure environment, there are always risks associated with storing data online.

<u>3. Limited control:</u> When you move to the cloud, you are giving up some control over your data and applications.

<u>4. Vendor lock-in:</u> Once you commit to a particular cloud vendor, it can be difficult and costly to switch to another one.

If you're considering moving your business to the cloud, weigh the pros and cons carefully to decide if it's the right move for you. 

What some excellent industry use cases? 

Salesforce is a great example of a company that has successfully made the switch to the cloud. This CRM software provider offers its customers a variety of advantages, including cost savings, scalability, flexibility, and collaboration. Another example is Netflix, which uses the cloud to stream movies and TV shows to its subscribers. The cloud has allowed Netflix to scale its business quickly and efficiently to meet the demands of its growing customer base. 

If you're still on the fence about whether or not the cloud is right for your business, consider speaking to a cloud computing expert to get more information. They can help you understand the potential benefits and drawbacks of moving to the cloud, and make a recommendation based on your specific needs and goals. 

Thanks for reading! We hope this article has helped you better understand cloud computing and the pros and cons of moving to the cloud.
What is Server-less Computing?
Published: 2022-11-03 21:03:29

Nowadays, people are talking more and more about "serverless" architectures, "serverless" platforms and even "serverless" programming languages. 


We're going to take a look at what this relatively new term actually means, why it's gaining so much traction and whether or not it's something that's right for your next project.


So, what exactly is "**serverless**"?



At its core, serverless is a way of structuring and building applications that doesn't require any dedicated server infrastructure. In the traditional sense, when we talk about servers, we're usually referring to big, physical machines that are housed in data centers and connected to the internet. These servers typically run an operating system (like Windows or Linux) and host applications and services that are accessed by users over the internet.



With serverless, there are no physical servers involved. Instead, your application code is running on top of a platform-as-a-service (PaaS) provider, such as Amazon Web Services (AWS), Microsoft Azure or Google Cloud Platform. These providers take care of all the necessary infrastructure and server management tasks, so you don't have to worry about it.



One of the key benefits of this approach is that it can save you a lot of money. In the traditional server model, you have to pay for the servers even when they're not being used. With serverless, you only pay for the resources your code uses while it's running. If your code isn't being executed, you don't have to pay anything. This can be a big advantage for small businesses or startups that may not have the budget to invest in their own physical servers.



Serverless computing is also becoming popular because it can make it easier to scale applications and services. When your code is running in the cloud, it's easy to add more resources as needed. This can be a big help if you have an application that experiences spikes in traffic.



If you're considering moving to a serverless architecture, there are a few things you should keep in mind. First, make sure you choose a cloud provider that offers the services and features you need. Second, consider the security implications of running code in the cloud. And finally, be prepared for some changes in the way you develop and deploy your applications.



But if you're looking for a more flexible and cost-effective way to run your applications, serverless computing is definitely worth considering.
Build an Automated Tweet Scheduling Tool with JavaScript
Tags: webdev, api, programming, tutorial
Published: 2022-11-03 20:56:30

A tutorial on building a Twitter automation tool in 40 lines of JavaScript code.

## Under the Hood
The story begins when I was scheduling more than 5 tweets per day. But every time I have to spend 5 minutes for each tweet.

5 minutes = 1 tweet
10 tweets = 50 minutes / day

I thought of saving this time, this work is boring and repetitive and most importantly I can automate it.

## [Hyperfurry](https://hypefury.com/)
This tool helps you to schedule social media marketing and a lot of people use this product to schedule tweets.

But it’s a paid version and I don’t want to give money for a product that I believe I can somehow develop on my own.

## Automated Twitter Marketing
I started thinking seriously to automate the entire twitter task. After doing a bit of research I found this npm module that helps to post the tweets.

I am able to find this module because I have already worked with Twitter v2 API.

[Twitter API Documentation](https://developer.twitter.com/en/docs/twitter-api)

If you know nothing about this Twitter API, then check the link, it’s a cool API to work with tweets in whatever fashion you want.

[Twitter V2 NPm](https://www.npmjs.com/package/twitter-api-v2)

Coming back to the story, I found this npm module to directly deal with Twitter API without paying much attention to the installation process.

## Plan of action on automating the tweets
- Develop an API or endpoint that will post the tweet for me.
- For scheduling set the timer for API using the CRON job

That’s it. Honestly, it’s not rocket science. I have just added 40 lines of code as shown in the image below to automate the Twitter marketing:


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

The endpoint first fetches the data from the database and then uses the CRON job to schedule the tweet time and using Twitter API v2 I then post the tweet at that specific time.

## Conclusion
This project is not rocket science but a good one to add to your resume especially if you junior developer.

List of tasks you can add further:
- In addition, for senior developers, you can take this project to next level by creating a dedicated interface or UI or website for yourself to add the tweet content.
- You can even use machine learning models to generate the banner image for each tweet to make tweets look more appealing.
- You can even use artificial intelligence to create small tweet content using the heading of the tweet pretty smart and straightforward.

Until next time, have a good day.
Shrey
[iHateReading](ihatereading.in)
Do you know the project called Otomi?
Tags: devops, kubernetes, gitops, paas
Published: 2022-11-03 20:34:06

Have you heard this awesome project called **Otomi** (https://otomi.io/) by Red Kubes (https://www.redkubes.com/).

Documentation: https://otomi.io/docs/installation/get-started

The Installation is super easy (a simple Helm install), I have installed on top of a k3s (https://k3s.io/)!

The most Awesome thing about Otomi is that it comes with all the goodies baked in!

Visit the following url to see all the Features:
https://www.redkubes.com/features-otomi-container-platform/

Security Best Practices

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

#### A Complete Suite of Applications

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

Also the best thing is that everything is managed the GitOps Way! Literally any change is pushed to the management Gitea and are being deployed with Drone(https://docs.drone.io/) of course you can integrate your favorite CD tool like ArgoCD or FluxCD!

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

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

I think it is Awesome, Check it out and tell in the comments if you like it !

I hope you like the tutorial, if you do give a thumps up! and follow me in [Twitter](https://twitter.com/TVelmachos), also you can subscribe to my [Newsletter](https://dashboard.mailerlite.com/forms/167581/67759331736553243/share) in order to avoid missing any of the upcoming tutorials.


#### Media Attribution
I would like to thank [Clark Tibbs](https://unsplash.com/@clarktibbs) for designing the awesome [photo ](https://unsplash.com/photos/oqStl2L5oxI)I am using in my posts.
Discussion and Comment of the Week - v23
Tags: bestofdev
Published: 2022-11-03 20:33:06

This weekly roundup highlights what we believe to be the most thoughtful and/or interesting discussion of the week. We're also be highlighting one particularly cool comment in each installment. 🙌

The DEV Community is particularly special because of the kind and thoughtful discussions happening between community members. As such, we want to encourage folks to participate in discussions and reward those who are initiating or taking part in conversations across the community. After all, a community is made possible by the people interacting inside it.

## Discussion of the Week

This one goes to @hr21don for their fun and appropriately festive prompt _[How do you explain Halloween to a five-year-old?](https://dev.to/hr21don/how-do-you-explain-halloween-to-a-five-year-old-k4d)_

{% embed https://dev.to/hr21don/how-do-you-explain-halloween-to-a-five-year-old-k4d %}

Was it the most substantive discussion of the week? Maybe not, but arguably so... there are some really thorough responses (I'm [looking at you](https://dev.to/mellen/comment/22iog) @mellen 😀) and quite a bit of sharing cultural differences as well ([see thread](https://dev.to/jmfayard/comment/22iap)). In any case, I appreciated the timeliness of it all + the unexpected but very welcome use of [#explainlikeimfive](https://dev.to/t/explainlikeimfive). Reminder to all: if you have questions that you'd like answered in the simplest terms, consider posting them under this tag!

{% embed https://dev.to/t/explainlikeimfive %} 

## Comment of the Week

Big ups to @sylwiavargas for her detailed answer to @nickytonline's excellent prompt _[What are your tips for working remotely?](https://dev.to/nickytonline/what-are-your-tips-for-working-remotely-57n0)_

{% embed https://dev.to/sylwiavargas/comment/22k51 %}

First off, so glad that you used the comment section as your notepad here, Sylwia! Secondly, your answer is amazingly thorough, well-written, and even formatted to perfection — this is less note-like and reads more like a full post on the subject! Thirdly, the guidance you offer here is really awesome — so much of it feels like advice folks might use to set themselves up for healthy work habits and happiness at the job, which is just a really thoughtful angle to take.

## What are your picks?

There's loads of great discussions and comments floating about in this community. These are just a few we chose to highlight. 🙂

I urge you all to share your favorite comment and/or discussion of the past week below in the comments. And if you're up for it, give the author an @mention — it'll probably make 'em feel good. 💚
improve golang skill
Tags: go, webdev
Published: 2022-11-03 20:06:14

hallo my name is made suande. to day i will improve my selft to create two-dimentional figure ui with golang language. check code to link bellow.

https://github.com/suandedev/go-bangun-datar
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y8qdx9rz0lk013uiss8e.png)
Write Concise Object Literal Declarations Using Object Property Shorthand
Tags: codenewbie, javascript, freecodecamp
Published: 2022-11-03 20:00:39

## Write Concise Object Literal Declarations Using Object Property Shorthand
ES6 has yet another special feature for defining object literals, ergo, the data propogated into the object can be defined and sorted with built-in shortcuts.

The old way to define *x* as *x* and *y* as *y*:
```js
const getMousePosition = (x, y) => ({
  x: x,
  y: y
});
```
The “new” :sunglasses: way
```js
const getMousePosition = (x, y) => ({ x, y });
```

### Prompt
Use object property shorthand with object literals to create and return an object with `name`, `age` and `gender` properties.
```js
const createPerson = (name, age, gender) => {
  // Only change code below this line
  return {
    name: name,
    age: age,
    gender: gender
  };
  // Only change code above this line
};
```
### Solution
```js
const createPerson = (name, age, gender) => {
  // Only change code below this line
  return  {name, age, gender
  };
  // Only change code above this line
};
```
Unfortunately, I cannot see any new understanding in this as I don’t have the experienced perspective of the old way, just that from the example. Makes this post kinda feel like bloat but how else would I remember it?
How to Update an Kubernetes Image Imperatively.
Tags: kubernetes, devops
Published: 2022-11-03 19:33:08

In the rare case you need to update the Container Images Manually instead of managing the Deployment the GitOps Way via FluxCD or ArgoCD. Then see the commands bellow.

With FluxCD you can do the following:
#### Ask FluxCD to stop managing the Deployment / Statefulset.
```
flux suspend kustomization <kustomization-name>
```
#### Update the image with the following commands.
```
kubectl set image statefulsets.apps/<statefulset-name> <container-name>=<image-name>
OR
kubectl patch statefulsets.apps/<statefulset-name> -p '{"spec":{"containers":[{"name":"<container-name>","image":"<image-name>"}]}}'
```
#### Ensure the Image has been updated.
```
kubectl get statefulsets.apps/<statefulset-name>-o=jsonpath='{$.spec.template.spec.containers[:1].image}'
```
I hope you like the tutorial, if you do give a thumps up! and follow me in [Twitter](https://twitter.com/TVelmachos), also you can subscribe to my [Newsletter](https://dashboard.mailerlite.com/forms/167581/67759331736553243/share) in order to avoid missing any of the upcoming tutorials.


#### Media Attribution
I would like to thank [Clark Tibbs](https://unsplash.com/@clarktibbs) for designing the awesome [photo ](https://unsplash.com/photos/oqStl2L5oxI)I am using in my posts.
Most Used Git Commands
Tags: webdev, github, git, javascript
Published: 2022-11-03 17:51:58


🔷 git init 🔷
=> To Initialize New Repo

🔷 git add 🔷 
=> To Inform Git For Updates

🔷 git commit 🔷
=> To Save the changes

🔷 git status 🔷
=> To Know status of working directory 

🔷git push 🔷
=> To Push changes local-> remote repo

🔷 git pull🔷
=> to download updates from remote repo
 
Follow @devkshitij7 
For More Amazing Posts....