teleren/devto huggingface dataset:
How to turn your golang programs into UML Class diagrams
Tags: go, uml
Published: 2019-07-09 21:14:54

Sometimes it helps to see a class diagram of your projects to understand the big picture. I have always been a fan of PlantUML. When it comes to drawing UML diagrams, plantUML is one of my favorites since drawings are generated out of a human-readable text file, which can be easily committed to git.

For that reason, I decided to write a Golang library to generate class diagrams from a Golang project.

Goplantuml is a Golang library with an added command that you can install if you run go already. It basically turns code like this
```golang
package goisawesome

import "strings"

type Foo struct {
	field       int
	PublicField bool
	*strings.Builder
}
type MyInterface interface {
	GetValue() bool
}

func (f *Foo) myPrivateFunction() int {
	return 3
}

func (f *Foo) GetValue() bool {
	return true
}

func (f *Foo) MyPublicFunction() bool {
	return true
}
```

into this 
```
@startuml
namespace goisawesome {
    class Foo {
        - field int
        + PublicField bool
        - myPrivateFunction() 
        + GetValue() 
        + MyPublicFunction() 
    }
    interface MyInterface {
        + GetValue() 
    }
}
strings.Builder *-- goisawesome.Foo
goisawesome.MyInterface <|-- goisawesome.Foo
@enduml
```
which can be used with plantuml to generate a nice class diagram. 

