teleren/devto huggingface dataset:
Refactor commit message for better readability
Published: 2022-12-15 21:18:44

Writing good commit messages is an important part of any software development process. Not only do they provide valuable information about the changes made to the code, but they also help to document the history of the project and make it easier for other developers to understand and work with the code.

One of the key recommendations for writing good commit messages is to follow a specific format. This typically includes a subject line that concisely summarizes the change, followed by a blank line and then a more detailed description of the change. The subject line should be written in imperative mood, as if you are giving an order or command, and should be no longer than 50 characters.

Here is an example of a well-formatted commit message:

```
Fix bug in login page

The login page was not properly validating user input, which allowed
attackers to bypass the authentication process. This commit fixes the bug
by properly sanitizing user input and implementing additional validation
checks.

```

In terms of writing style, it is important to be concise and clear in your commit messages. Avoid using jargon or technical terms that may not be understood by everyone on the team, and try to provide enough information to give context to the changes you have made. It can also be helpful to include links to relevant issues or references in the detailed description.

Different platforms, such as Git and GitHub, have their own ways of interpreting and displaying commit messages. For example, Git will typically only display the subject line of the commit, while GitHub will display the full commit message and may highlight certain keywords or phrases. In both cases, following the recommended format and writing style will make it easier for the platform to interpret and display the commit message in a useful and readable way.

In conclusion, writing well-composed commit messages is an essential part of any software development process. By following a specific format and writing style, you can ensure that your commit messages are clear, concise, and easy to understand, making it easier for other developers to work with your code and understand the history of the project.
25 Websites to Stay Up-To-Date for Web Developers in 2023
Tags: webdev, beginners, programming, tutorial
Published: 2022-12-15 21:12:10

