teleren/devto huggingface dataset:
Second time is the charm, Right?
Published: 2023-01-17 00:30:49

---
title: Second time is the charm, Right?
published: true
date: 2023-01-13 02:52:08 UTC
tags: 
canonical_url: https://jonshawhan.com/100-days-of-code-challenge-round-two
---

I don't recall the exact date but I know it was sometime near the end of 2021 that I tried the [100 Days of Code Challenge](https://www.100daysofcode.com/) for the first time. My drive at that time got me through a whopping two days of code. I'm just glad 2% is better than 1%, just like with milk.

I decided on doing this challenge again because of my coworker's suggestion. Racking my brain is something I do all of the time. My crazy doctor(therapist) calls it worrying but I don't believe her. Anyways, there I was talking to a coworker friend of mine about our learnings and what we both have planned next. You don't need to know the full discussion but know that he mentioned that he was doing a Udemy course on Python and offered to send me the link to the course. He sent the link and as you probably guessed, I clicked it. Then I read everything on the site and decided that the course was very interesting, had great reviews, and I needed to signup to take it.

I purchased the course [100 Days of Code: The Complete Python Pro Bootcamp for 2023](https://www.udemy.com/course/100-days-of-code/) on January 4th for $10.17, which is very cheap compared to other classes I've taken. Since that day I have gone through the first 3 informational sections, finishing the 3rd section today. As part of the 2nd section [Dr. Angela Yu](https://www.linkedin.com/in/angela-yu-963a584b/), the Founder of [The App Brewery](https://www.appbrewery.co/), recommends printing the course pledge and signing it.

So just to make all of you aware I have signed the pledge and plan to start Day One tomorrow 1/13/2023. Hold me accountable, just as I will hold myself accountable.

* * *

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1673578086067/f66ed91e-0bd8-4a24-949b-bbfff9222632.jpeg)
The Most important Aspects of Learning to Code
Tags: webdev, beginners, javascript, programming
Published: 2023-01-13 02:42:23

Learning how to code is an important skill that can open doors to many career opportunities and personal projects. However, it can also be a daunting task for beginners. In order to be successful in learning how to code, there are a few key aspects to keep in mind.

The first aspect is to choose the right programming language for your goals. There are many different programming languages, each with their own strengths and weaknesses. For example, JavaScript is a versatile programming language that is primarily used for creating interactive and dynamic web pages, but it has also been used for other purposes such as developing mobile apps, desktop apps, and server-side applications, while C++ is often used for more advanced projects such as video games and operating systems. It's important to research and choose a language that aligns with your goals.

The second aspect is to practice, practice, practice. Coding is a skill that requires a lot of hands-on experience in order to master. It's important to not just read about coding, but to actually write code. There are many online resources such as Codecademy, Coursera, and Udemy that offer interactive coding exercises and tutorials to help you practice.

The third aspect is to seek help when needed. Coding can be challenging, and it's important to not get discouraged when you encounter a problem. There are many online communities such as Stack Overflow and GitHub where you can ask questions and get help from experienced programmers. Additionally, it is also important to learn how to debug your code.

Finally, the fourth aspect is to stay up to date with new technologies. Coding is a rapidly evolving field, and new technologies and frameworks are constantly being developed. It's important to stay informed about the latest trends and tools in order to stay relevant in the field.

In summary, in order to be successful in learning how to code, it's important to choose the right programming language, practice consistently, seek help when needed, and stay up to date with new technologies. With these key aspects in mind, anyone can learn how to code and achieve their goals.
Some Websites for hosting and fetching JSON
Tags: python, javascript, beginners, tutorial
Published: 2023-01-13 02:38:47

There are several ways to host JSON data for free and here are the ones which are commonly used:

1. GitHub: You can create a GitHub repository and push your JSON data to it. You can then access the data using the GitHub API.

2. Firebase: Firebase offers a free plan that allows you to store and retrieve JSON data. You can access the data using the Firebase Realtime Database API.

3. JSONbin: JSONbin is a free service that allows you to store and retrieve JSON data. You can access the data using the JSONbin API.