see example [here](http://www.plantuml.com/plantuml/uml/VK_BIi0m4BpdA_ReW_OBF1GF5Gz2JzwtwROiR1B99agf_NTZAIMAE8UGcSnCc4uJnfIT68-Ez0qjmH9OyOCqE8BDG84LL8K-X6z-ee6PIIPWdoxj7eOy2jl-U1b3aChkrY7oEoRgixU9Wx-vXIhvHEaL9TDFzMKz6tzbzkCiVrESqLBnFL_txP_MtUn6KsI_QFkOMIQASDSqzUQsx3GrhxiVFlymT-IdxEGB)



If you are interested, swing by the goplantuml repo. {% github jfeliu007/goplantuml %} I would love to hear you opinions. I also wrote [an article](https://www.jazzcoding.com/effortless-class-diagrams-for-all-your-golang-needs/) about the program and how it is used if you would like more information.
Elvis operator ?:
Tags: kotlin, discuss
Published: 2019-07-09 21:04:30

I have started to learn Kotlin. And my lector told me about Elvis operator, but for me, it's a ternary operator. Oh... I didn't know about that, especially why people have kind of this association in their mind.

![](https://thepracticaldev.s3.amazonaws.com/i/6j3wmn15zj3vp3qyfctv.jpg)

Do you know about that? Or have you faced such a situation?
Job Boards
Tags: career, beginners, discuss, webdev
Published: 2019-07-09 20:31:08

Wondering where you can find jobs to apply to? Wonder no more.

Note: You can use these sites to find jobs but you should apply to those jobs on a company's website whenever possible for best results. 

- [angellist](http://angel.co/)
- [stackoverflow careers](https://stackoverflow.com/jobs/get-started)
- [ycombinator](https://news.ycombinator.com/jobs)
- [whoishiring](https://whoishiring.io/search/40.7128/-74.0060/11/?location=New%20York&search=engineering)
- [weworkremotely](https://www.reddit.com/r/forhire)
- [dev.to](https://dev.to/listings/jobs)
- [builtinnyc](https://www.builtinnyc.com/jobs)
- [glassdoor](https://www.glassdoor.com/Job/long-island-city-software-engineer-jobs-SRCH_IL.0,16_IC1132310_KO17,34.htm)
- [google jobs](https://www.google.com/search?q=software+engineer&ibp=htl;jobs#fpstate=tldetail&htidocid=NuBErkxJNlq_hi2vAAAAAA%3D%3D&htivrt=jobs)
- [reddit](http://reddit.com/forhire)
- [monday.vc](http://monday.vc/)
- [careerbuilder](https://www.careerbuilder.com/jobs-software-developer-in-new-york?location=)
- [keyvalues](https://www.keyvalues.com/)
- [linkedin](https://www.linkedin.com/jobs)
- [dice](https://www.dice.com/)
- [indeed](https://www.indeed.com/)
- [themuse](https://www.themuse.com/)
- [monster](https://www.monster.com/)
- [craigslist](https://newyork.craigslist.org/d/software-qa-dba-etc/search/sof)
- [ziprecruiter](https://www.ziprecruiter.com/)
- [cybercoders](https://www.cybercoders.com)

If you're having a hard time getting first round interviews, also see [Getting More First Round Interviews](https://dev.to/peteratticusberg/getting-first-round-interviews-3em6)
Demystifying the ASP.NET Core Request Pipeline: Preface
Tags: aspnet, net, kestrel, iis
Published: 2019-07-29 18:07:24

---
title: Demystifying the ASP.NET Core Request Pipeline: Preface
published: true
tags: ASP.NET,.NET,Kestrel,IIS
canonical_url: https://jimbuck.io/asp-net-core-req-pipe-0/
---

> This is Part 0 of a 3 part series on the ASP.NET Core Request Pipeline. Check back here for links to the follow-up articles!

----

![Demystifying the ASP.NET Core Request Pipeline: Preface](https://images.unsplash.com/photo-1513828646384-e4d8ec30d2bb?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzczfQ)

Every day we use products and services that we could consider a "black box". Look at cell phones for example. Most people (myself included) have absolutely no grasp of exactly how two people can be connected when thousands of miles apart. [Scott Hanselman eloquently phrases it](https://www.hanselman.com/blog/ImJustACavemanTheHanselmanCorollaryToTheClarkeWheelerLaws.aspx) as **"each new layer of abstraction becomes indistinguishable from magic"**. Life would be pretty rough if we could only use things we had a complete technical understanding of.

But there are times when **learning about that "magic" can provide a ton of value**. It could be as simple as having a better understand when problems hit, which could save you time and frustration. Or it could help steer your logic away from potentially problematic scenarios, **improving performance and avoiding security nightmares**.  

When working with ASP.NET it's very easy to get started and just breeze over the architecture details. In this series I am going to **dive into the ASP.NET Core Request Pipeline from start to finish**. I will cover everything from hosting models and pipeline fundamentals to building your own custom middleware. While I will focus on ASP.NET Core 2.2 and beyond, **the same general tips should also apply to any OWIN based app** , even in ASP.NET MVC5.

I hope you enjoy the series and get to learn something new! If you have any comments or questions hit me on [Twitter](https://twitter.com/jimbuckio)! Follow me to get notified about the next part!
Horizontally and Vertically Centering in CSS
Tags: css, html, beginners, tutorial
Published: 2019-07-09 19:44:59

If you're anything like me, vertically and horizontally centering an HTML element has been the bane of your existence at some point in your career.

Luckily, this solution works in [every browser, even IE 11](https://caniuse.com/#feat=flexbox):

```css
display: flex;
justify-content: center;
align-items: center;
```

`justify-content` is for horizontal alignment by default. Removing it or setting `justify-content: flex-start;` places the child element on the **left**. Setting `justify-content: flex-end;` places the child element on the **right**.

`align-items` is for vertical alignment by default. Removing it or setting `align-items: flex-start;` places the child element at the **top**. Setting `align-items: flex-end;` places the child element at the **bottom**.

Here's an [example](https://jsfiddle.net/zt8sb6qm/1/).

You can probably stop using `padding`, `absolute` left/right and top/bottom positioning, `float`, `line-height`, `transform`, and any other tricks :)
Do you know any social network for personal projects ?
Tags: help, discuss
Published: 2019-07-09 18:59:26

Hello everyone,

Many of us (not everyone) love to create side projects and more often than not these projects are never finished or never see a single user.

That's a shame that so many hours and motivation are poured into the void. So I was looking for some kind of social network for digital makers. Whether it be art, code, sound, etc, you could share what you're working on and get unbiased feedback. At the same time it could allow to connect people with complementary skills willing to work together.

There's so many social network out there, but I can't find any dedicated to ongoing projects and [I don't seems to be the only one](https://www.reddit.com/r/AppIdeas/comments/8sc63n/a_social_network_for_side_projects/).

Do you know anything like it ?
Why Do You Write Code?
Tags: programming, career, webdev, dev
Published: 2019-06-29 17:31:55

---
title: Why Do You Write Code?
published: true
description: Reflecting on something one may not be asked frequently.
tags: [Programming, Career, Webdev, Dev]
---
_Originally published on [ali-ilman.com/blog](https://ali-ilman.com/blog/)._

I recently read an Instagram [post](https://www.instagram.com/p/BzNcYFxgwCf/) by a fellow programmer. There's a question in the post, which is _why do you code / program_. Whenever I read such question, the first thing that pops into my mind would be, _the satisfaction in seeing the code you wrote brings a product to life_.  

I remember starting out on [Khan Academy](https://www.khanacademy.org/) back in May 2014. Oh Lord, it feels like that was yesterday. 😱 I can't recall exactly what I learned on Khan Academy, but I believe it was Drawing & Animation in JavaScript. I'm not sure why I started with Drawing & Animation. To be quite honest about it, I hated it! 😂
I didn't finish the course either, and I never liked drawing anyway when I went to school. Plus the course felt rather advanced for a beginner, or it could be me being oblivious to there being more beginner-friendly courses. 🤷‍♂️ After Khan Academy, I learned on Codecademy, freeCodeCamp, SoloLearn. It was mostly JavaScript tutorials. I never really got going after each of the fundamental JavaScript courses on each platform. I was trapped in-between the _after tutorial_ and the _creating projects_ phases. Having known myself more, I find that Udemy courses give me those _Oh I see!_ moments. If only I discovered the platform much earlier!

But two things stuck with me, and they are the excitement in creating something and knowing that you can create almost, if not, anything, with code. One can solve a problem for society, improvise on something for fellow developers and many more!

Fast forward to 2019, I've been working for a year & a half. Including the reasons above, why do I write code?  

1. Excitement in creating something.
2. Knowing that you can create almost, if not, anything, with code, and contribute to society in such way.
3. The satisfaction in seeing the code you wrote brings a product to life.
4. Writing code is a piece of art. Clean, readable code is utter beauty, poetry-esque!
5. Solving code problems are satisfying.
6. The flexibility in being able to work from basically anywhere.
7. The demand for programmers.

How about you? Why do you write code? 🤓
Job Inteview and Challenge
Tags: reactnative, react, career, javascript
Published: 2019-07-09 18:21:20

Hi!

Today came to talk about job interview. 

Two week ago, I was invited to take React test for a company. For the challenge and also for the remuneration I decided to try, even because I'm rusting on the tecnology that I like the most.

The first step was a conversation with Resourses Human. Comportamentals questions, what I like to the most, my ambitions, etc. So far so good. 

The second step, the challenge arrived. 

**Objective**

  The goal is to create a web application or mobile application that allows managing a user registry.

- Should be created with React; 
- The Home Screen should be be able to view the list of users;
- It should be possible to register new users;
- It should be possible to delete users from the list.

**Details**
*Can use BD or LocalStorage*

*The screens will be the result of your imagination. Impress us!*



Can I write a post about how I developed the challenge. 


Well, that's it! Would you like me to share how I developed the challenge?
Observing Great Leadership in Tech
Tags: discuss, leadership
Published: 2019-07-09 17:42:37

---
title: Observing Great Leadership in Tech
published: true
description: Who are some successful Tech leaders the developer community should be learning from?
tags: discuss, leadership
---

Amazing things are being accomplished by Tech company leaders such as [Tracy Lee](https://twitter.com/ladyleet), [Anil Dash](https://twitter.com/anildash), and [Nat Friedman](https://twitter.com/natfriedman).

Tracy Lee is the leader behind [This Dot Labs](https://www.thisdot.co/labs), a mentoring, training, consulting, and apprenticeship company for web developers. She is a core part of Node.js Developer Relations and is a great part of the developer community.

Anil Dash is the leader behind [Glitch](https://glitch.com/), a simple tool for creating web apps with a friendly, creative community. He recently posted about Glitch's [2018/2019 successes](https://twitter.com/anildash/status/1148603066092052482) which is worth a read. Anil consistently shares his thoughts, learnings, and actions surrounding inclusive and ethical tech.

Nat Friedman has been leading [GitHub](https://github.com) since the acquisition by Microsoft. He has released many new features and is very active with the GitHub developer community. I was lucky enough to chat with him about his success and some of his leadership values. In this [phone call](https://twitter.com/ArrowoodTech/status/1137499234679349251) I learned about the value of momentum and how he has attributed this to the recent success of GitHub.


**What are some other leaders in our tech community we should be paying attention to?** 

I am especially looking for leaders from under-represented groups and leaders that are improving the community through inclusion and impactful actions.

If you aren't already I would recommend following the leaders I listed above so you can learn from them too!
Read a Specific Line of a Text File in C#
Tags: csharp, tutorial, beginners
Published: 2019-07-09 17:36:13

---
title: Read a Specific Line of a Text File in C#
published: true
tags: csharp,tutorial,beginners
series: C# File I/O
cover_image: https://wellsb.com/csharp/wp-content/uploads/sites/2/2019/05/beginners-file-readline-min.png
---

Have you ever needed to get a value from a specific line number of a text document in C#? Undoubtedly, you learned there is not a native method for doing this using the StreamReader object. The class contains a ReadLine() method, but unfortunately it does not have an overloaded constructor that can accept a line number as an argument.

In this tutorial, you will write a custom method that you can invoke any time you need to read the contents of a specific line from a text file.

This is the fourth part of a series about File I/O in C#.

[Read Tutorial](https://wellsb.com/csharp/beginners/async-write-to-text-file-csharp/)
Improve Pull Requests with 5 Habits
Tags: git, webdev, beginners, productivity
Published: 2019-07-09 17:26:03

---
title: Improve Pull Requests with 5 Habits
published: true
description: Write better commit messages that invite feedback and communicate clearly for years to come
tags: #git #webdev #beginners #productivity
---

## 1. Start your message with a verb
Spelunking git history is always a chore.
You can make that chore easier with clear, strong messages.
Start with the verb.
Keep it short.

`Fix e2e login spec`
`Add inactive person styling`
`Remove presence validation from age on Person model`
`Decrease TTI on dashboard by 10%`

---

## 2. Write messages in an imperative style
```diff
- Fixed nav jitter
+ Fix nav jitter
```

```diff
- Added CTAButton
+ Add CTAButton
```

*Read ['Should I use past or present tense in git commits message'](https://stackoverflow.com/a/3580764) on stack overflow*

---

## 3. Use `have/need/get` to describe your PR

Break you description into 3 logical sections:
Past (have), present (need), and future (get).

### Have
Describe what exists.
Demonstrate empathy for the code, team, and constraints that created it.
Don't shit on the past.

### Need
Describe the human need.
This is the value that customers get.
Don't jump into technical details yet.
You can probably copy/pasting this from Trello/Jira.

### Get
> You can't always get what you want

Mick Jagger's right.
Describe your solution in technical terms.
Admit where it falls short.
Point out areas where you don't have enough information to make a better solution.

### Bonus: Reference 
Link supporting pages, documents, and verbal instructions that helped form your solution.
Give credit to co-workers that helped you.
This gives reviewers insight into your process and improves your credibility.

---

## 4. Use the `--fixup` flag to commit fixes
Once a review starts, useless messages like `fix`, `oops`, `shit...` start piling in.
Use the `--fixup` flag to make these commits more descriptive.

`git commit --fixup a1b2c4`

Github has a [Confirm squash and merge](https://github.blog/2016-04-01-squash-your-commits/) option that will squash all `fixup!` commits into the commits they reference.

*Read [Auto-squashing Git Commits](https://thoughtbot.com/blog/autosquashing-git-commits) on thoughtbot's blog*

---

## 5. Check your ego 
Remember that you're making a "pull request" — not a "pull demand".
A pull request is the start of a conversation.
Don't assume you got everything right.
Be open to feedback.
You'll probably learn something you didn't know.

Have fun 🥳
Let me know what you learn 🙌

✅ [chantastic](https://twitter.com/chantastic)
Intro to Stackbit: Build a Custom JAMstack in Minutes
Tags: jamstack, webdev, javascript
Published: 2019-07-16 13:00:45

---
title: Intro to Stackbit: Build a Custom JAMstack in Minutes
published: true
tags: JAMstack, webdev, javascript, web development
canonical_url: https://snipcart.com/blog/stackbit
---

![Intro to Stackbit: Build a Custom JAMstack in Minutes](https://snipcart.com/media/204534/stackbit-og.jpg)

Ever take a long flight with children? 

It’s horrendous—especially if they’re your own. 

My wife and I have two (both under 3), so when we go somewhere we try to make the process as painless as possible. Luckily travel planning sites like Google Flights have simplified everything. We have all our options in front of us, we pick and choose what times/airlines/hotels work best, and build the perfect round trip with a few clicks.

Easy.

If only building JAMstack sites were as simple as building vacations, right? Well, thanks to Stackbit, it now is. 

If this is your first time hearing about Stackbit, don’t worry, it’s pretty new. In fact, it’s still in beta at this point. But it’s our prediction that you’ll soon be hearing a lot more about Stackbit, so we think it’s important to get familiar with it as early as possible. That’s why this article is going to cover:

- What Stackbit is
- Why Stackbit was created
- Unibit—their “meta” static site generator—and custom themes

By the end of this post, you should be ready to build your very own JAMstack site in just a matter of minutes. 

  

→ Read the full post [here](https://snipcart.com/blog/stackbit)
Open source at Zenika
Tags: opensource, tutorial
Published: 2019-07-09 17:00:29

A few weeks ago we announced the launch of our brand new [website](https://oss.zenika.com) at [Zenika](https://www.zenika.com/) about our open source culture. It aims to promote our projects and those of our colleagues.

Here is a few of these:

- [immutadot](https://github.com/zenika-open-source/immutadot) is a JavaScript library to deal with nested immutable structures.
- [bento-starter](https://github.com/kefranabg/bento-starter) is full-stack solution to quickly build PWA applications with Vue.js and Firebase.
- [Emendare](https://github.com/jimmyleray/Emendare) is a democratic platform to draft amendable texts.

You can find more projects on our [GitHub's organization](https://github.com/zenika-open-source) or on our [website](https://oss.zenika.com).

We also wrote an article on how to [get started in open source](https://oss.zenika.com/white-paper/getting-started). This is a first of six articles on the world of open source.

If you want further news about our projects or future articles don't forget to follow our twitter [@ZenikaOSS](https://twitter.com/ZenikaOSS)!
Thoughts about a two pointer array problem - #27 LeetCode
Tags: leetcode, javascript, algorithms
Published: 2019-07-09 16:42:54

Please check the link first for the details of the problem.
[Remove Element](https://leetcode.com/problems/remove-element/)
> Given an array `nums` and a value `val`, remove all instances of that value in-place and return the new length. Do not allocate extra space for another array, you must do this by modifying the input array in-place with **O(1)** extra memory. The order of elements can be changed. It doesn't matter what you leave beyond the new length.

> Given `nums = [3,2,2,3], val = 3`, your function should return length = 2, with the first two elements of `nums` being 2. It doesn't matter what you leave beyond the returned length.

The first thought to this problem was a naive solution — to create another array for *filtered* values. However, under the requirement of memory usage. We have to modify the input array in place.
The output should be a number N which represents the *valid length* of the array, which means the first N elements should not have the `val`.

I decided to use two pointer method to solve this problem.  
- [ ] Why?
With two pointers `index`, `targetIndex`, `index` representing the index of `nums` loop function and `targetIndex` representing the result array index which starts from 0. Imagine you are operating a new array based on the original array, you are just moving the qualified values forward into the new array.
In the loop of `nums`,  if `nums[index]` is not equal to `val`, we move the values to the new array, `nums[targetIndex] = nums[index]` and increment the `targetIndex` by 1 to expand the new array. If `nums[index]`is equal to `val` we just skip the the value movement, so the new array will only include the qualified values.

```javascript
/**
 * @param {number[]} nums
 * @param {number} val
 * @return {number}
 */
var removeElement = function(nums, val) {
    const arrLength = nums.length;
    if (arrLength === 0)
        return 0;
    let targetIndex = 0;
    for(let index = 0; i < arrLength; index++) {
        if (nums[index] !== val)
            nums[targetIndex++] = nums[index];}
    return targetIndex;
};
```
Firefox 68.0 gets a color contrast accessibility checker
Tags: webdev, a11y
Published: 2019-07-09 16:36:19

---
title: Firefox 68.0 gets a color contrast accessibility checker
published: true
description: Firefox has landed an audit for contrast issues
tags: webdev, a11y
cover_image: https://thepracticaldev.s3.amazonaws.com/i/wldrp2gh8zyjy6f6xm1a.png
---

What has been an audit in Chrome via Lighthouse has made its way into the latest version of Firefox. The feature is still in beta but provides an easy way to quickly check a page for color pairings that do not meet the WCAG standards for color contrast.

Color contrast is an important part of accessibility as it makes text easier to read for everyone, not just those with impairments.

To run the audit open the developer tools (F12) -> click `Accessibility` in the developer tools menu -> click `Turn On Accessibility Features`, if necessary, and finally click `contrast` in the sub-menu at the top under "Check for issues".

Once the audit has completed you can see which text does not meet the standard and details about why such as the colors used and the ratio of those colors.

Happy testing!