teleren/devto huggingface dataset:
Discuss: Would you join a dev.to IRC channel?
Tags: discuss, irc, devops, help
Published: 2020-01-05 02:39:30

---
title: Discuss: Would you join a dev.to IRC channel?
published: true
description: 
tags: discuss, irc, devops, help
---
This might sound a bit old-school, but IRC is still one of the tools I use on a daily basis so would be interesting to have some tech and non-tech conversations with the community in freenode or somewhere else.

Opening the discussion on this matter.
Setting Up a REST API With Strapi
Published: 2020-01-05 01:37:46

*[Original post from series "Building an App with Gatsby and Strapi"](https://shannonwilliams.io/making-api-calls-to-strapi/)*

**Who is this post for?** Each post in the series is loosely dependent on each other. So you can follow any post in any order you like. Posts were made this way so you don’t have to read all the previous ones to follow along.

**The goal of this post** is to explore Strapi’s REST API in regards to:

- setting up the API,
- setting up API permissions,
- documenting and testing API endpoints.

## Setting Up
Okay, so far the post is a bit misleading… **Strapi automatically generates content API endpoints for CRUD (create, read, update, delete) operations** when you create or modify content types 🙂 So we don’t have to worry about this step!

## Setting Up API Permissions
Before we can use the generated API, we will need to define who has permission and to what actions. For example, lets look at the Page content type and give the Public role permission to call `count`, `find`, and `findone` actions (actions are simply the functions used by the controller to perform business logic).

**Step 1 – Ensure the content type is defined as needed**
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/s2amykn87gxkmzn79ad0.png)

**Step 2 – Go to Roles & Permissions and select the Public role**
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/oxy5okq21x66avvgy8u0.png)

**Step 3 – Give permission to use the actions**
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/ek8ldzaui8xklh1u9wmx.png)

## Documenting and Testing the API
There are multiple ways to test this, but for this post I recommend is using [Swagger UI](https://swagger.io/tools/swagger-ui/). It’s a nifty tool that automatically generates documentations for REST APIs. To set up, run the following command in your terminal in the root folder of the strapi instance.

```shell
   npm run strapi install documentation
```
Restart Strapi. A new UI section is then created to manage the documentation. Here you can access the documentation, test responses, and restrict access to the documentation.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/kkpt29ex53icixd6hiea.gif)
What is your top interesting cron job for your daily life? 🤯
Tags: cron, productivity, discuss, linux
Published: 2020-01-05 01:20:15

---
title: What is your top interesting cron job for your daily life? 🤯
published: true
description: show us your best cron job
tags: cron, productivity, discuss, linux
cover_image: https://thepracticaldev.s3.amazonaws.com/i/f30jw6r4cksr15esjmzz.jpg
---

As developers, we are lucky to be able to use our own skills and knowledge to improve our life.

And I recently dug into about cron jobs and how impactful and time saving they can be in our daily life. 

🧐 I'm curious on which ones you used daily (in a personal or professional way it does not matter!)

💪 Share us your best ones to give us some ideas to build around. 
Any public repo are welcome!

🤩 I would love to find somewhere a curated list of best cron jobs ideas to setup during spare time! (might start a collaborative repo on this topic?)

Personally, I'm starting by setting up a cron job to backup every day my computer files into my NAS.


Do you have any favorite cron jobs that you are frequently using?
Archive subdomains for web application
Tags: help
Published: 2020-01-05 01:11:37

#### What is your question/issue?

So I am building an application with Node. It's a consignment sort of an application and I want each user that registered acquires a subdomain.

`example.com` - root domain
`user.example.com` - when a user creates an account

#### What technologies are you using?
I am using Nodejs for the API and React as the UI.

#### What were you expecting to happen?
I just need an idea or resources to achieve new user, a new subdomain

#### What is actually happening?
I haven't tried out anything yet.
Weekly Roundup 05 Jan 2020
Tags: weekly
Published: 2020-01-09 18:34:23

---
title: Weekly Roundup 05 Jan 2020
published: true
date: 2020-01-05 00:00:00 UTC
tags: weekly
canonical_url: https://www.ankursheel.com/blog/weekly-roundup-05-jan-2020
---

Every week I come across some great articles. Here are some of the posts I feel you will enjoy reading as much as I did.