4. Myjson: Myjson is a free and simple service for storing JSON data. You can create, read, update and delete JSON data with simple HTTP requests and easily share it with others.
5. 
Once you have hosted your JSON data, you can fetch it by making an HTTP request to the URL where it is hosted. If you are using an API, you will need to read the documentation for that API to learn how to make requests to it.

In general, you will need to use a programming language like Python, JavaScript, or Java to fetch the JSON data, as it can't be fetched by simply visiting the URL, you will need to make a GET request to that URL to fetch the data.

You can use the libraries like axios, fetch, request etc in javascript or python to fetch the json from the url.
如何设计持续集成代码版本发布流程
Tags: gitops, workflow, devops, ci
Published: 2023-01-13 02:34:50

## 背景
为了减少沟通成本，提高开发和运维效率，需要提供一套规范的持续迭代发布Apps的流程。而规范的主要目的不在于整体流程本身，在于需要形成一套能够持续迭代优化的发布机制。本文在于提供一套较为完善的代码持续迭代发布的流程方案。

##目标
1. 保证完善的发布更新流程，减少回滚的次数。

2. 减少手动操作行为，尽可能自动化完成。

3. 减少发布到客户环境后出现过多问题的次数。

##关键环境约束
一般来说，完善的发布流程需要测试环境、预发布环境、生产环境，并且每个环境的权限配置和操作使用者是完全不一样的。

1. 测试环境，大家所有人都是管理员权限，可以操作任何资源，没有限制，所有人员可以进入ssh后台。

2. 预发布环境，仅仅只有测试人员才有操作权限，其他人员只有读的权限，比如查看配置和查看日志，没有任何写权限。只有测试人员才可以进入ssh后台。

3. 生产环境，仅仅只有发布人员有操作权限，其他所有人员只有读的权限，只有发布人员可以进入ssh后台。

**预发布环境是开发人员在测试环境测试通过后，测试团队根据开发人员填写的发布文档发布到预发布环境，注意严格按照发布文档来操作，相当于所有操作有记录，避免生产环境发布不成功。**

**生产环境发布是发布人员在经过测试人员确认发布文档内容可以在生产环境操作后触发。**

**再次要注意几点：**

1. 预发布环境或者生产环境发现BUG，最好能够通过日志系统定位到，如果不行的话需要增加相关日志来定位BUG，实在需要主机ssh权限需要申请并说明理由，并且要思考后续是否可以在代码中解决来避免该问题。

2. 预发布环境一般是测试一周时间，是否测试通过并且可以发布到生产环境是由测试人员来决定。

3. 各种更新升级或者数据库刷数最好能做到自动化完成，减少发布人员的手动操作。

##发布流程图
要保证更新和发布自动化完成，首先，需要两部分的资源：

1. 所有APP配置代码化。

只有app安装部署行为代码化后，才可以使用git来进行版本的管理，才能做到可记录，可追溯，可更新，可回滚。（在Kubernetes环境下可以使用Pulumi/Terraform来实现IaC）

2. 所有APP都需要容器化，以镜像对外发布内容。

APP配置分支和APP内容分支之间，仅仅通过镜像来完成两边内容的匹配，并且APP的配置分支命名规则必须和APP内容分支命名规则一致，且发布规则一致。
举例：
```bash
项目Hive repo，
分支名称为release#v1.0-20221202，
那么，该分支构建出来的Hive镜像tag为v1.0-20221202。

在pulumi apps repo，
分支名称也要为release#v1.0-20221202,
且hive pulumi app中镜像对应的tag和hive项目构建出来的镜像tag一致，为v1.0-20221202。

备注：项目repo和app repo是独立的两个repo，项目repo主要是项目代码，并完成artifact构建或者docker镜像构建。app repo是该项目对应的应用定义，可能一个项目repo对应多个app。
```

###发布操作流程如下：

1. 开发人员编码，完成镜像构建和测试，并完成app分支镜像版本更新。

2. 每周五，测试人员发布下下周上生产(下周上预发布环境)的上线单，通知有发布功能人员填写。
发布单内容主要有：app名称，app repo地址，app repo是否创建对应release分支，是否有手动操作，发布失败回归操作方法，预发布环境/生产环境验证是否通过。

