teleren/devto huggingface dataset:
Hacktoberfest 2022
Tags: hacktoberfest, github, digitalocean, hacktoberfest2022
Published: 2022-10-25 06:26:36


Last year I created a simple web project, added some issues and made it public on GitHub for #hacktoberfest2021. This year I continued it for #hacktoberfest2022 and I received many pull requests from across the world. 🤩



Hacktoberfest is a month-long celebration run by DigitalOcean to celebrate and give back to open-source projects and software. The goal is to encourage everyone in our global community to contribute to open source.



The website is simple and made for beginners to open-source world, which showcases your GitHub profile pic and the commits you did to the repository, on the webpage using #GitHubAPI. 

I know it is not much but seeing people fixing bugs, issues and adding new features to another one's project simply shows us how much we can give for the open-source community. 🧑‍💻



If you are new to open-source and feel like you want to contribute,




- You can visit the webpage in here:

https://lakinduk.github.io/hacktoberfest2022/contributors/



- If you want to contribute, pick any issue, bug or feature in:

https://github.com/LakinduK/hacktoberfest2022/issues



- Visit the website from last year:

https://lakinduk.github.io/hacktoberfest2021/contributors/



Feel free to report any bugs, request new features in the issues section. 😎
Burnout and Learning
Published: 2022-10-25 06:23:44

Been out of it for the weekend since I knew I failed the code challenge. I kept writing a bunch of code and deleting it until eventually I deleted a ton right at the end of time. I didn't notice it. When I retake it, I'll write notes in my index.js about what I need to do next time. Today we decided that for our code together that we're going to make a code that grabs different types of quotes depending on which button you press and to make sure that it's compatible with phone screens as well.
1. Two Sum leetcode Code in java
Tags: java, leetcode, dsa, easy
Published: 2022-10-25 06:21:26

`class Solution {
    public int[] twoSum(int[] nums, int target) {
        HashMap<Integer,Integer> hm = new HashMap<>();
        int n = nums.length;
        for(int i=0;i<n;i++){
            int diff = target-nums[i];
            if(hm.containsKey(diff)){
                return new int[] {hm.get(diff),i};
            }
            hm.put(nums[i],i);
        }
        return new int[] {-1,-1};
    }
}`
For Explanation Watch video :
{% embed https://youtu.be/hC8QnDkIzH0 %}
What am I not getting about the useTransition hook?
Published: 2022-10-25 06:20:36

So, I'm trying to learn how to use the useTransition hook, what I expect this code to do is to disable the button to increment and only enable it after the counter has changed. But the "isPending" is changing rigth after the click (I believe just on the next render).

![Gif of a button being and adding +1 to a counter on the top of the screen. Sometimes a small flickering text appears at the bottom](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sg5j7xe81jhldtqpmulz.gif)

As you can see there is a small flicker of a "Loading..." text on the bottom of the image, and it doesn't wait for the counter to update, what am I missing here? is this not the intended use case for this hook?

Here's the code for the example above

```jsx
import "./styles.css";
import { useState, useTransition } from "react";

export default function App() {
  const [counter, setCounter] = useState(10);
  const [isPending, startTransition] = useTransition();

  const increment = async () => {
    await new Promise((r) => setTimeout(r, 1000));
    setCounter((e) => e + 1);
  };

  const onClickIncrement = (e) => {
    startTransition(() => {
      increment();
    });
  };

  return (
    <div className="App">
      <h1>{counter}</h1>
      <button disabled={isPending} onClick={onClickIncrement}>
        Click me!
      </button>
      <p>{isPending && <small>Loading...</small>}</p>
    </div>
  );
}
```
Create a new github repo from the command line
Tags: github, cli, bash, webdev
Published: 2022-10-25 06:16:56

Hi friends, 
let's say you want to create a new Repo in your terminal and push it to your Github, here is the steps to do that:

1.convert your directory to a git repo with the command :
```
git init
```
2.stage your files, so you can commit them
```
git add .
```
or optionally you can select a file name by:
```
git add file_name/s
```
3.you need to  authorize your github cli if you haven't already , I use ** gh ** for that, you can download it first if you don't have it (sudo apt install gh) in Debian Distros
```
gh auth login
```
just follow the instruction to complete the authentication steps

4.finally :) , create the new repo 
using ** gh ** again with options ** gh repo create**
```
gh repo create newrepo_name --public --source=. --remote=upstream --push 
```
newrepo_name == the repo name you want to be on github 
--public == make the new repo public, you can use "--private"
--source == path to local repo to use as source 
--push == Push local commits to the new repository