Watching TV can be an expensive hobby. **Lars Lofgren** has a few options to [watch TV for free](https://www.iwillteachyoutoberich.com/blog/watch-tv-online-free/).

Were you under the impression that JAMStack cannot be used to make dynamic websites/experiences? **Jason Lengstorf** has a few demos to show how we can [respond to user interactions, talk to third-party API's, store data and handle user authentication](https://www.smashingmagazine.com/2019/12/dynamic-async-functionality-jamsstack-websites/).

**Florin Pop** has a [collection of app ideas which can be used to improve your coding skills](https://github.com/florinpop17/app-ideas). The projects are divided into 3 levels and each project has enough details in the form of description and user stories.

Its the time of the year when my feed is full of 2019 review posts. **Steve Schlafman** shares his [annual life review blueprint](https://medium.com/@schlaf/how-to-conduct-an-annual-life-review-that-will-catapult-you-into-the-new-year-d5aaffebac1f).There is also a [handy little template](https://docs.google.com/document/d/1Ais6wP0HxoFfvHR9JVkf2sw2ft_EUBtb42JYOr6ObGo/edit) made by **Howard Gray**.

Someone wants to pick your brain and you want to help but your time is valuable. **Alex Hillman** shares his [system to weed out time-wasters without saying no](https://stackingthebricks.com/pick-your-brain/).

Hope you enjoy reading these articles as much as I did.
Help: Should a new service worker force a refresh to update a PWA?
Tags: help, pwa, serviceworkers
Published: 2020-01-04 23:39:32

---
title: Help: Should a new service worker force a refresh to update a PWA?
published: true
description: 
tags: help,pwa,service-workers
---

I have a frontend app called [Finskore](https://www.finskore.com) for scoring games of Finska that I want to enable offline.

I'm following [Google's PWA guide about service workers](https://developers.google.com/web/fundamentals/primers/service-workers/) and it seems that an updated service worker will only take effect on the following visit. The existing SW runs the current session, but the new version is installed for the next network visit.

My question is, should I try and detect when a new service worker has been installed and force a refresh at that time? The reason being to get the new version of the app for the immediate session.

I was wondering if I could compare cache version names on install and do a window.reload() if they are different?

Thoughts?
Nicztin Enripe 
Tags: help, tutorial, javascript, vscode
Published: 2020-01-04 23:34:33

Suggested advantages of this style are that the starting brace needs no extra line alone; and the ending brace lines up with the statement it conceptually belongs to. One cost of this style is that the ending brace of a block needs a full line alone, which can be partly resolved in if/else blocks and do/while blocks:

void checknegative(x) {
    if (x < 0) {
        puts("Negative");
    } else {
        nonnegative(x);
    }
}

There are many mentions of The One True Brace Style out there, but there is some confusion as to its true form. Some sources say it is the variation specified above[8], while others note it as just another "hacker jargon" term for K&R[1].
How do you sync all your tools and projects and plugins etc?
Tags: discuss, webdev, development, tools
Published: 2020-01-04 23:23:10

---
title: How do you sync all your tools and projects and plugins etc?
published: true
description: A discussion on how to sync all your info and tools and projects.
tags: discuss, webdev, development, tools
---

I generally use a laptop on the go (Macbook Pro) and a desktop at the home office (Windows 10, may f around and install Linux later).

I'm looking for the easiest and most efficient way to synch all my tools, plugins, and work/projects so that I can seamlessly close my laptop at [PUBLIC LOCATION REDACTED] and pick back up easily when I get home.

Any advice?

I'm happy to just be linked to guides. You don't need to type it all up if you know of a good guide someone wrote up.

Thanks!!
Learn to build a modern-day website with just html and css
Tags: website, beginners, css
Published: 2020-01-04 23:21:35

Today we will be learning how to build this website using just html and css(100% responsive) so what are you waiting for click on the link to view video on YouTube,source code link available in video description.
<a href="https://youtu.be/FB8ld-iu2H4">Youtube video link</a>
Code-Notes Patch Work
Tags: bug, opensource, javascript
Published: 2020-01-04 23:10:39

---
title: Code-Notes Patch Work
published: true
description: 
tags: bug, oss, javascript
---

In this video I work through setting up a vue electron app in Lubuntu linux distro. Along the way I hit a few snags and eventually get to a working patch at the end. Hopefully you can learn something from it. 

https://youtu.be/6Kjrjv94W9Y
https://github.com/lauthieb/code-notes
Need Help with Data Modelling in Firebase
Tags: help, angular, firebase, javascript
Published: 2020-01-04 22:25:43

I'm trying to create a Data Structure in Firebase for a group todo app like this:

Users-Collection: Every user is a document with some attributes, a user can be part of many groups (1 -> n).


Groups-Collection: Every group is a document with attributes, a group has many users (1 -> n), a group has many items (1 -> n).

Todos-Collection: Every todo is a document with a ID and some attributes.



My Question is what the best way would be to model this? While developing I discovered, that if i want to display all of a groups users, i had to make a request for every user, or i had to store every attribute of a user inside the group's document. And the same would apply to the Todos.

Here are some screenshots how the Data Structure is looking right now:
Users-Collection:
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/kt41bgfhgzdii3iabnb9.PNG)

Groups-Collection:
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/3yppnk86q4gnyv6wn5cw.PNG)

Btw for Frontend I'm using Ionic 4 with Angular and for firebase interactions I use AngularFire.
Day 4 of Jamuary - Using Euclidean Rhythms
Tags: showdev, ruby, music, creative
Published: 2020-01-04 22:17:55

Using Sonic Pi Again to make algorithmic composition, using certain Euclidean Rhythms to provide a more world type field : https://youtu.be/T6QSe9fuGyw?t=252


Euclidean Rhythms As stated in the Abstract of the Paper , The Euclidean Algorithm Generates Traditional Musical Rhythms Godfried Toussaint

The Euclidean algorithm (which comes down to us from Euclid’s Elements) computes the greatest common divisor of two given integers. It is shown here that the structure of the Euclidean algorithm may be used to generate, very efficiently, a large family of rhythms used as timelines (ostinatos), in sub-Saharan African music in particular, and world music in general. These rhythms, here dubbed Euclidean rhythms,have the property that their onset patterns are distributed as evenly as possible. Euclidean rhythms also find application in nuclear physics accelerators and in computerscience, and are closely related to several
families of words and sequences of interest in the study of the combinatorics of words, such as Euclidean strings, to which the Euclidean rhythms are compared. - Toussaint

More can be seen here : http://cgm.cs.mcgill.ca/~godfried/publications/banff.pdf
Convert string to bytes for both python 2 and 3 - Python Tips
Tags: python
Published: 2020-01-04 22:09:04

Python2 retired this year, if you have some old projects are still running Python2, you may want to gradually update your code to Python3.

One big difference between Python 2 and 3 is the string and bytes type. This affect many functions' parameters. For example, if you have some code like this in Python2:

```python
import hashlib

s = "abcd"
hashed = hashlib.md5(s).hexdigest()
```

It will throw exception if you run it in Python3:

```python
>>> import hashlib
>>> s = "abcd"
>>> hashed = hashlib.md5(s).hexdigest()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: Unicode-objects must be encoded before hashing
```

The reason is, in Python3, `s="abcd"`, s is `str` type which is unicode, and `hashlib.md5` only take bytes object for hashing.

So to make the code both compatible with Python2 and 3, we need to add a converter function to change the parameter to be bytes type.


```python
PY2 = sys.version_info[0] == 2
if PY2:
    unicode_type = unicode
else:
    unicode_type = str

def force_bytes(s, encoding="utf-8", errors="strict"):
    if isinstance(s, unicode_type):
        s = s.encode(encoding, errors)
    return s
```

This code will check Python version and based on the version to make proper conversion. Now we can call this `force_bytes` function before pass it to `md5` function:

```python
import hashlib
s = "abcd"
hashed = hashlib.md5(force_bytes(s)).hexdigest()
```

A second way will be using the [`six` library](https://six.readthedocs.io/). It contains lots of util functions could help your code be compatible with both 2 and 3. For example, it has a `ensure_binary` function which is similar with our `force_bytes` function, so you can call it like this:

```python
import hashlib
import six

s = "abcd"
hashed = hashlib.md5(six.ensure_binary(s)).hexdigest()
```

If you want a function to convert to unicode, you can check `six.ensure_text` function, and if you are using `StringIO`, six also has `StringIO` and `BytesIO` you can use. You can [check more functions here](https://six.readthedocs.io/).
Nim: from scripting to C code. The all-in-one language
Tags: nim, language, native, scripting
Published: 2020-01-04 21:54:53

Today I’d like to talk a bit about NIM, a programming language that I have recently discovered.

You may be used to two different types of languages:

* Native compiled languages (C, C++, Go, Rust, …)

* Scripting or interpreted languages (Javascript, Python, Bash, …)

Each of those have their pro’s and con’s, but today we are here to discover the best of both worlds with **Nim**.

## What makes it different?

### C language as a target

Unlike the typical systems programming languages, Nim allows to compile **[dependency-free static binaries](https://nim-lang.org/features.html#native-performance-with-optimisations)** by precompiling your project to **plain old C code**.

However, Nim also allows you to compile your projects to **C++** or **[Javascript](https://nim-lang.org/features.html#javascript-compilation)**. This enables to program both backend and [frontend](http://picheta.me/snake) projects using the same knowledge.

### Templates and macros are defined using Nim itself

If you are familiar with the typical #define, #ifdef, etc constructs in C, you’ll feel at home with Nim, because the language is [flexible enough](https://nim-lang.org/features.html#small-core-with-extensibility) to support them by itself.

### Nimscript

When you are targeting internal scripts and automation tasks, you can rely on Nim to do the work for you. Nimscript is a subset of the language that allows to run running custom operations on a more comfortable language. Unlike the traditional shell interpreters, Nim is fully cross-platform and you can opt for a binary or script approach without changing any mental context.

Personally, I’m excited to play a bit with it and see what it can do 🍭
To me, it looks concise, clean and well thought out. I’ve seen it being used for game development, crypto apps, scripts and more.

I’m currently working on a first use-case tool that makes use of it on a really cool topic. If all goes smoothly I’ll write a full post about both the language and the “thing” that it will provide.

Stay tuned for more. 
Until then, take care!

![Photo by [Conor Luddy](https://unsplash.com/@opticonor?utm_source=medium&utm_medium=referral) on [Unsplash](https://unsplash.com?utm_source=medium&utm_medium=referral)](https://cdn-images-1.medium.com/max/5120/0*5Ke4jr2HwOjkAb7I)*Photo by [Conor Luddy](https://unsplash.com/@opticonor?utm_source=medium&utm_medium=referral) on [Unsplash](https://unsplash.com?utm_source=medium&utm_medium=referral)*
Links of the Week (1)
Published: 2020-01-04 21:54:39

I decided to start sharing, in a weekly fashion, a few noteworthy links that I've found over the week. Hopefully will manage to be consistent and publish once a week.

* https://evertpot.com/h2-parallelism/
An interesting exploration comparing the performance of HTTP 1.1 and 2.0 with different strategies for requesting data.

* http://reasonablypolymorphic.com/blog/protos-are-wrong/
A lengthy critique of protobuffers, mostly centered on its type system. In my current job, we use them extensively, from before my time there, but in my experience, I haven't suffered from the criticisms. Unfortunately, the author doesn't point to any better solution.

* https://julien.danjou.info/properly-managing-your-gitignore/
Great explanation on how to use `.gitignore` files, the role of the local versus the global one.

* http://cliffle.com/p/dangerust/
A great and detailed tutorial on how to port a highly optimized C program into Rust.
React, Reactive Microservices, Kubernetes, GraphQL & gRPC - Announcing Appwish - Fullstack Tutorial Series & Opensource Project
Tags: react, webdev, java, tutorial
Published: 2020-01-04 21:52:31

## Hello everyone!

In the next few days, I'll start publishing posts on building **Appwish** - a platform where people can express their app wishes (e.g. "I wish I had an app for X and Y") and vote up other people's great ideas. 

Developers can use Appwish to keep track of the most wanted apps and features. They can assign themselves to projects, create dev teams and collaborate to fulfil people's needs.

In the future, the platform could also introduce elements of fund-raising or voluntary donations for the most appreciated developers and teams.

## In the project and tutorials I'll use all of the following concepts and technologies (& more)

- **React.js** - for building modern web UI
- **GraphQL** - for data exchange between UI and backend microservices
- **gRPC** - for backend inter-service communication
- **Docker** - for packaging applications
- **Docker Compose** - for setting up local development environment
- **Vert.x** - for creating high-performance, reactive microservices
- **Kubernetes** - for container orchestration
- **Real-Time Data Streaming** via gRPC & GraphQL
- **Microservices** architecture

If the project goes well, there's even more stuff in plans:
- **Istio** - additional layer on top of Kubernetes for managing service-to-service communications between microservices
- Many of the [Cloud Native Computing Foundation projects](https://www.cncf.io/projects/) like
  - **Jaeger** - for distributed tracing
  - **Prometheus** - for system monitoring
- **React Native** - for iOS & Android client (or other mobile native framework, **contributions are welcome!**)

## The Goal
The goal of this project is to create a real-life application/platform using top trending technologies & describe all the steps in educational tutorial series. If the project goes well, it may be released someday!

## Contributions are welcome!
After I set up the initial project skeleton I'd appreciate any contributions from people who would like to collaborate in app development and/or learn hands-on. 

**Frontend, Backend, DevOps - doesn't matter - you'll find your place here.** There's lots to do!

## Final Words
If you like (or don't) the idea - share your thoughts and let me know in the comments or on [social media](https://www.facebook.com/talkoverflowsoftware/) - I'd really appreciate it! You can also let me know if you'd prefer the tutorial in the form of blog posts or videos :) Thank you for reading!

EDIT:
Now you can also join us on Slack to learn more about the project - https://join.slack.com/t/appwish/shared_invite/enQtODk2NjE1ODkyMjMwLTU4NTNhYzBmYmI0MzNiNmJjNDU4MzRkNjI4ZTc4NWZmMzMyMTZmNWFjNDAzNTIwMDYzY2U5YWVhMTRkZGIyNmI
How to quickly add SASS to your React project
Tags: sass, react, github
Published: 2020-01-04 21:37:59

When I first started experimenting with SASS, the first thing I did was look for a VS Code plug-in to add SASS automatically to my project; nevertheless, when I started working with other people that had different code editors, this became an issue.
I took the time to check some YouTube videos and found a quick way to add SASS to your React project, no matter in which state the project is.

I'm not going to make this as those people who create food recipes that tell their life story before posting the actual information, so...

## Here we go:

* Create your React project

* Open your terminal of choice and input:

   `npm install --save-dev node-sass`

* Create a folder called *Styles* inside your `src` folder.

* Inside the *Styles* folder create a *variables.scss* sheet.

* Convert *App.css* to *App.scss* and move it inside *Styles*

* Go to *App.js* and change *App.css* to *App.scss*. It should be at the top, on your imports.

* Go to *App.scss* and import your variables sheet (*variables.scss*)

* THAT'S IT!

---

If you are lazy or just in a hurry, I created a downloadable repo with all of the above already implemented. 

#[Here it is!](http://bit.ly/2QpFdHJ)

---
What are your goals as developer for 2k20+?
Tags: watercooler, discuss, question
Published: 2020-01-04 20:45:17

I'm wondering if you developers out there have any plans or goals for the new year or even the new decade that you'd like to share?

And I take the opportunity to say a big THANK YOU to all who create awesome things, contribute to Open Source and help making the work and life of others easier! You are gold! 👏🏻🥇
The React based crizmas-mvc front-end framework for enterprise applications
Tags: crizmasmvc, react, frontend, framework
Published: 2020-01-04 20:32:33

Hi guys! Just wanted to share with you this article where I describe the crizmas-mvc framework based on React, in what way it's better than other frameworks and why you should use it. :-)

https://medium.com/@raul.mihaila/the-crizmas-mvc-front-end-framework-for-enterprise-applications-d89d9f2fe281
What was your win this past week?
Tags: discuss, weeklyretro
Published: 2020-01-04 20:14:30

---
title: What was your win this past week?
published: true
description: Got to all your meetings on time? Started a new project? Fixed a tricky bug?
tags: discuss, weeklyretro
cover_image: https://cl.ly/188e843c2985/download/Image%202019-02-15%20at%202.36.37%20PM.png
---

👋👋👋👋

Peter, Ben & I were having a brainstorming session all Friday and I totally forgot to post this! Sorry about that!

Looking back on your week -- what was something you're proud of?

All wins count -- big or small 🎉

Examples of 'wins' include:

- Getting a promotion!
- Starting a new project
- Fixing a tricky bug
- Cleaning your house...or whatever else that may spark joy 😄

Happy Weekend!

![relaxing-ninja-turtle](https://media.giphy.com/media/Ala8Pjo4RN9kY/giphy.gif)
Ionic Svelte UI demo - a developer's companion 
Tags: svelte, ionic, mobileapp, frontend
Published: 2020-01-04 20:00:23

A showcase app for all Ionic UI elements. Use this app to try-out the elements you like for your app, and then navigate directly to the API docs or the source code.

A companion app for svelte-ionic developers.

Published as web app: https://ionicsvelte.firebaseapp.com

Repo: https://github.com/Tommertom/svelte-ionic-app

#mobileapp #firebase #ionic #svelte #shamelessplug #frontend #webdev #javascript