3. 每周一，测试人员根据发布单完成预发布环境app更新，并通知相关人员验证，完成验证操作后将验证结果填写到发布单，验证失败则要bugfix，并更新上线单再次上线。

4. 测试人员一周内进行测试和验证。

5. 测试人员验证完毕，可以发布，如果未验证完毕，则需要将推迟发布的app内容填写到下一次发布单上面。

6. 每周一，生产环境发布人员检查本周生产环境上线内容，完成发布，并通知测试人员和相关人员验证。

7. 验证通过，则发布完成，验证失败，则需要提bugfix进行紧急修复，并且要思考该问题为何预发布环境没有发现，后续如何避免。

>备注：整体系统功能性验证应该是自动化运行的脚本，预发布环境发布或者生产环境发布后，测试人员会进行统一自动化测试。

##备注
1. 重大release分支发布一般会有一个较长的周期，主要区别点在于，重大release分支测试必须要更全面，测试人员，产品人员和相关开发都需要走一遍所有的功能流程。

2. 重大release分支内容一般要开发/产品/测试提前沟通确定好，确定好内容后，该分支原则上不会做新功能添加，只会做bug修复，相关新功能进入dev分支，走下一次大版本发布。

3. 在确定了release分支可发布后，需要申请空的测试环境，并由产品或者其他测试人员走几遍整体从0开始安装发布流程和验证流程，相关测试验证做了2-3次后，可以封版。

## 版本命名规则
在开源世界，实际上有一个通用的代码版本标准，称作 SemVer 规范。具体参考如：https://semver.org/
如何设计适合持续集成的代码分支管理体系
Tags: git, gitops
Published: 2023-01-13 02:25:29

##背景
常见的Git开发流程中，建立好分支管理和发布规则，以及良好的日常开发分支管理，能够较大提高开发人员效率，降低沟通维护成本，便于各个项目的codeReview，提供整个产品质量。


##分支管理配置
首先，有几条规则需要确定。

1. dev/master分支不允许直接push，向这两个分支合并代码需要提交MR或者PR。
所有release分支以 release#VERSION-日期 来命名，比如release#4.0-20221212 表示2022年12月12日发布的4.0分支。relase开头的分支同样不允许直接PUSH，必须提MR来合并代码。

2. 客户定制需求相关分支以  project#客户名称#VERSION-日期 来命名，比如 project#xinjiangkashi#4.0-20221212，表示新疆喀什的客户分支，project开头的分支不允许直接PUSH，必须提MR来合并代码。

3. 新功能开发分支为 feature#原始分支名#新增功能说明，比如 feature#dev#added-spark-locality-support ，表示新功能开发，从dev分支checkout出来，新功能是增加 spark locality功能。

4. bug修复分支以 bugfix#原始分支名#修复BUG说明，比如 bugfix#release#4.0-20221212#fix-null-point-bug。

5. hotfix分支，一般仅仅作为 release或者project 分支发布后，出现了问题，需要紧急修复，可以创建该分支，创建规则一致。

6. feature/bugfix/hotfix提交到了一个分支后，如果该功能需要提交到其他分支，可以在页面上操作 cherry-pick 到其他即可。

7. dev/master/release*/project*开头的分支在git/gitlab服务端配置成保护分支，其他人就不能直接push。

##GIT workFlow示例：

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


##日常开发流程

>本文以dev为主要开发分支来介绍，dev分支内包含测试过可以上线的最新代码，根据不同情况，也可以使用master分支来做为开发主分支，遵循策略一致。

###新功能开发流程

1.从dev分支checkout出来feature分支，checkout命令：
```shell
git checkout -b feature#dev#added-locality-support
```
>说明：feature表示新功能开发，第一个#和第二个#之间内容为checkout原始分支名称，如果是从master分支切换出来，则为feature#master#，最后一部分内容为feature具体新增功能。

2.编写代码，完成测试，测试完成后提交代码到本地，命令：
```shell
git commit -am "added locality function."
```

3.提交代码到远程。
```shell
git push origin feature#dev#added-locality-support
```

4.进行CI构建，测试，测试通过后，提交MR/PR merge到dev分支，相关人员review后最终merge到dev分支。

