teleren/devto huggingface dataset:
How do you setup your website? 
Tags: server, website, discuss, webdev
Published: 2020-10-20 20:51:49

So I did a post a few days ago about a "script-ready" virtual host. The script downloads and configures nginx on ubunto to be ready for the given host. 

Got me thinking about what do you guys use to setup a simple portfolio website or a smaller project? I've been using virtual hosting on a server for my small projects since I got into web development.


Here's a link to the script btw:
https://github.com/xhika/Create-A-Vhost
Hacktoberfest 2020 DONE!!!
Tags: hacktoberfest, github, opensource
Published: 2020-10-20 19:56:14

### My Hacktoberfest Experience

So, I finally completed my **Hacktoberfest 2020** with 4+ Pull Requests. It was fun and so exciting to contribute to OpenSource and my journey will not just stop here. Looking forward to further more interactions with the world of open-source.
Publish new posts via API on dev.to
Tags: bash, vim, automation, api
Published: 2020-10-20 19:48:08

---
title: Publish new posts via API on dev.to
published: true
series: Publishing workflow
---

So, this is it. My first article on dev.to. As you may guess, because of the title this article didn't use the web interface for publishing.

I wanted to use the dev.to API. At this point i have to admit, that i am a vim junkie and also love to automate stuff and like to write small nifty scripts which are handle anoying tasks which i have to do more than three or more times. 

I am also avoiding web interfaces if possible and prefer a cli over a gui. Therefore it is naturally for me to think about how to write and publish new posts in a seamless way from vim.