I hope you enjoyed this tutorial :)
Thanks !
Getting the latest tagged image to the AKS cluster while deploying the application
Tags: aks, imagepullpolicy, imagetagging, applicationdeploymen
Published: 2022-10-25 05:37:26

I came across a scenario where the application is developed and built as a docker image with the tag (xxx.azurecr.io/sampleimage:latest). Then the built docker image is pushed to the Azure container registry.

The pushed docker image is then deployed in the AKS cluster using kubectl apply -f filename.yaml

Now, the code base is updated and the docker image is also updated with the same tag (xxx.azurecr.io/sampleimage:latest) and pushed to the container registry. The container registry is now having an image with the latest code base.

For the latest image (the one which is updated 2nd time - as mentioned above) to get deployed in the AKS cluster, we need to use imagePullPolicy as Always in the yaml files. If it is not set, the AKS cluster would only take the already available image (the one which is pushed first) from the cluster.

```
apiVersion: apps/v1
kind: Deployment
metadata:
  name: test-tomcat-helloworld
  labels:
    app: test-tomcat-helloworld
spec:
  replicas: 1
  selector:
    matchLabels:
      app: test-tomcat-helloworld
  template:
    metadata:
      labels:
        app: test-tomcat-helloworld
    spec:
      containers:
      - name: test-tomcat-helloworld
        image: cicdcontainervol.azurecr.io/test-tomcat-helloworld:v1
        imagePullPolicy: Always
        resources:
          limits:
            memory: "2Gi"
            cpu: "1200m"
        ports:
        - containerPort: 8080
      imagePullSecrets:
      - name: secret
---
apiVersion: v1
kind: Service
metadata:
    name: test-tomcat-helloworld
    annotations:
      service.beta.kubernetes.io/azure-load-balancer-internal: "true"
spec:
    type: LoadBalancer
    loadBalancerIP: xx.xx.xxx.xx
    ports:
    - port: 8080
      targetPort: 8080
    selector:
        app: test-tomcat-helloworld
```

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ry9n6huhzjutdwszj7qn.png)
How to perform realtime transformations on S3
Tags: aws, cloud, s3
Published: 2022-10-25 04:55:57

**Learn a new feature of AWS S3 which can be used to do realtime transformations like compression, resizing images etc.**

Let’s discuss a new feature of S3, S3 Object Lambda, which can do realtime transformations of files, as you retrieve them.


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