25 Best websites to stay up-to-date for web developers in 2023
Here is the compiled [list of the 25 best websites](https://www.hmablogs.com/websites-to-stay-up-to-date-for-web-developers/) for web developers in 2023:

**Below are the 4 Most Useful Jobs Websites for Web Developers:**

1. LinkedIn
2. Upwork
3. Freelancer
4. Fiverr

**6 [Best News Websites](https://www.hmablogs.com/websites-to-stay-up-to-date-for-web-developers/) for Web Developers:**

1. Hacker News
2. Designer News
3. Reddit
4. A List Apart
5. DEV Community
6. Slashdot

**Here is the list of 5 Most Useful Tutorials Websites for 
Developers:**

1. Google Developers
2. Smashing Magazine
3. GeeksforGeeks
4. CSS-Tricks
5. W3Schools

**The 5 most useful Code Challenges Websites for Web Developers:**

1. Codewars
2. HackerRank
3. CodeCombat
4. LeetCode
5. CodeChef

**Here is the list of 5 Best Networking Websites for Web Developers:**

1. Coderwall
2. GitHub
3. Stack Overflow
4. CodePen
5. Tech Twitter

To learn more details visit the [link](https://www.hmablogs.com/websites-to-stay-up-to-date-for-web-developers/): 

{% embed https://www.hmablogs.com/websites-to-stay-up-to-date-for-web-developers/ %}
15 Best MySQL GUI Clients for macOS
Tags: mysql, database, mysqlgui, mac
Published: 2022-12-15 21:03:49

---
title: 15 Best MySQL GUI Clients for macOS
published: true
description: Top MySQL GUI Clients for macOS
tags: #mysql #databases #mysqlgui #mac 
# cover_image: ![best mysql clients for mac](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2dbsauolwtnvh6c16fab.jpg)
# Use a ratio of 100:42 for best results.
# published_at: 2022-12-15 20:59 +0000
---
There are plenty of top-level MySQL tools for your Mac right around the corner. To make your search easier, we have prepared and reviewed a handy selection for you - most of the following tools are definitely among the best of their kind and boast a user-friendly graphical user interface - https://blog.devart.com/best-mysql-client-for-mac.html
Simple ActiveRecord filtering with tiny_filter gem
Tags: ruby, rails, programming
Published: 2022-12-15 20:54:36

I would like to introduce you to my new gem, the basic idea of which I have used in many commercial projects over the past 3 years. And, since the gem is now done, it's time to make it public and open-source.

[tiny_filter](https://github.com/lassoid/tiny_filter) provides an abstraction layer for filtering collections with a convenient helper that makes your ActiveRecord method chaining look like this:

```ruby
Post.filter_by(tag_id: 1, from: 2.days.ago).order(:created_at)
```

All you have to do is implement a filter class with whatever logic you want. The gem provides you with a pretty DSL that makes your code look well:

```ruby
# app/filters/post_filter.rb
PostFilter < ApplicationFilter
  filters :tag_id do |scope, value|
    scope.joins(:tags).where(tags: { id: value })
  end

  filters :from do |scope, value|
    scope.where("created_at >= ?", value)
  end
end
```

Common use cases:
1) Filtering collections with user input.

```ruby
# app/controllers/application_controller.rb
class ApplicationController < ActionController::Base
  private

  def filter_params
    return {} unless params.key?(:filter)

    params.require(:filter).permit(*permitted_filters)
      .to_h.symbolize_keys
  end

  def permitted_filters
    []
  end
end

# app/controllers/posts_controller.rb
class PostsController < ApplicationController
  def index
    @posts = Posts.filter_by(filter_params).order(:created_at)
  end

  private

  def permitted_filters
    %i[tag_id from]
  end
end
```

2) Simplifying queries.
[tiny_filter](https://github.com/lassoid/tiny_filter) gives you a flexible abstraction where the interface doesn't depend on the DB structure, so you can use it anywhere instead of ActiveRecord `scope`s and `where`s.

```ruby
# filter_args - a hash with filter params that you can collect dynamically.
posts = Post.filter_by(filter_args)

# versus where:
posts = Post.all
posts = posts.where("created_at >= ?", from) if from
posts = posts.joins(:tags).where(tags: { id: tag_id }) if tag_id
posts

# and versus scope:
posts = Post.all
posts = posts.from(from) if from
posts = posts.with_tag(tag_id) if tag_id
posts
```

More links:
[Documentation](https://github.com/lassoid/tiny_filter#readme)
[RubyGems](https://rubygems.org/gems/tiny_filter)
Simple KAFKA streaming Pipeline
Published: 2022-12-15 20:52:36


![Kafka Logo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q1gy66okoc5ow888fzqm.png)






Let's say you are looking to explore the relationship between extreme weather and people's conversations about it on Twitter, you can gather and analyze weather and Twitter event data streams.


You will need the following (both in JSON format):

- a Weather API to obtain real-time & forecasted weather data,
- a Twitter API to also get real-time tweets & mentions.

The National Weather Service API can be accessed [here](https://www.weather.gov/documentation/services-web-api)

The Twitter API can be accessed [here](https://developer.twitter.com/en/docs/twitter-api)

2. Create a **weather topic** and **Twitter topic** in a Kafka cluster with some partitions and replications. 

3. Create a **weather producer** and **Twitter producer** to publish the JSON data to the two topics, respectively. 

4. Create a **weather consumer** and **Twitter consumer** to read the events from the two topics, and the bytes stored in the Kafka topics into event JSON data. 

5. Use a DB writer to parse the JSON files and create database records, which can be written into the database with SQL insert statements. 


Finally, you can query and visualize the database records in a dashboard to complete the end-to-end pipeline.


Additional infos:

**<u>What is a Kafka DB Writer:</u>**
A Kafka DB writer is a type of software that enables a user to write data from a database into a Kafka topic. It can be used for data integration, stream processing, or data ingestion. Kafka DB writers are often used for large-scale distributed systems, such as streaming analytics and real-time decision making.

**<u>KAFKA TOOL - ksqlDB: </u>**
KSQLDB is an open-source, cloud-native streaming SQL database built on Apache Kafka. It enables you to easily develop streaming applications that process data in real-time and respond to events as they occur. KSQLDB supports a wide range of operations including stream processing, time-based event-driven processing, windowed operations, joins, and more. It also provides a high-performance SQL query engine for accessing and analyzing data from Apache Kafka and other sources. With KSQLDB, developers can quickly build and deploy powerful streaming applications with a few lines of code.


![Kafka SLQ DB Pipeline](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kmyhgaze75bvp6mfxihr.png)
Ng-News: Episode 22/49 - Versatile Angular Style, Pro Template-Driven Forms
Tags: javascript, angular, webdev, programming
Published: 2022-12-15 20:48:20

Younes Jaaidi introducing the concept of "Versatile Angular Style" that makes the integration into various external (build) tools easier. Ward Bell suggesting the use of template-driven forms over reactive.

{% embed https://youtu.be/8eyKUUKGFYc %}

## Versatile Angular Style

Younes Jaaidi came up with an analysis why modern build tools, like Vite, are so hard to integrate into Angular. Whereas with other frameworks, like React, its almost like a walk in the park.

Younes shows that if we would use inlining templates and styles, use the inject function and of course standalone components, then Angular components don't require any special treatment anymore.

---

For example, look at the dependency injection via the constructor. TypeScript removes a parameter's type. So the information about the injected type is not available during the runtime.

That's why the TypeScript compiler adds specific metadata, which has to be enabled in the tsconfig.json. Now guess what? Non-Angular tools might not have that configuration enabled, so DI fails.

If, on the other side, we go with the new inject function, that's not a problem anymore. The parameter is the type/class itself. Therefore it is available in JavaScript, and no particular TypeScript configuration is necessary.

---

Younes calls these kinds of "stripped-down" components versatile components.

And tools like Vite, Vitest, SWC, or Playwright component testing do not have any issues with them anymore, and the integration is quite easy.

{% embed https://marmicode.io/blog/versatile-angular %}

## Template-Driven Forms for Everyone

At the official Angular Meetup, Ward Bell presented some good arguments for template-driven forms. Compared to reactive forms, they require less code and we can do the same things until it comes to validation.

For that part, Ward suggests not using Angular's validation feature at all but to go with a more sophisticated validation library, like vest.

{% embed https://youtu.be/OE3hRKFj60U %}

To get more information about the validation part, you can watch his talk at this year's ng-conf which is available for free, when you register.

{% embed https://pages.ng-conf.org/ng-conf-2022/ %}

By the way: ng-conf opened their Call for Papers for the conference in 2023. You can submit your talk until the second of January.

## New Releases

### Nx 15.3

Last but not least, Nx 15.3 came out with support for standalone projects. You have can now have only one Angular application which is also located in standard src directory and not in the apps directory.

{% embed https://youtu.be/KBFQZw5ynFs %}

### Cypress 12 

And we have new major release for Cypress with version 12. The possibility to switch between origins within a test left the beta status and is now generally available.

{% embed https://www.cypress.io/blog/2022/12/06/announcing-cypress-12/ %}
Jest Mocking: Behind the scene
Tags: jest, mocking, jestmocking, javascript
Published: 2022-12-15 20:46:36

Jest is a famous javascript testing framework built on top of jasmine and maintained by Meta.

While writing unit tests or integration tests we need to mock several functions that calls api or persists data to database.

In this article, I will share how mock functions work behind the scene or the implementation of jest mock method i.e. 

```
fn()
```
So, if you have used jest in any of your JS project, I can be sure that you have mocked any long running functions using fn() or spyOn() functions of jest. 

Now, I am going to reveal the implementation of the fn() function itself.

**Problem Statement:**
For example, we need to fetch post data from json placeholder and slugify the title of the retrieved post.

So, for this we need to write the following functions:

1. Retrieve the post data
```
let getPost = async ()=>{
  const response = await fetch('https://jsonplaceholder.typicode.com/todos/1');
  const post = await response.json();
  return post;
}
```

2. Slugify the retrieved post's title:

```
const slugifyTitle = async () =>{
  const postToSlugify = await getPost();
  return postToSlugify.title.toLowerCase().replace(/ /g,'-').replace(/[^\w-]+/g,'');
}

```

Now, if we want to run the function, it will actually hit the api endpoint and network call.

```
slugifyTitle().then(response => {
  console.log(response) // delectus-aut-autem
})
```
Let's see how to mock the getPost() function to escape the api call. So, first we need to write a function that mocks the getPost function.

```
const fn = (functionToBeMocked) => {
  
  const mockFn = (...args) => {
    mockFn.mock.calls.push(args)

    return functionToBeMocked(...args)
  }

  mockFn.mock = { calls: [] }

  return mockFn
}
```
Now, let's mock the getPost function using fn().

So, now we want out getPost function to get the following data:

```
const mockedData = {title:'my mocked title'}
getPost = fn(()=>mockedData)
```

Now, if we call slugifyTitle() function, it will not hit api/network call rather it returns the data we want:

```
slugifyTitle().then(response => {
  console.log(response) // my-mocked-title
})
```

So, we can conclude that making mock function is that easy and a simple concept. 

In this blog, I just tried to show the basic mechanism of mocking functions in jest or other testing libraries but definitely the real fn() function in jest is not that small.
MySQL Export Database
Published: 2022-12-15 19:59:36

---
title: MySQL Export Database
published: true
description: How to export mysql database?
tags: 
# cover_image: ![MySQL Export](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/939u7a7h3saut468n28e.png)
# Use a ratio of 100:42 for best results.
# published_at: 2022-12-15 19:54 +0000
---
In this article, you can learn about how to export MySQL database data to JSON files using mysqldump, MySQL Workbench and dbForge Studio for MySQL - https://infinigeek.com/mysql-export-database/
Part time remote jobs - RevampedCP
Tags: career
Published: 2022-12-15 19:27:28

####   Original Tweet From  [@RevampedCP](https://twitter.com/RevampedCP)
{% embed https://twitter.com/RevampedCP/status/1603453763125231628 %}


#### Patent Analyst - Chemical Engineering (Remote Contract)
🏙️ Company: [@ClarivateAG](https://twitter.com/ClarivateAG) 
🔗 Link:  https://careers.clarivate.com/search/jobdetails/patent-analyst---chemical-engineering-remote-contract/327a0d7f-1d79-48fe-b413-2622ae43a2b7



#### Professional Branding Specialist, Learning Center - Part time
🏙️ Company: [@LHH_Global](https://twitter.com/LHH_Global) 
🔗 Link: https://jobs.jobvite.com/lhhcareers/job/omvpkfwk
AdSpace Here!!




#### Part-time Tax Compliance Reviewer
🏙️ Company: [@FORVIS](https://twitter.com/FORVIS) 
🔗 Link:  https://jobs.forvis.com/jobs/3519/part-time-tax-compliance-reviewer



#### Remote Part Time Licensed Therapist
 🏙️ Company: [@Thriveworks](https://twitter.com/Thriveworks) 
🔗 Link:  https://boards.greenhouse.io/embed/job_app?token=5433186003 


#### Virtual Pediatric Therapist (Part-time,Afternoon/Evenings)
 🏙️ Company: [@hazelhealthinc](https://twitter.com/hazelhealthinc) 
🔗 Link: https://boards.greenhouse.io/hazel/jobs/5393969003?source=LinkedIn
AdSpace Here!!




#### Cash Analyst (Part-Time AM)
🏙️ Company: [@FISGlobal](https://twitter.com/FISGlobal) 
🔗 Link: https://careers.fisglobal.com/us/en/job/FIGLUSJR0227211EXTERNAL/Cash-Analyst-Part-Time-AM



#### Tier 1 Customer Support — Portuguese (Part-Time Contractor)
🏙️ Company: [@ExecOnlineInc](https://twitter.com/ExecOnlineInc) 
🔗 Link: https://boards.greenhouse.io/execonline/jobs/6193885002?source=LinkedIn

AdSpace Here!!


#### Content Creator, Physics (Part-time, Contract)
🏙️ Company: [@khanacademy](https://twitter.com/khanacademy) 
🔗 Link: https://boards.greenhouse.io/khanacademy/jobs/4678308?source=LinkedIn


#### Product Design Mentor
🏙️ Company: [@pathriseio](https://twitter.com/pathriseio) 
🔗 Link: https://jobs.lever.co/pathrise/58f26eb9-aed5-4623-bafc-3002b9d38348?lever-source=LinkedInJobs

AdSpace Here!!


#### Clinician - Queer Resilience Clinic
🏙️ Company: [@findoctave](https://twitter.com/findoctave) 
🔗 Link:  https://www.findoctave.com/careers/5861407002/


#### Transcribers (Temporary, Part-Time)
 🏙️ Company: [@Cotiviti](https://twitter.com/Cotiviti) 
🔗 Link: https://careers-cotiviti.icims.com/jobs/9415/transcribers-%28temporary%2c-part-time%29/job 


AdSpace Here!!


#### Newsdesk Writer, DK Nation
🏙️ Company: [@voxmedia](https://twitter.com/voxmedia) 
🔗 Link: https://boards.greenhouse.io/embed/job_app?token=4738262&source=LinkedIn



Click [Here](https://www.knowledge-twitter.com/?utm_source=dev.to)  For More Posts Like This [https://www.knowledge-twitter.com](https://www.knowledge-twitter.com/?utm_source=dev.to)
Buying tech from questionable sources
Tags: watercooler, discuss
Published: 2022-12-15 19:57:08

I just treated myself to a very rare purchase I bought my own laptop, now I know like many of you I get a free MacBook as if it where water or something but it’s not mine and I’ve decided that I want my own innovation time on my own machine. I purchased my laptop from a retailer with very mixed reviews and I’m very nervous it will either:
- not arrive
- not be a laptop
- not be the right laptop

So all night I’m going to be very tense 😬, so tell me about your questionable 🤨 tech experience and did it pay to gamble despite what trust pilot said?
Typescript Recursion: It Is Over 999!
Tags: webdev, javascript, typescript, programming
Published: 2022-12-15 19:37:24

This is a proof of concept post, personally I do not find any use of this, yet

Typescript recursion stop at [49th or 999th](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-5.html#tail-recursion-elimination-on-conditional-types) loop

```ts
type CreateArrayWithLengthX<
    LENGTH extends number,
    ACC extends unknown[] = [],
> = ACC['length'] extends LENGTH
    ? ACC
    : CreateArrayWithLengthX<LENGTH, [...ACC, 1]>

type A = CreateArrayWithLengthX<999>['length'] // 999

type B = CreateArrayWithLengthX<1000>['length'] // any
```


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



[playground](https://www.typescriptlang.org/play?#code/C4TwDgpgBAwgThAhsCBBOdEgOoEtgAWAMhAHYDmhAGgDwBQUjURAogHIDiAKgBJQQAPFKQAmAZyikArgFsARhDgAaBk1QwY-IWXFQppANakA9gHdSAbQC6UALxRrKgHx2o6mBYDkAGzKUCnjaCwrqsnLyqjAD8bhqRUABcsAjIaBhYeIQkFNQ0Ydw8Sg4AdKXuRQCMVk50dKCQbq7wSCjomDj4xH65AJx9Tl6+OQFWdAD0Y0wAelF14NAAQk0prekdWd0EtBUADHs1E9NRQA)

This is not good if you want to dynamically generate array type with length more than 999

solution is to add another dimension to loop more than 999 times

```ts
type CreateArrayWithLengthX<
    LENGTH extends number,
    ACC extends unknown[] = [],
> = ACC['length'] extends LENGTH
    ? ACC
    : CreateArrayWithLengthX<LENGTH, [...ACC, 1]>

type Exceed999<
    ARR extends 1[],
> = [...ARR['length'] extends 0 ? []: [...CreateArrayWithLengthX<999>,...Exceed999<ARR extends [...infer S extends 1[], infer P] ? S : never>]]

type V = Exceed999<CreateArrayWithLengthX<10>>['length'] // 10x999 = 9990
```

[playground](https://www.typescriptlang.org/play?#code/C4TwDgpgBAwgThAhsCBBOdEgOoEtgAWAMhAHYDmhAGgDwBQUjURAogHIDiAKgBJQQAPFKQAmAZyikArgFsARhDgAaBk1QwY-IWXFQppANakA9gHdSAbQC6UALxRrKgHx2o6mBYDkAGzKUCnjaCwrqsnLyqjAD8bhqRUABcsAjIaBhYeIQkFNQ0Ydw8Sg4AdKXuRQCMVk50dKCQUCwCAMYQECIAnF30TG4ASn1aIRIVjnQu9halxagDXr45AUHaohIADFAx1klTpfBIKOiYOPjEfrldHU5K002t7Zc0s4PBOhK7xbikAGaKUADKQzeUFGViKX1+cCgAAUbDFAUlSBAAG6KJxWKy1erQABqrjubU63X2qSOGVO2X8tAqaycTnm5yWdAA9MymAA9KJAA)

now you can dynamically create array type with length larger than 999

however keep in mind that the max length of an array type is 10,000

It is possible to create an array with any length less than 10,000, not just the multiplier of 999, but that would involve a lot of works and I want to keep thing simple here
Journey Of Being Diploma Computer Engineer 🎓
Tags: webdev, javascript, computern, programming
Published: 2022-12-15 19:36:46


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l14r4nugif0i8eymm67f.jpg)
Dream Come True!🤩🎓
Struggling for three years in assignments, submissions, exams, projects and much more, finally made it being a "Diploma Graduate In Computer Engineering" from SVKM's Shri Bhagubhai Mafatlal Polytechnic on 24th November, 2022.
I have had the best three years of engineering in this college. These three years has taught me lots of important and interesting things which will be very helpful through my engineering life!! Never imagined that I would be so much interested in Web Development, Programming languages like C, C++, Python, Java. Application topics like Data Structures, .NET programming which includes VB.NET
, networking, maintaining a database in Oracle, Game Development, Hacking and much more!!
I would like to thank the Head Of Department of Computer Engineering Janardan Kulkarni for the constant support and guidance through my diploma journey. Would also like to thank the other teachers of Computer Engineering for the excellent teaching in all the different subjects in diploma.
A special thanks to my parents, family and friends for supporting me throughout. Means a lot!!
Now, heading towards getting my Btech Degree In Computer Engineering in the next 3 years!