On the first glance, the [API Documentation](https://docs.forem.com/api/) from dev.to seem simple and well documented. 
The first steps shows how to create an API key, and all endpoints have examples for requests, responses and, what exited me the most, curl snippets.

My first target is, to publish a new post. So i took a closer look on the [create endpoint](https://docs.forem.com/api/#operation/createArticle). The request is build up like this:
```javascript
{
  "article": {
    "title": "Hello, World!",
    "published": true,
    "body_markdown": "Hello DEV, this is my first post",
    "tags": [
      "discuss",
      "help"
    ],
    "series": "Hello series",
    "canonical_url": "https://example.com/blog/hello"
  }
}
```
Very simple. I decided to write a small bash script which will post my new Post to dev.to. 

To publish a new article we just use this example as base:

```bash
curl -X POST -H "Content-Type: application/json" \
  -H "api-key: API_KEY" \
  -d '{"article":{"title":"Title","body_markdown":"Body","published":false,"tags":["discuss", "javascript"]}}' \
  https://dev.to/api/articles
```

With a little bit of fiddling and testing i come up with a small, but not foolproove bash script:
```bash
#!/bin/bash

# hold my api keys
source ~/dotfiles/.credencials

# for better readability
title=$1
tags=$3
# the content has to be json encoded 
content=$(cat "$2" | jq '.' --raw-input --slurp)

# write it to a tmp file for better debugging and also for using a file path in the curl call
tee /tmp/devtoArticle.md << END
{"article":{"title":"$title","body_markdown":$content,"published":false,"tags":[$tags]}}
END

curl -X POST -H "Content-Type: application/json" \
    -H "api-key: ${devtoApiToken}" \
    -d @/tmp/devtoArticle.md \
    https://dev.to/api/articles
```

In my opinion, this is just a *good enough* example, and will be evolve over the time. 

The call is like this:
```bash
./helper.sh 'Publish new posts via API on dev.to' 'content/Create a new post via API.md' '"bash", "vim", "automation","api"'

```
Use VS Code LiveShare!
Tags: beginners, vscode
Published: 2020-10-20 19:37:50

Although Zoom and Hangouts and such are 🆗, we have a better way to work collaboratively in real-time with VS Code.

Just use: 'CTRL/CMD + SHIFT + X' to toggle the extensions fuzzy search, and start typing 'liveshare.' You will C one directly from 'Microsoft' called: _Live Share Extension Pack
ms-vsliveshare.vsliveshare-pack._ Install it!

Now, on the left side of your screen you should see a shortcut icon as shown here: ![VS Code screenshot](https://dev-to-uploads.s3.amazonaws.com/i/fkbv0qofe77lsb7u63it.gif)

Click that icon and you have some options, such as to, "Start collaboration..."

![Start Collaboration... option](https://dev-to-uploads.s3.amazonaws.com/i/w4x9v7rt1o14dih71yij.gif)

Selecting that will prompt you to do some authorization via GitHub (or an MS account). Then, a 'join link' will be created (see bottom right of your screen).

From there you have options to share a terminal, have inline chat, audio call, etc. 🦄

![LiveShare Options](https://dev-to-uploads.s3.amazonaws.com/i/8412cxilyapfomsqumhv.gif)
Go - Tips - generate gomock
Tags: go, tips
Published: 2020-10-20 19:30:40

I got the following error today, but I was able to generate it successfully after deleting the existing mock file.

```go
% mockgen -source　./internal/app/usecase/xxx/repository.go -destination ./internal/app/usecase/xxx/repository_mock.go -package xxx
-: found packages xxx (repository.go) and mock_updateproteinevent (repository_mock.go) in /Users/xxx/go/src/proteinreminder/internal/app/usecase/xxx
2020/10/21 04:21:56 Loading input failed: loading package failed

# Delete
% rm -rf ./internal/app/usecase/xxx/repository_mock.go

# Run again and completed.
% mockgen -source　./internal/app/usecase/xxx/repository.go -destination ./internal/app/usecase/xxx/repository_mock.go -package xxx
```
My First Hacktoberfest Challenge experience!
Tags: hacktoberfest
Published: 2020-10-20 19:02:29

Just completed the **Hacktoberfest2020** challenge!! Congrats **DigitalOcean** team for successfully organizing this amazing event 🎉.

It was really fun experience working with **developers** from different countries to make the _open source projects_ **better**. _Made new friends_ & _Learned a lot_ while **Discussing issues**, **Coming up with solutions** & **Making successful PRs**.


It was my first Hacktoberfest experience & I am totally looking forward to participate again next year! 😃
Upcoming Livestream - Using Blockchain to Track (Real) Bugs 🐛
Tags: blockchain, database, livestream, beginners
Published: 2020-10-20 19:00:29

---
title: Upcoming Livestream - Using Blockchain to Track (Real) Bugs 🐛
published: true
description: Learn more about how blockchain is improving outcomes for farmers, researchers, and consumers.
tags: blockchain, databases, livestream, beginner
//cover_image: https://direct_url_to_image.jpg
---
Developers often mistakenly only consider blockchain as an inefficient, append-only data structure or log. In this worldview, they are left to wonder when and why they would leverage blockchain technology - especially when they're already using familiar technologies like Apache Kafka and standard REST APIs. 

One of my favorite use cases for blockchains is related to the public access to datasets, particularly when many clients or users want to "speak up" about the dataset's contents. 

By logging data in realtime in a low-trust environment like a blockchain, all kinds of users (in this case, researchers, farmers, and consumers) can access a raw data stream with a pseudonymous record of who added that information at what time. This enables compounding network effects - for example, reputation systems (how trustworthy is the data being added) or analytics systems (what is this data telling us), in a permissionless environment where they don't have to ask or authenticate for access to the data.

These are just a few of the reasons why I'm so excited about the Public Pest Network (PPN) - a team of University students and researchers leveraging the [Hedera Consensus Service](https://hedera.com/consensus-service) to provide easy ways for entomologists to track and make decisions about pest data. If farmers, researchers, and consumers, can all have better insights into where bugs are migrating to, it can drastically improve outcomes for our food supply and other essential processes like disease outbreaks. 

I'll be hosting a livestream with the PPN team next Tuesday, October 27th, where they will dive into what they're building. Join us if you're curious about how blockchain is going to be utilized in the real world!

> [Sign up for the virtual meetup!](https://www.meetup.com/Hedera-Hashgraph-Virtual-Meetup/events/273957725/)

I've also recorded a podcast episode with the PPN team, if you'd like a preview of what we'll cover on the live stream. Give it a listen!

{% youtube e529g5EYzZQ %}
Day 96: Vue project contd..
Tags: 100daysofcode, vue, design
Published: 2020-10-20 18:55:22

I'm still hanging in here. I implemented tabs in Vue and one card of the chef's special section

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/s5oyu0qm8rw5y7iiyg9e.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/r13pk43scv4gb8mlqy7n.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/70mwypvkwo5ub6yoajcv.png)

_That's it for day 96!_
Hacktoberfest2020 Done!
Tags: github, hacktoberfest, opensource, android
Published: 2020-10-20 18:52:04

Hacktoberfest finally done with my 4+ PRs🎉🎉!
Opensource is a really great feeling connecting with completely new projects and communities. My effort won't stop here and I'll keep working on OS as much as I can.😊
Go Error
Tags: go, productivity
Published: 2020-10-20 18:48:54

Tired of using boring #Go `errors.New`?

Try the latest [Go Error](https://gitlab.com/tymonx/go-error) package today. It implements replacement fields surrounded by curly braces `{}` format strings similar to Python string format.

Features:

* Implements **replacement fields** surrounded by curly braces `{}` format strings
* Format string by providing arguments without using placeholders or format verbs `%`
* Format string using automatic placeholder `{p}`
* Format string using positional placeholders `{pN}`
* Format string using named placeholders `{name}`
* Format string using object placeholders `{.Field}`, `{p.Field}` and `{pN.Field}` where `Field` is an exported `struct` field or method
* Set custom format error message string. Default is `{.BaseFile}:{.Line}:{.BaseFunction}(): {.Message}`
* Error message contains file path, line number, function name from where was called
* Compatible with the standard `errors` package with `As`, `Is` and `Unwrap` functions
* It uses the [Go Formatter](https://gitlab.com/tymonx/go-formatter) library
5 rules for writing (in)secure code, without anyone noticing!
Tags: security, jokes
Published: 2020-10-20 18:41:48

Follow these 5 rules to write bugs without anyone noticing.

1. Do not run any unit tests. Ever.
You'll want to be adding bugs during a big refactoring, nobody will notice!
Unless you're running unit tests that is! Turn them off!

2. Linting? 
No more linting! Code smells are awesome for hiding bugs in plain sight. Easy win!

3. No more vulnerability scanning
Those vuln scanners in CI are just what we don't need. Take any chance to avoid security checks, you'll thank me later!

4. Alcohol!
The [Ballmer Peak](https://xkcd.com/323/) is real! Get that nice bottle of whiskey and pour yourself a few fingers. The added creativity will make your bugs so much more interesting! 
Just take care to not accidentally write bug-free code.

5. No pair programming, ever. 
This is an obvious one. It's just way too easy for your partner to spot bugs as you're writing them.
Pro Tip: Complain about not being able to get into flow when you're not alone.
A site to help you get free icons in seconds
Tags: design, css, webdev, icons
Published: 2020-10-20 18:37:53

Hey there 👋, we are excited to introduce **FontUltimate**, a font icon library of beautiful vector icons which are scalable, easy to use & extremely fast to load. It's ready to use and **free** for any personal & commercial project.

**♦ Features**

✿ Explore the library, choose an icon, copy-paste the code inside your Web-App and It's done.
```
<i class="fu-solid fu-hippo" aria-hidden="true"></i>
```
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ku9jir0iljzjvf941omx.gif)             
 *************
       
✿ You can choose icons from different categories.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/7e05uycbf5hmt0zmjbxf.gif)
***
✿ You can also search for the icons, it's really simple.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/rktqi9v0oczjl0hhb6af.gif)

***
✿ It's fast and ready to use, made specifically for developers & designers.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/bo41b6nqzbd9nhe1l148.gif)
***

We are launching soon on Product Hunt. So if you would like to get an early access of [**FontUltimate**](https://www.producthunt.com/upcoming/fontultimate/) and be the part of this project, please do **Subscribe** by clicking [**here**](https://www.producthunt.com/upcoming/fontultimate/). It's completely free to subscribe.

  **♦ Subscriber Benefits** ( *What subscribers will get?* )

✿ Will get the early access to the full library for free.

✿ Can use it in any number of personal & commercial projects. 

✿ Can give feedback.

✿ Will get an access to FontUltimate's private #Slack channel.

✿ Will get notified about the new releases before any other user (non-subscriber).


You will ♥ using it as much as we ♥ making it.

Looking forward to see you. Please do [**Subscribe**](https://www.producthunt.com/upcoming/fontultimate/) .


Yours Sincerely,

Maroof Khan
React-Chrono 1.3 out with support for images and videos
Tags: react, showdev, javascript, webdev
Published: 2020-10-20 18:33:36

## What is react-chrono

[react-chrono](https://github.com/prabhuignoto/react-chrono) is a flexible timeline component built for React.
Please follow this [link](https://dev.to/prabhuignoto/flexible-timeline-component-for-react-21gd) for a detailed introduction and getting started guide that i had posted earlier.

{% github prabhuignoto/react-chrono no-readme %}

## ✨Features

- 🚥 Render timelines in three different modes ([Horizontal](#horizontal), [Vertical](#vertical), [Tree](#tree)).
- 🌲&nbsp; With [Tree](#tree) mode, layout the timeline cards vertically in a tree like fashion.
- 📺&nbsp; Auto play the timeline with [slideshow](#slideshow) mode.
- 🖼️&nbsp; [Display Images & Videos](#images) in the timeline with ease.
- ⌨&nbsp; Keyboard accessible.
- ⚡&nbsp; Data driven API.
- 🎨&nbsp; Customize colors with ease.
- 💪&nbsp; Built with [Typescript](https://www.typescriptlang.org/).
- 🎨&nbsp; Styled with [emotion](https://emotion.sh).

## 🌟 Whats new in 1.3

- [Embed images and videos](#images) in the timeline with ease.
- Revamped navigation control.
- Improved [slideshow](#slideshow) experience.
- Overall UX enhancements.

## Horizontal

Horizontal is the default mode of the component.

![horizontal](https://dev-to-uploads.s3.amazonaws.com/i/sc8vnc9x0vok79ado2wa.png)

## Vertical

![vertical-basic](https://dev-to-uploads.s3.amazonaws.com/i/xf5z1c41poj52iw7zb4j.png)

## Tree

![app-tree](https://dev-to-uploads.s3.amazonaws.com/i/egxcpco3mqc4e59vzv6u.png)
 
## Images

Both images and videos can be easily embedded in the timeline. The component is smart enough to automatically hide/disable the images and videos when they are not in the visible area of the containing element.

![media](https://dev-to-uploads.s3.amazonaws.com/i/dzaxaqd22qryfrnp0enp.gif)

## Slideshow

Slideshow now shows a decreasing progressbar indicating the timeleft on a timeline card. The Slideshow can be quickly paused by hovering over the active item. The slideshow automatically resumes when unhovered from the timeline card.

![Untitled Project7](https://dev-to-uploads.s3.amazonaws.com/i/0no1lvkmdiwxf12gqhwh.gif)
 

## 📦 CodeSandbox Examples

- [Horizontal Basic](https://codesandbox.io/s/condescending-swirles-xodxo?file=/src/App.js)
- [Tree](https://codesandbox.io/s/react-chrono-tree-text-xtksq)
- [Tree with Images](https://codesandbox.io/s/react-chrono-tree-image-uh2nz)
- [Vertical basic](https://codesandbox.io/s/react-chrono-tree-text-slide-zytpi?file=/src/App.js)
- [Vertical mode with Mixed content](https://codesandbox.io/s/react-chrono-tree-horizontal-wdqk3)

{% github prabhuignoto/react-chrono no-readme %}

**Thank you for taking the time to read this post and if you have any feedbacks or suggestions, please leave in your comments below.**
problem with vertical spacing with css grid..
Published: 2020-10-20 18:31:00

first two div place from the top manually(2nd div will be sticky div). others div will be push from the bottom .. I am getting extra vertical space.. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ugot8s0g0yx2r2amzwwm.png)


{% stackoverflow 64180962 %}
No shame in taking it slow
Tags: codingbootcamp, ruby, softwareengineer
Published: 2020-10-20 18:27:59

Am I doing something wrong by obsessing over being able to memorize these concepts and being able to speak correctly?

It has only been 6 weeks into bootcamp. My other classmates are further ahead of me, and seem to grasp the concepts faster. With the pressure to stay up to speed, I rarely took notes in the (now, I see it as bleeding) hope I could commit it all to memory.

What I understand now is its not about memorizing, per se, but being able to know how to reference better? Strengthen the Google skills?

I just passed our first module with many tears. Prior to the assessment date, I was able to take about a week to go over my code line by line, and then go back into the curriculum and take notes the old fashioned way I knew how. It took longer, but I understood everything better that time around. So when I passed my module, I asked to switch to a slower paced cohort. It's not just the imposter syndrome, but this weird panic attack I get when I start to imagine the whole picture - it feels similar to drowning. I've had to remind myself we will focus on one lesson at a time, let's take it one day at a time and not go nuts, and not make ourselves panic over nothing. Oddly, that is how I was able to get through crazy nights of table service. Every time a customer would come in the door, I had an internal/mental panic attack as I added up all the work that would have to be done within a certain amount of time. Some of my coworkers are better blessed to not know how to think in advance so they are the perfect working cow where they only focus on the task at hand, and when completed, can move on to the next. While brain is constantly fixated on all the tasks that need to be handled, I am already panicking over the next task that must be met yet I hadn't dealt with the task that was in front of me at that moment. In time, I overcame those mental panics because I told my brain the night would have to end eventually or slow down so there was no need to freak out.

Back to the tech stuff - I am going through the entire module from the top re-reading the ReadMes and listening to the lectures. I do feel more comfortable going about it this way. I am a little worried I'm focusing on the wrong things or studying the wrong way.. but in the end I would end up going back to basics because it would bother me too much that I skipped the reading.
How to parse complex Json response file in Java
Tags: java, beginners, webdev
Published: 2020-10-20 16:59:06






Parsing of JSON file may get bit complicated and confusing if you are not sure which library to use. There are different ways and Implementation available however I chose to use GSON library since it looked feasible for the JSON file which I was trying to parse. Sample JSON is provided below

In this example, I have saved my response in a file for demonstration.
Objective: Get the value of PatientID from this JSON

```
{
  "response": {
    "body": {
      "patients": {
        "patient": [
          {
            "patientID": "ALM22346789",
            "submittedStatus": "In Progress",
            "patientType": "Inpatient",
            "submissionDate": "2020-10-15"
          }
        ]
      }
    },
    "status": {
      "statusCode": "200",
      "statusMessage": {
        
      }
    }
  }
}
```

```
Imports used:
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;

```

**Step1:**
Read the file from the saved location and store it in JsonObject

```
JsonObject myobject = (JsonObject) new JsonParser().parse(new FileReader("MyFilePath"));

```

**Step2:** Hold the "response" in a JSON Object

```
JsonObject response = (JsonObject) myobject.get("response");

```

**Step3:** Drill down further and store the "body" and "patient" in JSON Object

```
JsonObject body = (JsonObject) response.get("body");
JsonObject patients= (JsonObject) body.get("patients");

```

**Step4:** "patient" tag is in a Array hence we will store it in Array Object

```
JsonArray patientbody= (JsonObject) patients.get("patient");
JsonObject patient0= patientbody.get(0).getAsJsonObject();

```
**Step5:** Next we will fetch the "patientID"

```
String patientID =caseBody0.get("patientID").getAsString(); System.out.println(patientID);

```
**OutPut: (as printed in console)**

```
ALM22346789
```

<!-- 

! -->
Why You Should Use Amazon S3? – Comic Guide
Tags: aws, cloud, s3, awscloud
Published: 2020-10-20 18:22:23

Amazon S3 Tutorial
AWS S3 is one of the most fundamental service of AWS Cloud. 

It’s basically your unlimited and safest cloud storage.

Read this comic style conversation between two guys and get to know why some of the biggest companies in the world are using Amazon S3 for their business and why you should use it too.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/lripgws7gwkt1fx9jyuw.png)![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/k3qlkqkfd5oi51xlcolh.png)![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/6ddt7r9wj08t4ixtndg8.png)![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ir7szems7s06fl4z2q1n.png)![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/gb7mtomv8wmfvxu6jlmr.png)![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/xuthjd9afs3gejov30qq.png)![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/3mxhe6hlfhi2k33phjpn.png)![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/wipbz9lnm3yef7sr43pz.png)

By reading this conversation I hope you guys understood why Amazon S3 is backbone of some of the biggest companies in the world.

I hope you guys liked it, I tried my best to put it as casual and as informative as I can.

If you want to read such kind of comic tutorials on some specific cloud service then let me know in the comments.

You can read such comic and informative tutorial on Amazon EC2 here – Amazon EC2 Explained in Comic Way

Let me know in the comments if you guys found this post helpful or if there are any suggestion or questions.

You can read my other blog post here - http://cloudforgeeks.com/