>此处可以配置仓库权限，只有仓库的maintainer可以merge，其他开发人员提交MR后，maintainer需要进行codeReivew，通过后才可以merge到分支，提MR的分支必须要保证可以编译通过，可以正常运行。

**在此条件下，dev分支任何时候去构建，都是正常可以编译通过，并且可以发布正常运行的。**

5.确认该分支是否需要 cherry-pick 到其他分支，如果需要，则操作 cherry-pick 流程到其他分支。

###bug修复流程

BUG修复流程和上述开发流程一致，仅仅是分支名称不一样而已，但是bug的修复要注意提交到release分支后，也需要cherry-pick到dev分支。

##Release分支管理

1. 每周从dev分支checkout出来release分支，如果发布到预发布环境，可以在分支名称末尾增加 -rc 字样来表示，预发布环境测试通过后，从rc分支再checkout出正式分支，发布。（此处相当于release包含两个分支，-rc为预发布环境分支，不带-rc为生产环境分支，上生产后，两个分支内容应该一致。）

2. 对project分支，如果不想维护太多project分支，对每个客户可以只使用一个project分支，在每次发布后，增加tag来标识此次发布行为，tag仅仅做标识，不和CI结合。

3. 对于 一个分支是否需要向多个分支进行cherry-pick，需要根据业务场景来确定，比如有些定制化内容，不需要进入dev分支，则不需要cherry-pick到dev，比如一个bugfix需要更新多个project分支和release，则需要逐个cherry-pick。

4. CI可以根据不同的分支来进行相应的构建，推荐使用gitlab CI直接可以通过不同分支的配置来进行触发构建。
Just Launched 🥳 (What do you think)?
Tags: showdev, webdev, programming
Published: 2023-01-13 01:32:38

After more time in developement then I would ever like to admit

After more money in developement then I would ever like to admit

After more bugs in developement then I would like to admit

After more misspelings than I would like to admit


It is finally launch day!

And since I cannot be trusted to spell things correctly and create grammatically correct sentences (Just look above), I decided, with much trial and error, to have an AI write a spelling and grammatical error free for my brand new public project, ➡️TinkerHost - 100% Free Hosting!⬅️

---


Are you tired of dealing with expensive and unreliable hosting? TinkerHost is here to help! Our free hosting platform offers 99% uptime, so you can count on your website or application being available to your users. Plus, our friendly community of users is always here to help if you have any questions or need assistance.

At TinkerHost, we understand the importance of having a dependable hosting platform for bloggers and e-commerce sellers. That's why we offer a supportive community of users to help you out. With TinkerHost, you can focus on creating great content and selling your products, without worrying about downtime or technical issues. Give us a try today and see the difference. Sign up now at [TinkerHost.net](https://tinkerhost.net?ref=devto?type=click?placement=aiad) and experience the benefits of hosting with us.

---

It would mean so much to me if you would be willing to signup and create a free account, even if it is just to offer me some feedback.

And if you do happen to be looking for a free hosting provider for a small website, or your test projects, I hope this post finds you well.

Thanks!
API Design and Documentation Tools
Tags: webdev, python, api, career
Published: 2023-01-13 00:45:05

