teleren/devto huggingface dataset:
Trivia Twitter Bot
Tags: actionshackathon, github, opensource
Published: 2020-09-11 21:40:43

---
title: Trivia Twitter Bot
published: true
description: My submission to the GitHub Actions x DEV Hackathon!
tags: actionshackathon, github, opensource
---


### My Workflow
My GitHub Action starts my Node project, which installs the packages, and tweets out a trivia question. Five hours later, it tweets out the answer. The uses included in this action are 

actions/checkout@v2
actions/setup-node@v1
allenevans/set-env@v1.0.0 (Sets environment variables)

Although this is geared for my trivia bot project, the yaml file can be used for any other Node + Twitter API project as it plugs in the API key and other tokens.

### Submission Category: 

Wacky Wildcards, Phone Friendly


### Yaml File or Link to Code

[https://github.com/virenb/fbot/blob/master/.github/workflows/tweetbot.yml](https://github.com/virenb/fbot/blob/master/.github/workflows/tweetbot.yml "Yaml tweetbot file")


### Additional Resources / Info

My Project: [https://github.com/virenb/fbot](https://github.com/virenb/fbot "Fbot project")
Day 57: Updating data from spott api to a webpage
Tags: 100daysofcode, javascript, webdev, api
Published: 2020-09-11 21:36:59


My aim today was to dynamically update the city name on the web app with the city from the search results. The city name  was not been updated [yesterday](https://dev.to/mtee/day-56-getting-data-from-spott-api-23oj) after a get request because i was using `country` to fetch class country in my query selector instead of `.country`. I kept running into a "country is null error."
Code before:
```javascript
const country = document.querySelector('country');
country.textContent = data.name
```
Code after:
```javascript
  const country = document.querySelector('.country');
  country.textContent = data.country.name
```
😅 I'm literally so angry at that `.` for taking all my time 😂 
_Day 57_
Are you struggling to land your first job as a developer? I want to help
Published: 2020-09-11 21:18:47

Quick introduction before I get into the reason for writing this post.

My name is Ken. Back in 2014, I got my first job as a junior dev without any formal education or existing professional experience.

It was a difficult process and I know many people out there are in the same position I was in, struggling to get that first job.

I have an excellent job now as a full-time dev and am shifting a lot of my attention from job hunting to helping aspiring developers launch their careers, regardless of where they are at now.

If that's you, I want to help in whatever way I can.

I'm currently working on a Breaking Into Web Development series here on Dev.to, as well as a [full-blown course](https://www.kenrogers.co/breakingin) on the same subject.

But I want to hear from people individually and see what advice I can offer.

Full disclosure, I have two goals here:

1. Offer helpful advice from the perspective of someone who has gone down that route
2. Gather information so I can create the best course possible.

This brief post is my attempt to do both of those things.

So, if you're an aspiring developer looking to break into the industry and land that coveted first job, would you respond to this post and answer these two questions?

1. What is your biggest struggle when it comes to breaking into the industry?

2. What is your ideal initial career situation and what has prevented you from attaining that up until this point? What I mean by initial is what is your ideal next step for your career, rather than where you ultimately want to end up.

Thank you so much for your time and I hope I can offer some helpful advice to anybody struggling to make that transition to full-time developer!
Day 215: A Long Walk
Tags: hiphop, code, coding, lifelongdev
Published: 2020-09-11 21:17:05

_liner notes_:
- Professional : Finally! Submitted my blog post for content review. I did so many edits and format changes. So much was covered! haha. Had a team meeting. Pretty much it.

- Personal : Last night, went through more tracks for the radio show this week. Also worked a little on my side project. Went to sleep pretty early because I wanted to get up and finish up the blog post.

![A star filled night sky over the desert plain of Vulcano El Teide, Spain with mountains in the distance](https://dev-to-uploads.s3.amazonaws.com/i/qw0qzp21a0b0dcdox0sx.png)

Went to the park again today. Charged up my battery pretty good considering it was cloudy for a good part of the day. When it wasn't raining, got the chance to take a long walk around the park. Going to finish up the prep work for the radio show tomorrow. Want to get try and get the lawn at the old house mowed before the radio show. Then Sunday go to my folks place to get my packages and mount the rails to the top of my van and get the measurements so I can order the other pieces I need to mount my solar panels.

Have a great night and weekend!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube TSYMKUtNuw8 %}
This Week in Rust is really cool
Tags: rust
Published: 2020-09-11 21:01:59

I just wanted to write a quick post about [This Week in Rust](https://this-week-in-rust.org/), just in case anyone actually reads these. It's a really cool newsletter that combines a bunch of info and sends it to your inbox. I promise I'm not sponsored or anything.

It combines links to:
 - [Offical rust blog posts](https://blog.rust-lang.org/)
 - Tooling updates
 - [This Month in Rust Gamedev](https://rust-gamedev.github.io/)
 - [This Month in Rust OSDev](https://rust-osdev.com/)
 - New rust tutorials
 - New rust briefs
 - Project updates

..and basically anything else. I highly recommend it.
Angular Data Doesn't Show
Tags: angular
Published: 2020-09-11 20:58:05

Stack Overflow [Angular] folks often ask:

- "Why doesn't my View show the data?"
- "I can see it in the request, and the data is returned but my component doesn't show it".
- "Why doesn't my data show up?"

**Angular Render Events**

Angular Rendering runs as soon as the component is displayed.  This means any data that requires a Promise or Subscription misses the render event! Angular renders before the data has returned. 

**Solutions**

-Use *ngIf to hide display until data arrives.  
-Use ChangeDetector's detectChanges method after the data arrives. Like this:
```html
<app-myComponent 
    // if *ngIf is missing,
    // the view renders without 
    // waiting for person data
    *ngIf='show' 
    [persons]='persons'>
</app-myComponent>
```

**Solution**
Don't show View until data is ready!

```typescript
import {
 Component,
 OnInit,
 ChangeDetectorRef} 
from "@angular/core";
export class myComponent implements OnInit,
//default state is not to show at start.
show = false; 
constructor(private cdf: ChangeDetectorRef);
ngOnInit(){
 this.getData();
}
// a promise example 
getData() {
      this.getPersons().then((persons) => {
         //sets the data sometime later
         this.persons = persons;
         // data is ready, show view!
         this.show = true;
         // tell Angular to re-render  
         this.cdf.detectChanges(); 
      });
   }

// a subscription example
getDataSubscription(){
  this.getPersons.subscribe(result=>{
    this.person = result;
    // data is ready show view.
    this.show = true;
    this.cdf.detectChanges();
})
```

There are other ways but this is a good start.
Echo Go - Parsing HTTP Request Payload
Tags: go, echo, backend, webdev
Published: 2020-09-11 20:36:14

So in this chapter we will to learn how to parsing variation request payload in echo go, so let`s do it.

In payload HTTP Request can to send various forms. We will to learn how to handle 3 this payload.
- Form Data
- JSON Payload
- XML Payload

# Parsing Request Payload
Way parsing request payload in echo is very simple, whatever the type of payload, API used for parsing is same.

So create main.go and follow this code.

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

# TESTING
i use POSTMAN for the testing, u can use CURL or anything.

- Form Data

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/578j0xr5piflh1e1esuo.JPG)

- JSON Payload 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/578j0xr5piflh1e1esuo.JPG)

- XML Payload

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

Finally! Try at home.
The GitHub Actions Hackathon Ends Next Week (September 17)!
Tags: actionshackathon, opensource, github, actions
Published: 2020-09-11 20:25:18

---
title: The GitHub Actions Hackathon Ends Next Week (September 17)! 
published: true
description: Submissions are due Thursday, September 17th at 11:59pm PST!
tags: actionshackathon, opensource, github, actions
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/xnzigbzxrvzif1v7ge86.png 
---

We just wanted to share a friendly reminder that **GitHub Actions Hackathon submissions are due Thursday, September 17th at 11:59pm PST!** 

It's been so awesome to see what the community has built for this hackathon so far. Don't miss your chance to better the GitHub Actions ecosystem while competing for some truly awesome prizes.

_Full submission info and prize details here:_

{% link https://dev.to/devteam/announcing-the-github-actions-hackathon-on-dev-3ljn %}

Don't forget that you can share updates on your progress in the [community thread](https://dev.to/devteam/share-your-github-actions-hackathon-updates-251m) and/or ask for help on your submission in the [help thread](https://dev.to/devteam/github-actions-hackathon-help-thread-1li4). 

![good-luck-art](https://media.giphy.com/media/xUA7aSXE8lpQ7REDfi/giphy.gif)
8 must-know DATA STRUCTURES for programmers
Tags: codenewbie, codequality
Published: 2020-09-11 20:20:44

## What is Data Structure?

A **data structure** is an organized way to store data on our computer so that it can be used more effectively. We will discuss them briefly.

## Array

An **array** is a data structure consisting of a collection of elements each identified by at least one array index.

![Array image](https://ishanbagchi.github.io/Ishan-Tech-Blog/day4/images/array.png)

## Linked List

A **linked list** is a sequential structure that consists of a sequence of items in linear order which are linked to each other.

![linked list image](https://ishanbagchi.github.io/Ishan-Tech-Blog/day4/images/linked-list.png)

## Stack

**Stack** is a linear data structure that follows a particular order in which the operations are performed. The order may be LIFO(Last In First Out).

![stack image](https://ishanbagchi.github.io/Ishan-Tech-Blog/day4/images/stack.png)

## Queue

A **Queue** is a linear structure that follows a particular order in which the operations are performed. The order is First In First Out(FIFO).

![queue image](https://ishanbagchi.github.io/Ishan-Tech-Blog/day4/images/queue.png)

## Hash Table

**Hash table** is a data structure that implements an associative array abstract data type, a structure that can map keys to values. A hash table uses a hash function to compute an index, also called hash code, into an array of buckets or slots, from which the desired value can be found. 

![hash table image](https://ishanbagchi.github.io/Ishan-Tech-Blog/day4/images/hash-table.png)

## Tree

A **Tree** is a widely used abstract data type that simulates a hierarchical tree structure, with a root value and subtrees of children with a parent node, represented as a set of linked nodes.

![tree image](https://ishanbagchi.github.io/Ishan-Tech-Blog/day4/images/tree.png)

## Heap

A **Heap** is a special case of a binary tree where the parent nodes are compared to there children with their values and are arranged accordingly. 

![heap image](https://ishanbagchi.github.io/Ishan-Tech-Blog/day4/images/heap.png)

## Graph

A **Graph** is a nonlinear data structure consisting of nodes and edges. The nodes are sometimes also referred to as vertices and the edges are lines or arcs that connect any two nodes in the graph.

![graph image](https://ishanbagchi.github.io/Ishan-Tech-Blog/day4/images/graph.png)

## Acknowledgements

+ Wikipedia (hash table image)
+ Geek For Geeks (all other images)
Video: How to build an app to send a custom reply to a Twilio text message
Tags: nocode, tutorial, video
Published: 2020-09-14 20:19:30

---
title: Video: How to build an app to send a custom reply to a Twilio text message
published: true
date: 2020-09-11 20:12:59 UTC
tags: NoCode,Tutorial,Video
canonical_url: https://maxkatz.org/2020/09/11/video-how-to-build-an-app-to-send-a-custom-reply-to-a-twilio-text-message/
---

This video shows how to build a no-code app to send a custom reply to a Twilio text message. The code tutorial mentioned is here: [https://www.serverless.com/blog/serverless-and-twilio](https://www.serverless.com/blog/serverless-and-twilio).

{% youtube CJWKWXUZF1Q %}

**Technical note:** Twilio expects a specific response from a Webhook. This response includes a message to send back. This no-code examples works differently. While Parabola does send a response from a Webhook, the response is just a default success message (this causes an error on Twilio side which you can see in the debug console). The no-code example sends a new message as a reply to the received message.
Who's looking for open source contributors? (week 37)
Tags: discuss, opensource, contributorswanted
Published: 2020-09-11 20:00:55

Restarting something Ben was doing for a while.

Open Source is about the community. Whether you have a project or just looking to make your first PR.  

## Tell us about your project
_Promote your project by providing a link to the repo. Everyone who posted in previous weeks is welcome back this week, as always. 😄_

The README is the front door of your project.
If you submit please make sure you have the following in your repo to make it helpful for others looking to contribute:

1. README.md
2. CONTRIBUTING.md

Finally, consider reading the [Best Practices for Maintainers](https://opensource.guide/best-practices/).

Happy coding!
Solving Rustc 'cannot find -lxcb-shape'
Tags: rust, linux
Published: 2020-09-11 19:40:26

I wanted to learn Amethyst, a pretty cool game engine made in Rust. But when I tried to compile the "Hello World" project, I got the error `cannot find -lxcb-shape`. This led to a few wasted hours and a lot of headaches, so I thought I'd share the fix here.

I first tried to just run `apt get install libxcb-shape`. It didn't exist. I thought this meant that the package wasn't in the Debian package list, but I was wrong.

Then I tried just googling my exact issue, but I gave up quick. I should have kept going, because my answer was there, but whatever.

I then moved to figuring out what `lxcb` was, and apparently it's some sort of X window system.. thing. I'm still not really sure what it does. 

I found [their GitLab page](https://gitlab.freedesktop.org/xorg/lib/libxcb), and decided to try and compile and install it myself. There were a couple of dependencies I had to compile and install first, but eventually I got it installed. 

It didn't work. All of those hours were a waste.

I went back to googling my exact issue, as I mentioned earlier, and found something. There was a [stackoverflow thread](https://stackoverflow.com/questions/55758892/missing-libraries-on-linux-with-rust-and-amethyst) that mentioned the exact same problem.

I should have read the *entire* stackoverflow thread, but I just went comment by comment until I found [this, a package listing for Ubuntu](https://packages.ubuntu.com/bionic/amd64/libxcb-shape0-dev/filelist). It had the incredibly memorable and useful name of libxcb-shape0-dev. Why there is a 0 there, I have no idea. There is probably a good reason, but I don't know it, so it annoyed me.

I installed that specific library, and it worked! My amethyst example was compiling! But there's something else.

I was gonna end it here, but then, writing this article, I went and checked that stackoverflow thread again, and one person had linked the README for the amethyst project. There was a list of dependencies that I hadn't installed. This whole thing was just me being an idiot and not reading. I have never channeled [Druaga1](https://www.youtube.com/channel/UC-7I1gU1r6PxBSl87o-7YEQ) more than in this moment. 

So, moral of the story, check the dependencies of things you install before going down a rabbit hole of self-compiling random libraries you now have no way of easily removing, so they'll just stay there.

Thank you for reading about this mess.
Bundle github repos for offline sharing
Tags: github, node, git, javascript
Published: 2020-09-11 19:31:17

---
title: Bundle github repos for offline sharing
published: true
description: Node.js script for bundling repos from github to local machine for archival and offline sharing
tags: #github #nodejs #git #javascript
//cover_image: https://direct_url_to_image.jpg
---
Looking for a script that will archive the huge repo you've been wanting to archive well here it is...

*bundle-repo.js*
```
const chalk = require("chalk");
const { execSync, exec } = require("child_process");
// const fs = require('fs');

if (!process.argv[2] || !process.argv[3]) {
  console.log(
    chalk.red(
      "Usage: node bundle-repo OWNER REPO-STRING [BUNDLE-TARGET-DIR]\nExample: node bundle-repo 'twitter' 'main, side, boom'"
    )
  );
  return;
}

const prefix = "git@github.com:";

const finalDir = process.argv[4] ? process.argv[4] + "/" : "";

const getPath = (r) => (!finalDir ? "" : finalDir + r);

process.argv[3].split(",").forEach((r) => {
  execSync(
    `git clone ${prefix}${process.argv[2]}/${r.trim()} ${getPath(r.trim())}`
  );
  const a = execSync(`ls -la ${getPath(r.trim())}`);
  console.log(a.toString());
  if (a.toString().split('\n')[0].split(' ')[1] != 0) {
    execSync(
      `cd ${getPath(
        r.trim()
      )} && git bundle create ${r.trim()}.bundle --all && mv ${r.trim()}.bundle .. && cd .. && rm -rf ${r.trim()}`
    );
  }
});
```

*package.json*
```
{
  "type": "module",
  "dependencies": {
    "chalk": "^3.0.0"
  }
}
```

Before you get busy with it please follow this setup to avoid any operational glitches

1. Setup SSH access for your github account which has access to the repos. [Connect to github via SSH](https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&cad=rja&uact=8&ved=2ahUKEwiUprOG6uHrAhVafisKHfpgD0AQFjAAegQIARAC&url=https%3A%2F%2Fdocs.github.com%2Fen%2Fgithub%2Fauthenticating-to-github%2Fconnecting-to-github-with-ssh&usg=AOvVaw21Oa_77sk2lc4cCunHT7Os)

2. Create a string of comma seprated repo names like "repo1, repo2", the script has a usage example built in

3. Pass the repo string and owner/organization string as input to the string like

```
node bundle-repo 'twitter' 'main, side, boom' [optional target directory]
```
That's it you are good to go. Checkout the [code on github ](https://github.com/KartikJha/code-quiver/blob/master/javascript/utilities/bundle-repos.js)

Thank you for reading :)
How to remove duplicate objects from a JavaScript array
Tags: javascript, tutorial, webdev
Published: 2020-09-11 19:31:16

---
title: How to remove duplicate objects from a JavaScript array
published: true
description: In this quick tip, I'll provide you with a simple function that will return an array of JavaScript objects with duplicates removed.
canonical_url: https://www.adamdehaven.com/blog/how-to-remove-duplicate-objects-from-a-javascript-array/
tags: JavaScript, tutorial, webdev
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/oh0dqnyqbgak4o0zbnxx.png
---

In JavaScript, there seems to be an easy way to pretty much anything (disagree with me in the comments :man_shrugging:). One of the things that *isn't* so easy is removing duplicate objects from a JavaScript array of objects. In this quick tip, I'll provide you with a simple function that will return an array of JavaScript objects with duplicates removed.

## JavaScript function

First, let's take a look at the function which accepts two arguments:

- `arr` - The original array of JavaScript objects (which may contain duplicates)
- `keyProps` - An array of object property names that should be checked, in combination, to not allow duplicates.

``` js
/**
 * Returns an array of objects with no duplicates
 * @param {Array} arr Array of Objects
 * @param {Array} keyProps Array of keys to determine uniqueness
 */
function getUniqueArray(arr, keyProps) {
    return Object.values(arr.reduce((uniqueMap, entry) => {
        const key = keyProps.map(k => entry[k]).join('|')
        if (!(key in uniqueMap)) uniqueMap[key] = entry
        return uniqueMap
    }, {}))
}
```

## Usage example

In our example below, we have an array of JavaScript objects that we will use in "Project A" to create meta tags for a webpage. We don't want duplicate meta tags on the page, so we will run the original array through our function to remove duplicates.

We only want to remove an object if **all** properties are the same within the object, so we will pass all available object properties to the function as an array.

``` js
const startingArray = [
    { property: 'name', content: 'adam' }, // duplicate
    { itemprop: 'name', content: 'adam' },
    { property: 'twitter', content: '@adamdehaven' },
    { property: 'name', content: 'adam' }, // duplicate
    { property: 'tag', content: 'person' },
    { property: 'tag', content: 'developer' },
    { property: 'name', content: 'adam' }, // duplicate
]

const newArray = getUniqueArray(startingArray, ['property', 'content', 'itemprop'])
```

## Output

When we log the output of the function, we can see that objects with the exact same properties and values have been removed from our array:

``` js
console.log(newArray)

// (5) [{…}, {…}, {…}, {…}, {…}]
// 0: {property: "name", content: "adam"}
// 1: {itemprop: "name", content: "adam"}
// 2: {property: "twitter", content: "@adamdehaven"}
// 3: {property: "tag", content: "person"}
// 4: {property: "tag", content: "developer"}
// length: 5
// __proto__: Array(0)
```