teleren/devto huggingface dataset:
Getting Started with winfetch, A neofetch Alternative for Windows
Tags: go, github, productivity, showdev
Published: 2020-05-22 22:37:50

Today I released a new tool called winfetch. I decided to make this as an excuse to learn the language Go and also because screenfetch/neofetch solutions on Windows in the past were extremely unreliable. I knew I would be limited as far as what I could display since we don't get as many cool libraries Unix systems get. I found a great module called `ghw` which allows you to query and obtain system/hardware information. 

I thought it would be a great way to share it by writing a blog post about it. Winfetch is extremely simple to use thanks to how awesome Go is as a language and distribution platform. I was easily able to make my module distributed through GitHub so all you have to do to install it is run:

```
go get github.com/M4cs/winfetch
```

Once you do this you can add `winfetch` as a command to your `$PROFILE`.

You are able to customize what information you want displayed with the tool along with which colors and ASCII art is displayed. Below you can see two examples of configuration setups using winfetch:

 ![im](https://raw.githubusercontent.com/M4cs/winfetch/master/gitimages/preview1.png)

![im2](https://raw.githubusercontent.com/M4cs/winfetch/master/gitimages/preview.png)

As you can see you can easily add custom ASCII art. There is more information on the GitHub page which is available below:

GitHub Source and Readme - https://github.com/M4cs/winfetch
A XKCD Discord bot with a little personality
Tags: octograd2020, python, discord, xkcd
Published: 2020-05-22 22:36:18

## This is Bobby Tables.

The idea started, as many do, on Reddit. I found a thread in the XKCD subreddit where a user had created a bot that would fetch a comic based on a number that was provided by a commenter. He named it the "BobbyTablesBot" after the famous quip of one such comic. This was in comparison to the many other bots out there that either expanded information about an already existing comic, or only allowed fetching a random comic.

I'm one of the moderators of a Discord community for computer science students at my school. We have just over 1000 members with several hundred of them active at any given time. Needless to say, as active coders we're referencing XKCD comics all the time. The opportunity to create something for this community became immediately clear.

So I got to work, and wrote my own BobbyTablesBot. It takes a number and immediately returns a link to the relevant comic (Discord's *wonderful* embed functionality does the rest). But my community wanted more - so I expanded the functionality to allow for a text search, as well as that random comic. I even added the ability to find the ExplainXKCD for those off days we all have.

Here he is in action:
![example](https://dev-to-uploads.s3.amazonaws.com/i/346y9jz6u5at9a1rttjj.png)

## Open source, because I love you

**The bot is registered with Discord, but not currently public. If you're interested in running it on your own server, contact me!**
{% github itscamlong/BobbyTablesBot %}

## How I built it

The bot itself is pretty simple under the hood. I used Python as the main language (it's my daily/favorite) and thus used the discord.py API to implement all bot functionality. This was my first experience with async programming and it taught me a lot.

To achieve text search, I found an API that already had done this. I poked around until I found a endpoint and used it to retrieve a number based on text input.

The most complex part of the code, ironically enough, is retrieving the latest comic. That always lives at the base URL (xckd.com/) and the number is only mentioned at the bottom of the page... as text. Not very helpful. I ended up using BeautifulSoup to scrape the homepage and retrieve that number for me. Maybe not the cleanest solution, but it works!

## Conclusions

There are a few things about this bot I might change in the future. A few bugs have presented themselves in use (I'm lucky to have such... enthusiastic... testers). The search API also returns some weird results - at some point in the future I might write my own. Overall, I'm super happy with how this turned out. The end product might not be all that much, but my community loves it, and so do I.
How to make sure the was no downtime(1 min) when MongoDB service switching primary shard to secondary shard.
Tags: mongodb, devops
Published: 2020-05-22 22:27:29

Hi there,


I am part of the DevOps team our application was serverless architecture. our database is hosted with MongoDB.when MongoDB schedule maintenance on the primary shard. the primary shard will go down for 1 min till the secondary shard comes online. How can we avoid this 1 min downtime?
College Project Reflections
Tags: unity3d, games, gamedev
Published: 2020-05-22 22:15:30

Hey everyone!

In this post, I'll be talking about my experiences with one of the projects that I made over the course of my 4-year education at Marist College. For reference, I will be graduating on May 23rd 2020, with a B.S. In both Computer Science and Game Design, with minors in both IT and IS.

The project in question is my semester-long capstone project for my CS degree, a game called "Chaos and Catacombs." I was the lead programmer on the team, with 6 other members being apart of development. We knew going into the project we wanted to make a Castlevania inspired game with a bit of a twist, that twist being that parts of it were randomized. This includes enemy placement and items that would spawn in the level.

One of the scariest parts of our development cycle was when we were asked midway through the project to add a multiplayer feature. Anyone who knows about game development knows that multiplayer is one of those things you want to plan for the beginning, not add in retroactively. This meant a lot of the functionality of the game had to be altered and scaled back in order to fit within our tight schedule.

The course of development took 4 months, and the game was released in December of 2019 for free on Itch.io. The development process was quite arduous and intensive on me, but it was very interesting to see the game development cycle. Overall I was extremely happy with the finished product and it was an experience I will not soon forget.
Uses of array_chunk function
Tags: php
Published: 2020-05-22 22:04:39

array_chunk() is a build function in PHP.

Using this function, one or more new arrays are created with values of arrays. This function usually has 3 parameters. 
But it is mandatory to use 2.

- **array** – [array from which to extract values]
- **size** – [key number of new arrays]
- **preserve_keys** - [This value is FALSE by default, if TRUE, it will insert new arrays inside a new array]

## Example – 1 :

```php
<?php
    $array = array('a', 'b', 'c', 'd', 'e');
    print_r(array_chunk($array, 6));
?>
```

## Result :

```php
Array (     
 [0] => Array (             
   [0] => a             
   [1] => b             
   [2] => c             
   [3] => d             
   [4] => e         
  ) 
)
```

## Example – 2 :

```php
<?php
    $array = array('a', 'b', 'c', 'd', 'e');
    print_r(array_chunk($array, 2, true));
?>
```

## Result :

```php
Array (     
 [0] => Array (
   [0] => a             
   [1] => b         
 )
 [1] => Array (
   [2] => c
   [3] => d
 )
 [2] => Array (
   [4] => e
  )
)
```

Thanks 😊

Read Bangla :- https://nirab.xyz/post/uses-of-array_chunk-function/
Another React Virtual Dynamic List
Tags: react, javascript, frontend, webdev
Published: 2020-05-22 22:01:39


Yes, yet another React Virtual List... Why?

Just because, all of the other dynamic lists just didn't perform the way I needed, I bit the bullet and wrote a new one that uses a fancy algorithm for dynamic height items that doesn't need to measure intermediate items and provides some handy helper functions and events.

This component:

* Provides dynamic item heights
* Only measures what it draws, estimates the rest and keeps everything smooth by adjusting scroll position when sizes are discovered later
* Does not need to measure intermediate items when large scrolling, massively improving performance
* Does not need an accurate estimated item height
* Allows items to change size at any time
* Allows natural browser layout of the components on screen within their standard container, no individual item positioning
* Works in environments that don't constantly fire scroll events (e.g. iOS)

![Example](https://dev-to-uploads.s3.amazonaws.com/i/s7vwptnyzx2koeicl91x.jpg)
*Example of the dynamic list embedded in a Material UI modal, shown with optional scroll indicating holder component, supplied but not required.*

This component uses a O(Ln2) algorithm to work out the position of items and caches all of this for maximum performance even when scrolling huge distances.

Provides events that enable any number of items.

MIT Licensed

Available here on [GitHub](https://github.com/miketalbot/react-virtual-dynamic-list) and npm
Install latest version of Ruby and Rails using Snap
Tags: ruby, rails, snap
Published: 2020-05-22 21:30:22

I just started working with a new stack today and it involves a lot of techs that I have never worked with (Ruby, Rails).

I was having a hard time to create a new project with Rails 6.x mostly because the `Ruby` installed in my Ubuntu via `apt-get` was pointing to version `2.4.5`.

I needed something newer ... And `snapd` was there to rescue me.

By running:
```bash
gustavo@bulls:~$ snap install ruby
```

and

```bash
gustavo@bulls:~$ ruby -v
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux]
```

I finally got the newest version of Ruby and could finally do:
```bash
gustavo@bulls:~$ gem install rails
...
gustavo@bulls:~$ rails -v
Rails 6.0.3.1
```

Thank you `snap`. Well, here are some advantages of using `ruby` with `snap`:
* Keep `ruby` and `rail` in a separate sandbox preserving your OS packages.
* You can always get the latest version even if your OS do not provide them (don't be angry `Arch Users`)
* Easy to install/remove without breaking anything :)

Well, here is the [blog post](https://www.ruby-lang.org/en/news/2018/11/08/snap/) from Ruby blog!

Any other tips for today guys?
State management with MobX and React
Published: 2020-05-22 21:30:09

One of the good things I find on Linkedin is the sharing of ideas, projects, and learning by many devs. I miss transmitting my knowledge more simply and directly. So, I took the time to pass on some of my knowledge. There will be more short articles with examples.

I'll start by sharing a little bit about MobX.

## What is MobX?
[MobX](https://mobx.js.org) is a library for state management just like Redux, which means that we can use it to either manage local or global states using Provider for example.

Roughly speaking, MobX is based on observables, actions, and reactions. That is, every action performed generates a reaction, which seeks an observable and then updates it.

Remember that it is not only exclusive for use with React, but there are also versions for other types of technology, for example Flutter.

At the end of this article I leave a link to a small example, created in CodeSandbox, of an implementation using MobX with React.

## A brief explanation for the stores.

- Actions: When we want to update a state;
- Observables: Any element here is notified when it has some kind of reaction to a state.
- Computed: When we want to return a calculation, type excel formulas.

## The example

{% codesandbox mobx-with-react-k1htp %}

## Resources
[MobX](https://mobx.js.org)
[Mobx With React](https://mobx-react.js.org)

I hope it helps those who want to find a simpler alternative to be implemented than Redux.

Cheers ;-)
What’s your alternative solution? Challenge #48
Tags: challenge, javascript, codenewbie, learntocode
Published: 2020-05-22 21:09:58

# About this series

This is series of daily JavaScript coding challenges... for both beginners and advanced users.

Each day I’m gone present you a very simple coding challenge, together with the solution. The solution is intentionally written in a didactic way using classic JavaScript syntax in order to be accessible to coders of all levels.

Solutions are designed with increase level of complexity.

## Today’s coding challenge

```
Create a function that will receive a bi-dimensional array as argument and a number and will extract as a unidimensional array the column specified by the number

```

(scroll down for solution)

## Code newbies

If you are a code newbie, try to work on the solution on your own. After you finish it, or if you need help, please consult the provided solution.

## Advanced developers

Please provide alternative solutions in the comments below. 

You can solve it using functional concepts or solve it using a different algorithm... or just solve it using the latest ES innovations.

By providing a new solution you can show code newbies different ways to solve the same problem.

## Solution

```javascript
// Solution for challenge43

var ar = [ ["John", 120],
            ["Jane", 115],
            ["Thomas", 123],
            ["Mel", 112],
            ["Charley", 122]
         ];

var numbers = extractCol(ar, 1);
println(numbers);

function extractCol(ar, colNo)
{
    var arCol = [];
    
    for(var i = 0; i < ar.length; i++)
    {
        arCol.push(ar[i][colNo]);
    }
    
    return arCol;
}

```


To quickly verify this solution, copy the code above in this coding [editor](https://codeguppy.com/code.html) and press "Run".

> Note: The solution was originally designed for [codeguppy.com](https://codeguppy.com) environment, and therefore is making use of `println`. This is the almost equivalent of `console.log` in other environments. Please feel free to use your preferred coding playground / environment when implementing your solution.
The Best Game I've Ever Made
Tags: octograd2020
Published: 2020-05-22 20:38:06

## Background Story
When I took the Introduction to Game Development course in Fall 2019, I had no idea I would be making a game with this complexity. Thanks to the course format, my team and I were free to choose whatever we wanted to make so we came up with an ambitious idea.

## What is this game?
It is called Catastrophe, and it's an online multiplayer third-person shooter that revolves around "capture the flag" game mode idea.

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

There are three teams in the game. The first team that takes the flag and brings it to their base is the winner.

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

## Check it out!
Here are the links to the game's website:
https://luna-interactive.herokuapp.com/

and the GitHub repo:
{% github https://github.com/Luna-Interactive/catastrophe %}

## How hard was to it build?

We built the game using the Unity game engine. For the multiplayer part, we were searching for a framework that was relatively easy to use (because of our time constraints) and was performant enough for a shooter, so we picked [Photon Bolt](https://www.photonengine.com/bolt).

My main contribution was to integrate our logic with Bolt and synchronize the data between the players. As it turns out, developing a multiplayer game is not as easy as writing `multiplayer_framework.MakeGameMultiplayer()`! I spent lots of hours fixing synchronization issues that constantly came up.

Thanks to my well-organized team, we had so many playtests that by the time we presented the game to our class, it had no issues in the 10 minutes we demoed it live.

## What did I learn during this project?
Coding-related stuff aside, I learned that making a multiplayer game is hard! After going through all sorts of troubles to just make our game playable, I'm starting to appreciate all the hard work that has gone into developing multiplayer shooters like Fortnite and Apex Legends. I hope I can be part of one someday!
AGROFIRST
Tags: octograd2020
Published: 2020-05-22 20:29:03

## My First Project


## Demo Link
https://agrofirst.herokuapp.com
 

## Link to Code
https://github.com/vheckthor/AgroFirstDeployment 



## How I built it 
The project was built with Html5, CSS, BootStrap, and JavaScript for the front end, python-FLask for the backend, and  SQLite for the database. During the course of the project, I discovered the use of Jinja for the communication of the data from the backend into the HTML view is not very efficient in that commented codes are still been read by the Jinja templating engine.


## Additional Thoughts / Feelings / Stories
The idea behind the project is to help farmers to easily sell their goods to end consumers, taking away the need for middlemen who purchase the farm produce at ridiculous prices from the farmers and sell at exorbitant prices to the consumers. Also, the platform exposes farmers to intending investors who would like to partner with farmers to enlarge their farms and increase the production rate.
The Project is not being used yet but work is still ongoing to get it into production.


[Final Note]: I Enjoying coding but I derive more pleasures when the codes solve people's problems.
Enabling emmet tab completion for React in Atom
Tags: react, javascript, atom
Published: 2020-05-22 20:19:45

Thank you to [@mxstbr](https://dev.to/mxstbr) for [this solution](https://gist.github.com/mxstbr/361ddb22057f0a01762240be209321f0).

I just want to elucidate and extend upon this gist, and just lay out some steps for anyone who might need this right now.

## Install _emmet_ and _language-babel_

First up, ensure that emmet and language-babel are installed in Atom.

## Set your file's language

With your React component's .js file open in Atom, hit _CTRL + SHIFT + L_ and set the language of the file to _'Babel ES6 JavaScript'_.

## Add a new key binding

In Atom, go to _Settings > Key Bindings_ and click on **your keymap file**

Add the following lines to **keymap.cson** and save.

```
'atom-text-editor[data-grammar~="jsx"]:not([mini])':
  'tab': 'emmet:expand-abbreviation-with-tab'
```

Head over to your .js file and add 'className' to your component JSX, the emmet way

```
div.yourclassname
```
Hit the TAB key

##Enjoy!

_Thanks again to [@mxstbr](https://dev.to/mxstbr) for posting the solution as a gist_
PyTorch Zoo
Tags: octograd2020
Published: 2020-05-22 20:19:14

## My Final Project

My project was PyTorch Zoo, a PyTorch library that I made that contains a collection of useful libraries and tools to help reduce the amount of time people spend searching for high-quality implementations of commonly used machine learning modules and utilities. 

## Link to Code

{% github https://github.com/bkkaggle/pytorch_zoo %}

## How I built it (what's the stack? did I run into issues or discover something new along the way?)

I built this project using Python and Pytorch, a commonly used library used for training neural networks. I open-sourced the project on GitHub and you can download it from PyPi by running the command `pip install pytorch_zoo`
Open Source Tailwind UI Alternative
Tags: css, tailwindcss, webdev, showdev
Published: 2020-05-22 20:15:54

---
title: Open Source Tailwind UI Alternative
published: true
description: Get your projects rolling with these ready-to-use blocks for Tailwind CSS.
tags: #css, #tailwind, #webdev, #showdev
---

Hello everyone!

I've created 60+ ready-to-use UI blocks ([tailblocks](https://mertjf.github.io/tailblocks/)) with Tailwind CSS and I want to share with you. These blocks are fully responsive, included dark mode and color options. All you have to do is select the blocks that will suit your project.

[⟶  Project Link](https://mertjf.github.io/tailblocks/)

Preview:
{% youtube _B0-8WXhAv0 %}
I'm an Egghead Instructor 🥚
Tags: css, webdev, tutorial
Published: 2020-05-22 20:14:53

---
title: I'm an Egghead Instructor 🥚
published: true
description: I've joined the Egghead community as an instructor!
tags: #css #webdev #tutorial 
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/0rqnxizgp1lkqcpy53wj.png
---

I was invited to join the Egghead community as an instructor last November. 

Unfortunately, I wasn't able to create any lessons until recently.

But now I have a nice collection going of **free** lessons.

Check out [this collection](https://egghead.io/playlists/learn-css-animations-for-a-better-user-experience-fbef) to learn more about CSS animations. I'll be adding more videos in the near future.
MongoDB database driver for Deno
Tags: deno, mongodb, javascript, database
Published: 2020-05-22 20:04:24

As you already know that Deno is a new run time of JavaScript and TypeScript. Recently it has published first stable release.

MongoDB is the most popular NoSQL database. Deno also has a third-party module [deno_mongo](https://deno.land/x/mongo) to handle MongoDB queries.
    
deno_mongo is a MongoDB database driver for Deno, based on rust's official MongoDB library package. Right now it's on `--unstable` flug. 

I'm assuming that you have installed MongoDB and Deno on your machine. So, let's see how it works...
Necessary permissions to run this module: `--allow-net --allow-write --allow-read --allow-plugin --unstable`

 ```javascript
import { MongoClient } from "https://deno.land/x/mongo/mod.ts"

const client = new MongoClient()
client.connectWithUri("mongodb://localhost:27017")

const db = client.database("denoDB");
const greetings = db.collection("greetings");
```

on `client.connectWithUri` you will put your own URL. In my case, I have a database called *denoDB* and a collection called *greetings* in that database.

Now let's insert some data in there:
```javascript
const hello = await greetings.insertOne({
    sayHello: "Hello World..."
});
```

If you check on the terminal `db.greetings.find()` then you'll get that data back, or you can find the data using *deno_mongo*:
```javascript
const find = await greetings.find({
    _id: hello
});
console.log(find)
```
<br>
Update and Delete: 
updateOne returns `{ matchedCount, modifiedCount, upsertedId }` these three informations.
```javascript
// update
const { matchedCount, modifiedCount, upsertedId } = await greetings.updateOne(
    { sayHello: { $ne: null } },
    { $set: { sayHello: "Hello Universe..." } }
);

// delete
const delete = await greetings.deleteOne({ _id: hello });
```
---------------------
{% link https://dev.to/abmsourav/deno-installation-and-vscode-setup-la4 %}
Covid-19 data dashboard in our region
Tags: octograd2020
Published: 2020-05-22 19:59:58

"#githubsdp" : NEXT TECH Domains, Heroku

## My Final Project
Would like to end our term in college with this an organizational advocacy, that's why me and my colleagues implemented a COVID-19 Data Dashboard in our region to help the public have a grasp of the recent numbers in our region.




## Demo Link
icpepse-ustp.tech

## Link to Code

[Note]: # (Our markdown editor supports pretty embeds. If you're sharing a GitHub repo, try this syntax: `{% github link_to_your_repo %}`)

## How I built it (what's the stack? did I run into issues or discover something new along the way?)

It is built on NodeJS and ReactJS.




[Final Note]: # (CONGRATULATIONS!!! You are amazing!)
My tutorials have received 100+ claps on Medium.
Tags: discuss, angular, phaser
Published: 2020-05-22 19:56:09

About 8 months ago, I started posting tutorials on Medium to help people trying to combine Phaser + Angular in their projects.

I don't check every day but I have recently surpassed 100 positive responses to these tutorials. It makes me so happy knowing people have found them useful.

You can see them on my [Medium page](https://medium.com/@braelynnn).

What else would you like to see?