Recently came across an [S3 feature](https://aws.amazon.com/blogs/aws/introducing-amazon-s3-object-lambda-use-your-code-to-process-data-as-it-is-being-retrieved-from-s3/), where you can attach lambda to any AWS S3 bucket and do your conversions, transformations, altering on the fly and also use all the features that S3+CloudFront provides.


## Use cases
1. Compressing or decompressing files as they are being downloaded.
2. Resizing and watermarking images on the fly.
3. Converting across data formats, such as converting XML to JSON.
4. Implementing custom authorization rules to access data.
Many more (left to the devs’ creativity).

## Steps
1. Create an Access Point for S3 bucket.
2. Create an Object Lambda Access Point, and attach above created Access Point and a Lambda, with required permissions like GetObject.
3. Write a code in above created Lambda, to retrive and modify the files according to your needs. [Example Code](https://bit.ly/3Vr7ywC)


![Create an S3 Object Lambda Access Point from the S3 Management Console.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u57w67phfrb2nuaarqd7.jpg)


![Create an Object Lambda Access Point from S3 Console
](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9o62mwoekdynl7clqqp9.jpg)



![Access Point and Lambda inputs, with required permissions like GetObject](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8unjs0uz1ac50kpyd63e.jpg)



## Example

Let’s use the example of image transformation on the fly.

- User asks for sunset_600x400.jpg
- Lambda function will get invoked.
- If sunset_600x400.jpg is available, return 200 success to continue downloading the file.
- If sunset_600x400.jpg is not available, will remove suffix _600x400 and look for an image named sunset.jpg
- Resize it to fit the maximum width and height as described in the file name and save it in S3 as sunset_600x400.jpg
- Return 200 success to continue downloading the file.


## Caveats

For every S3 file access, lambda will get invokes and thus need to pay extra for Lambda.

---


## In Conclusion…

With this new feature from AWS, you can do file transformations, image resize/compressions, limit access etc on the fly.

Let me know if you find any other use cases.


---



That’s it! Please let me know about your views and comment below for any clarifications.


If you found value in reading this, please consider sharing it with your friends and also on social media 🙏


Also, to be notified about my upcoming articles, subscribe to my newsletter below (I’ll not spam you 😂)


{% embed https://blogofcodes.substack.com %}


You can find me on [Twitter](https://twitter.com/sairahul1) and [LinkedIn](https://www.linkedin.com/in/sairahul1/) ✌️
1662. Leetcode solution in Java
Tags: java, chiki1601, challenge
Published: 2022-10-25 05:32:50

```java
class Solution 
{
    public boolean arrayStringsAreEqual(String[] word1, String[] word2) 
    {
     
        return String.join("", word1).equals(String.join("", word2));
    }
}
```
#leetcode
#challenge
ere is the link for the problem:
https://leetcode.com/problems/check-if-two-string-arrays-are-equivalent/submissions/
Kth Largest Element in an Array
Tags: javascript, leetcode
Published: 2022-10-25 05:08:44

`Added two solution 
1 -> using MaxPriorityQueue 
2 -> using MinPriorityQueue`

```js
/**
 * @param {number[]} nums
 * @param {number} k
 * @return {number}
 */
var findKthLargest = function (nums, k) {
  // using in built function of Max heap via Max Priority queue
  const elements = new MaxPriorityQueue();
  for (let i = 0; i < nums.length; i++) {
    elements.enqueue(nums[i]);
  }
  let kthLargest = -Infinity;

  // as heap se sorted Descending order we can just remove top k elements
  while (k) {
    kthLargest = elementss.dequeue().element;
    k--;
  }

  return kthLargest;
};

/**
 * @param {number[]} nums
 * @param {number} k
 * @return {number}
 */
var findKthLargest = function (nums, k) {
  // using in built function of Max heap via Min Priority queue
  const heap = new MinPriorityQueue();

  // as heap se sorted asceding order we can just keep track that we have max k element in queue
  // reason is at last of traversal when we take top most element it will be the kth largest as we have only k elements in heap
  // as soon as size goes beyond k we use dequeue to remove element
  for (let i = 0; i < nums.length; i++) {
    if (heap.size() == k && nums[i] <= heap.front()?.element) continue;
    heap.enqueue(nums[i]);
    if (heap.size() > k) heap.dequeue();
  }

  // return top most
  return heap.front().element;
};

```
Closer look at Keploy
Tags: javascript, beginners, webdev, tutorial
Published: 2022-10-25 04:01:59

# Introduction 
Open Source community is growing more diverse and energetic every day. No matter what your interests are or which field you work in—you will be able to find someone who can help you there.

A month-long celebration where participants are prompted to contribute in ways other than writing code during this four-week period. We wanted to provide an avenue for people to connect, compete and collaborate with fellow open source enthusiasts. 

# What is Keploy 👀

Keploy is an open source functional testing toolkit for developers. Creating testing frameworks becomes a walk in the park with Keploy. Saving hours in developer time and also helping your product launches hassle free

# Contribute to Keploy ✍🏻

- [Keploy ](https://keploy.io/)
- [Keploy Github](https://github.com/keploy/keploy)
- [Keploy Documentations](https://docs.keploy.io/)
- [Keploy Slack Channel](https://keploy.slack.com/ssb/redirect)
- [Keploy Youtube Channel 
](https://www.youtube.com/channel/UC6OTg7F4o0WkmNtSoob34lg)

# Deep Dive into Keploy 🎯

At this event we have with us Animesh Pathak, a dev and also an amazing open-source enthusiast. Join us as he talks about his journey at Keploy and what they’re building at Keploy. Tune In 🤝

<img src="https://aviyel.com/assets/uploads/files/1666352828121-hacktoberfest-13-resized.png">

# Hacktoberfest with Aviyel 🎉

We're excited to announce Hacktoberfest with Aviyel! This event will bring together developers, writers, and designers for a day of giving back to our community. It's an opportunity to get involved, whether you're new or already have experience working on open source projects.

Week 4 🕥

In this fourth week of the Hacktoberfest:

Participants will have 8 days to submit the final article, and successful contributors will be awarded badges.
Submissions with the most votes are eligible to win a swag box filled with goodies.


# Contribute to Aviyel ✍🏻

- [Aviyel](https://aviyel.com/discussions)
- [Aviyel Github
](https://github.com/Aviyel-oss)
- [ Aviyel Discord](https://discord.com/invite/sdxNdbANeX)
- [Aviyel Dev Community ](https://dev.to/aviyel)
 
### Connect with Me ⬇

[Twitter](https://twitter.com/ganeshstwt) 
[Github](https://github.com/ganeshpatil386386)
[Youtube]
(https://www.youtube.com/channel/UCjMse2JYXPbtlzcnkbXmVQQ)
[Linkedin](https://www.linkedin.com/in/ganeshpatil386386/)
Have you used Jina for multi-modal applications?
Tags: python, opensource, machinelearning, github
Published: 2022-10-25 04:00:31

How will you build a multi-modal application? I just noticed the [release](https://jina.ai/news/jina-3-11) of[Jina](https://github.com/jina-ai/jina) which is a MLOps framework that empowers anyone to build cross-modal and multi-modal applications on the cloud. It uplifts a PoC into a production-ready service. Jina handles the infrastructure complexity, making advanced solution engineering and cloud-native technologies accessible to every developer. 
If you tried before, please let me know how do you find about it? Thanks!
AWS Console Dark mode is ON
Tags: aws, cloud, community
Published: 2022-10-25 03:59:25

Hello Everyone,

Hope everyone enjoyed this year DIWALI.

Our much waited AWS console Dark mode is available now.

To make this Dark mode just follow these steps.

-  Login to your AWS console

-  Navigate to the right cornet of your account as shown below

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

- Go to Display section and Edit

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

-  Set display settings Visual mode as Dark and Save Settings

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

- AWS console DARK mode is ON. Enjoy your viewing experience

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j4t8oukxfy2ksssr2a00.png)
 
Here is an [article](https://dev.to/aws-builders/learning-path-to-become-aws-cloud-engineer-3c8k) about how to change your career into AWS Cloud. 

Connect with me on [LinedIn](https://www.linkedin.com/in/logeswarangv/)for more knowledge sharing.
Shipping to Production - Final and Next
Tags: productivity, management, architecture
Published: 2022-10-25 03:24:37

At [Woovi](https://www.woovi.com), we focus in to deliver the best cost x benefit for new features. And, with our core principles in mind, even before coding, we start to sharpen the best solution for our clients.

**Production**
After making a new release, it is crucial to keep observability to understand if the feature implemented will work as expected and if nothing breaks.

Even if it breaks, we have a k8s orchestrated with pods, and those pods have a load balancer that calculates if they should update. If something wrong is identified, the load balancer keeps the actual version, avoiding breaking our production platform.

**Rolling Update**
We use in our k8s the [Rolling Update](https://kubernetes.io/docs/tutorials/kubernetes-basics/update/update-intro/). Each pod has a status endpoint. The pod makes a request and if do not return 200 the release won’t go forward.

This makes it harder for to us break our production server.

**Observability**
Focusing on observability we monitor our applications with the following solutions:

- APM
- Kibana
- Sentry

With those solutions, we can identify unexpected behavior, understand how the users are using our features and handle it before turning a pain for our product. And, if needed we can make a rollback, fix the problem, and ship it again.

**Pos Release**
We can release the feature for all customers or we can gradually release it to a few of them to get feedback using our feature flag strategy.

**Customer Success**
Each release is a delivery. And deliver mean telling our customer success team about news in our platform and making them public to our customers.

We also document everything to help our CX team. You can find our documentation here:

- [Customers Documentation](https://ajuda.openpix.com.br/pt-br/)
- [Developers Documentation](https://developers.openpix.com.br/docs/getting-started/)

**Next**
We have many challenges inside this architecture to increase our bar of quality. 
- We must automate most parts of human interaction in all steps of shipping to the production process
- Still innovating and bringing new and intelligent ideas
- Continuously learn new techniques in management way


If you like this blog post, come to work with us, we are [hiring](https://www.woovi.com/jobs)!

**Woovi**
[Woovi ](https://www.woovi.com)is a Startup that enables shoppers to pay as they like. To make this possible, Woovi provides instant payment solutions for merchants to accept orders.
Shipping to Production - Testing and Release
Tags: architecture, management, productivity
Published: 2022-10-25 03:23:30

At [Woovi](https://www.woovi.com), we focus in to deliver the best cost x benefit for new features. And, with our core principles in mind, even before coding, we start to sharpen the best solution for our clients.

Let's give into our Testing and Release process.

**Testing process**
To understand our development process, you must first know how our environment operates. 

We dispose of two environments: staging and production.

**Staging**
Staging is our testing environment. All pull requests from our developers go to the staging environment directly if they pass all tests.

The staging helps us test our product features. 

This approach is close to the based trunk development.

In addition to automated testing, we also emphasize the need for testing how our customers will perform. You could write many tests as you can. But, when running in the browser, there is a probability that you can find a bug that the automated test didn't catch it.

When the developer ship the feature to staging we create a test plan for. We have a blog post dedicated to this. You can read more here [Test Plan Driven Development](https://dev.to/woovi/test-plan-driven-development-56a2)

**Release**
All tests are performed, changes reviewed, and the next step is to go forward with our release.

We automated our release by creating a slack bot that brings all changes comparing the last release and generating a diff to us.

> [Slack Botina Talk](https://daniloab.github.io/botina-slack-talk/#0)

Then, with one click only, we disparate our release.

![slack botina print](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wy45s5g2b53hhdvttloj.png)

If you like this blog post, come to work with us, we are [hiring](https://www.woovi.com/jobs)!

**Woovi**
[Woovi ](https://www.woovi.com)is a Startup that enables shoppers to pay as they like. To make this possible, Woovi provides instant payment solutions for merchants to accept orders.
Shipping to Production - Design
Tags: management, architecture, productivity
Published: 2022-10-25 03:22:13

At [Woovi](https://www.woovi.com), we focus in to deliver the best cost x benefit for new features. And, with our core principles in mind, even before coding, we start to sharpen the best solution for our clients.

Let's give into our Design process.

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

Once having a vision for the feature, our UI/UX team starts to work on the solution.

The designer will follow our principles and deliver a simple, fast, and reliable solution. Combine with our design system already existent and with ideas for other features implemented and validated in production.

The design shows and tells the work result to the product team. This brainstorming is needed to sharpen the design as much as possible to have a refined effect. 

After the brainstorming, the team decides if the feature must go forward or if it needs more touch from the design team.

The product design team can repeat this cycle until they decide the best result of the work combination between both squads. 

If we moved to code stage and identified edges cases, we could return to product-design again. We follow this having agile in mind.

If you like this blog post, come to work with us, we are [hiring](https://www.woovi.com/jobs)!

**Woovi**
[Woovi ](https://www.woovi.com)is a Startup that enables shoppers to pay as they like. To make this possible, Woovi provides instant payment solutions for merchants to accept orders.
OSD600 Lab 6
Tags: beginners, opensource, cpp
Published: 2022-10-25 02:51:28

## What I did
This week, I tried out [Docusaurus](https://github.com/facebook/docusaurus) to see what features I can add to my own SSG. Docusaurus is a popular open-source SSG by Meta/Facebook which contains a host of different features. It was interesting how easy it was to deploy a blog through GitHub Pages using Docusaurus

## What I added to my SSG
Taking inspiration from Docusaurus, I added [full markdown parsing](https://github.com/rudychung/SauSaGe/commit/6db44427d8cde3a69f3dae69eca1a814795df9a5) support to my SSG. I chose to add this because it was a core component of my SSG that remained incomplete. Instead of adding a nice-to-have feature, I figured it would be best to complete the core functionality of my SSG first. Instead of coding my own markdown parsing, it was much easier to simply use a markdown parsing library which already existed. I did this by using a [maddy](https://github.com/progsource/maddy), a C++ markdown parsing library. The process of using the library was very straightforward, although calling its methods did noticeably slow down the html generation. After verifying that it worked with my SSG, I removed my initial implementation of markdown parsing.