APIs are a crucial aspect of modern software development as they enable integration, automation, and data sharing across different platforms and technologies.
In this session, we will be discussing the various tools and technologies available for creating, designing, and implementing APIs.
Read more:[](https://link.medium.com/awNOwEADxwb
A Look Ahead at the Top Frontend Frameworks for 2023
Published: 2023-01-13 00:28:50

As technology continues to evolve, so must development frameworks. In order to keep up with the ever-changing landscape of web development, frontend developers need to stay aware of the top frameworks that will dominate the industry in the coming years. Here’s a look ahead at what we can expect from the top frontend frameworks in 2023.

## React

React has been popular since its release in 2013 and is expected to remain at the top in terms of usage and technology. It is an open-source JavaScript library created by Facebook and was built with speed, scalability, and simplicity in mind. React allows developers to create complex user interfaces quickly using components which can be reused throughout an application. It also utilizes a virtual DOM (Document Object Model) structure which makes it easier for developers to update large pieces of data within an application without negatively impacting performance.

## Vue JS

Vue JS is another popular open-source JavaScript framework that is growing in popularity year over year. Like React, it was designed with speed and simplicity as its main goals. Vue offers an intuitive way for developers to create dynamic user interfaces with a focus on ease-of-use, allowing even novice developers to quickly pick up the framework’s syntax and start building applications right away. In addition, Vue features a highly performant rendering engine which helps ensure that applications render quickly without sacrificing performance or scalability.

## Angular

Angular—formerly known as AngularJS—is another top contender among frontend frameworks that shows no signs of slowing down in 2023. Angular is powered by Google and has become one of the most popular choices for developing single page applications (SPAs). Angular offers two-way data binding which makes it easy for developers to sync their models (data) with their views (UI). Additionally, it provides powerful tools that help make debugging applications much easier than other frameworks such as React or Vue.

## Conclusion

The world of web development is constantly changing and evolving as new technologies emerge every day. To stay competitive, frontend developers need to be aware of the latest trends so they can make informed decisions about which frameworks are best suited for their projects. With this in mind, these three frameworks —React, Vue JS, and Angular—are expected to remain at the top of their game in 2023 due to their speed, scalability, simplicity, reliability and intuitive design structures that allow even novice developers to quickly pick them up and use them effectively on any project they may work on.
Getting MMS Working on GrapheneOS With Google Fi
Tags: grapheneos, googlefi, mms, pixel
Published: 2023-01-24 15:04:49

---
title: Getting MMS Working on GrapheneOS With Google Fi
published: true
date: 2023-01-13 00:00:00 UTC
tags: grapheneos, googlefi, mms, pixel
canonical_url: https://www.rocky.dev/blog/getting-mms-working-on-grapheneos-with-google-fi
---

I recently installed [GrapheneOS](https://grapheneos.org/) on my Pixel and enjoy the privacy protection. I use Google Fi and could send MMS messages just fine. But when someone else in the group would send a message, I would see the error "MMS delivery failure; please contact Google Fi Support". Google Fi tech support was unable to help since I'm using a non-standard version of Android. Here's the solution.

First, I left the owner profile untouched and installed Sandboxed Google Play into a new profile; this will not work. When you attempt to activate Google Fi, you'll see the error "Account access only." From [this support page](https://support.google.com/fi/answer/6260066?hl=en&authuser=0), a troubleshooting step mentions that only the device owner can activate Google Fi service.

Installing Sandboxed Google Play onto the owner profile got me further, but I'd see "Your SIM card couldn't be read." The final piece to the puzzle is to go to **Settings** > **Network & internet** and toggle on the **Enable privileged eSIM management** setting. Now that I know what to search for, I found [this discussion thread](https://discuss.grapheneos.org/d/2281-questions-new-user-in-advance-esim-privileged-management) and [this documentation](https://grapheneos.org/usage#sandboxed-google-play-esim) explaining this in more detail.

![Android settings](https://www.rocky.dev/_next/image?url=%2F_next%2Fstatic%2Fmedia%2Fsettings.2a8a4ce3.jpg&w=3840&q=75)

Once toggled, open the Google Fi app to complete activation. If you're still having issues, this these steps,

1. Open Google Fi's **App Info** > **Storage & cache**
2. Press **Clear cache** and **Clear storage**
3. Back up a screen and press **Force stop**
4. Open **Settings** > **System** > **Reset options**
5. Press **Erase downloaded SIMs**
6. Reboot the device
7. Open the Google Fi app and activate

Once activated, you can toggle **Enable privileged eSIM management** back off. I hope this helps. Enjoy MMS and group texting!
Golang Web API Course: Intro
Tags: go, gin, programming, tutorial
Published: 2023-01-12 23:43:14

In this collection of articles, I want to develop a real web API project using Golang
During the development process, we will use many useful tools such as:

1. Gin as the web framework
2. JWT for authentication and authorization
3. Redis for caching
4. Elasticsearch for logging database
5. Beat for log shipping
6. Kibana as a log viewer
7. Postgresql as the main database engine
8. PgAdmin as a database management tool
9. Prometheus for metric database
10. Grafana for metric dashboards
11. Validator for endpoint input validation
12. Viper for configurations
13. Zap for logging
14. Zerolog for logging
15. Gorm as ORM
16. Swagger for documentation
17. Docker compose for running project with all dependencies in docker

You can see the source code of the project on [Github: golang web API project](https://github.com/naeemaei/golang-clean-web-api) and if you like this repo or found it helpful, please give it a star. Thanks!

In the next sections, I will explain the project structure and steps for implementing project
ubuntu20.04에 node.js와 yarn 설치,2023-01-13
Tags: ubuntu, node
Published: 2023-01-12 23:36:52

이것을 설치해야 원하는 nodejs를 설치가 가능하다

```
sudo apt-get install -y curl
```

```
sudo apt-get install -y build-essential
```

https://nodejs.org/en/

접속

other downloads

클릭

Installing Node.js via package manager

클릭

Debian and Ubuntu based Linux distributions

클릭

Node.js binary distributions

클릭

원하는 버전으로 받기

ubuntu20.04
node.js 16.x

```
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - &&\
sudo apt-get install -y nodejs
```
yarn 설치

```
npm install -g yarn
```
Error Handling com Next JS
Published: 2023-01-12 23:33:56

> Neste exemplo veremos como implementar `error boundaries` usando `Next Js`.

## O que são Error Boundaries?

Error boundaries são componentes `React` que capturam erros de `JavaScript` em qualquer lugar na sua árvore de componentes filhos, permitindo que você mostre uma UI alternativa aos usuários em vez de uma tela de erro, como esta abaixo:

![Erro em produção](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xh94qpmtu65oeythnzwn.png)

O exemplo acima é uma página de erro que o Next.js renderiza quando a sua aplicação está em produção. Em ambiente de desenvolvimento, você verá uma página como esta:

![Erro em desenvolvimento](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pmxgud0tvptkjneweorj.png)

## Implementando Error Boundaries

Primeiro, crie um componente `ErrorBoundary` em sua aplicação `Next.js`. Este componente deve ser criado como uma classe da seguinte forma:

```ts
import { Component, ErrorInfo, ReactNode } from "react";

interface Props {
  children: ReactNode;
}

interface State {
  hasError: boolean;
}

class ErrorBoundary extends Component<Props, State> {
  constructor(props: Props) {
    super(props);
    this.state = { hasError: false };
  }

  public static getDerivedStateFromError(): State {
    // Atualiza o state para que a próxima renderização mostre a UI alternativa.
    return { hasError: true };
  }

  public componentDidCatch(error: Error, errorInfo: ErrorInfo) {
    // Aqui você pode ver os detalhes do erro e talvez registrar em um serviço de relatórios de erro
    console.error("Error:", error, errorInfo);
  }

  public render() {
    // Se hasError for true renderiza sua nova UI de alternativa.
    if (this.state.hasError) {
      return <h1>Ops.. Houve um erro em sua aplicação 🥺</h1>; 
      // Aqui você pode colocar seu componente customizado
    }
    // Se hasError for false renderiza o componente filho.
    return this.props.children;
  }
}

export default ErrorBoundary;
```
Após criar o componente `ErrorBoundary` importe-o em `pages/_app.tsx`

```ts
// Importe o componente ErrorBoundary
import ErrorBoundary from "../components/ErrorBoundary";

function MyApp({ Component, pageProps }) {
  return (
    // Coloque como um provider em volta de Component
    <ErrorBoundary>
      <Component {...pageProps} />
    </ErrorBoundary>
  );
}

export default MyApp;
```

Pronto! Agora você terá uma UI personalizada para lidar com erros.

## Por que ErrorBoundary deve ser um componente de classe?

Componentes React se tornam error boundaries uma vez que implementam um (ou ambos) dos métodos de ciclo de vida `getDerivedStateFromError()` e/ou `componentDidCatch()`. Para usar esses métodos de ciclo de vida, o componente deve ser uma classe.

## Onde colocar Error Boundaries ?

ocê tem a liberdade de colocar error boundaries em qualquer parte da sua aplicação, seja globalmente ou em um componente específico.

[Documentação Next JS](https://nextjs.org/docs/advanced-features/error-handling)