teleren/devto huggingface dataset:
Wrapping Up 2020
Tags: devjournal, codenewbie, webdev
Published: 2020-12-28 17:12:12

_This post was originally published on December 28, 2020 on [my blog] (https://alexlsalt.github.io/blog)._

This has most definitely been a whirlwind of a year, and I hope that you can take a moment to reflect on the amount of any progress you've made over the course of the last 365 days.

While it may not always seem like significant, groundbreaking progress day in and day out, I can assure you that any amount of effort you're putting in to learning how to code or improving your skills is pushing you forward in the direction of your dreams and goals.

I've taken some time to reflect on how I want to show up in 2021 - personally, professionally, and with Ladies Code Collective - and I'm enjoying the process!

It's an interesting period where I can feel certain ideas taking shape in my mind, and I'm confident they'll ultimately mold themselves into something quite amazing.

Wishing you a warm wrap-up of 2020, friend!

-------

P.S. I'm launching a new course - *Crafting Your Come-Up* - for early-career developers to set themselves apart along their coding journey! 

[Sign up here for updates!](https://www.ladiescodecollective.com/cohorts)

![Craft Your Come-Up course announcement](https://dev-to-uploads.s3.amazonaws.com/i/dcfucbhptmsgymqtg6nx.png)
Setting Access and Permissions for Tenant Admin
Published: 2020-12-28 17:09:07

Hi All,

We are developing a SaaS platform which is basically API first Content Publishing platform targeting Developers and Digital agencies. Our platform is developed in such a way that an agency manage multiple sites in a single tenant account. When designing the permissions for Tenant admin to sites, we had a difference in opinion among our team members.
Our Identity Management will look like this

Host Admin --> Tenant Admin --> Site Admin
Host Admin - Highest user (They will manage Tenants) They will not have access to any contents, users or content schemas of tenant but can only manage the tenants on a very higher aspect like billing, payments etc

Tenant Admin - Next Power full user after Host Admin. (Each Tenant can have multiple sites, A site can be of clients or own, Tenant admin will manage all this sites on higher level )
Site Admin - Power full user in a site. Each site have their own Identity management System for managing site users and groups.
Most of our cases, tenant admin will be a developer or digital agencies who develop sites for their clients. So ideally they will be managing Multiple sites. But some time, they can be client itself.

Now Initially We decided to give full access for Tenant Admin to all site, site related contents, users and settings under their tenant account. But this leads to a difference of opinion in our brain storming session.
Suppose Client Site is maintained (Technically maintain and Own) by a development agency, but client don't want to give access to contents, users and Schema to their development agency.

In the above situation we can have two option

1. Have an option to transfer the site to clients account provided client will have a valid account that allow site transfer.

2. To have an option for site admin to restrict the access of Tenant admin to certain areas of Site like Contents, Medias, users. In such cases only site settings will be accessible to tenants.

request your valuable suggestions on this.
What is your one most favorite website on the internet ️?
Tags: discuss, watercooler, webdev, javascript
Published: 2020-12-28 17:03:53

# Introduction

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

Internet from beginning to date is growing at a very fast rate. At every minute more than 380 websites are hosted over the internet (excluding the dark web). In this ocean of websites, we most of our time on spend on a few limited websites that we like. So today, We would discuss one website that we loved most. So let's start the discussion with my thoughts.

# My thought

It's very hard to pick one website from the internet that offers lots of websites, but I will choose YouTube▶️.

### Reason for selecting the website.

- I have access to content on any topic from entertainment to education 🏫.
- I can express myself on the internet by uploading videos on any topic 📁.
- Through YouTube monetization, I can earn money 💸.
- By using comment and community tap on the channel, I can discuss with the subscribers and with others on my desire topic 💬.

# Discuss
- **One website from the entire internet, you loved most❤️?(except search engine)**
Getting started with Django- Part 1
Tags: django, python, webdev
Published: 2020-12-28 17:02:39

## What is Django?

Django is a high-level, open-source Python Web development framework used for building rapid maintainable websites with clean pragmatic design. Built by experienced developers, it takes care of much of the hassle of Web development, so you can focus on writing your app without needing to reinvent the wheel. Django was built by Adrian Holovaty and Simon Willison at Lawrence Journal-World newspaper back in 2003-2004. The whole story of why and how they built Django is answered by Simon Willison on a [Quora post](https://www.quora.com/What-is-the-history-of-the-Django-web-framework-Why-has-it-been-described-as-developed-in-a-newsroom/answer/Simon-Willison).


## Why Django?

- **Administrative GUI** - One of the most powerful parts of Django is the automatic admin interface. It reads metadata from your models to provide a quick, model-centric interface where trusted users can manage content on your site.

- **Object Relational Mapping (ORM) Support** - Django provides a bridge between the data model and the database engine, and supports a large set of database systems including MySQL, Oracle, Postgres, etc.

- **Development Environment** - Django comes with a lightweight web server for an end to end application development and testing.


## Installing Django

Assuming you already have the latest version of Python installed on your machine, we go ahead and create a virtual environment. 
 
### Virtual Environment 

A virtual environment is a python module that creates a unique environment for each project or task, having its own version of python modules required to run the specific project or tasks.

### Installing and creating a virtual environment

We can install a virtual environment by using the Python Package manager `pip` .

 
```
pip install virtualenv
``` 

Having installed virtualenv, the next step is to *create* a virtual environment.


```
python3 -m venv <virtual-environment-name>
``` 

Now a virtual environment is created. We have to implicitly activate the virtual environment each time we use it. We can do that by using the command


```
source venv/bin/activate
``` 

Now the virtual environment setup has been completed. We can go ahead and install Django onto our machine by again using the Python Package manager `pip` and verify it by typing the following command.

```
pip install Django
python -m django --version
```

If Django is successfully installed you should be able to see the version of Django installed. If it throws an error then you see the official documentation [here](https://docs.djangoproject.com/en/3.1/topics/install/).

That's it for this tutorial. We will see how to start a Django project and create apps inside our Django project in the next tutorial.
What are some interesting visualization libraries?
Tags: discuss, javascript, help, webdev
Published: 2020-12-28 16:59:24

I'm building out a home automation suite. I'll be blogging about it [on my new Forem Hometechnica](https://www.hometechnica.com/ben/homesweethome-my-personal-home-automation-project-3gg7) in detail if you want to follow me there.

But a question for DEV in general: What are some libraries for visualization... It's a broad question, but right now I'm willing to be very exploratory with my approach to displaying lights being on or off, or showing the state of things in a floor plan, or anything like that.

Literally anything that could be used to create interactive visuals would be great to hear about!
Top Shopware Plugins to Extend Your Web-Store
Tags: ecommerce, shopware, webdev, onlineshopping
Published: 2020-12-28 16:37:02

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/1yiv0079umg3kmpwae2o.png)
There are many reasons why *Shopware 6 is an excellent solution for an eCommerce website development*. One of them is its variety of opportunities to extend your store. 

Let’s see what Shopware 6 plugins can contribute to your e-store optimization:

* **Shopware SEO Plugin** belongs to one of the most popular plugin categories, as it helps your website content to be accessible via search engines. Moreover, certain SEO plugins are tailored to a particular search engine, so your website could be completely compliant with its search result policies;


* **Shopware Newsletter Plugin** is a good assistant in automatizing your corporate letters sending. It allows you to manage your client groups and set a specific time for each one;

* **Shopware Migration Plugin**. This plugin category helps to simplify a migration process to Shopware platform. Its main advantage is that this plugin doesn’t require coding skills and is intuitive-in-use for any average user;

* **Shopware Blog Plugin**. In my opinion, a website without a blog can’t be considered full-fledged. So a blog plugin is certainly a must have for any digital store. Besides, it’s an additional instrument to strengthen your SEO performance;

* **Shopware Backup Plugin**. It’s a necessary plugin to prevent any unexpected technical issues. 

All of the mentioned above plugins are available in the Shopware official store of extensions.

If you are not satisfied with your eCommerce website current functionality, [follow the link](https://dinarys.com/blog/shopware-6-how-to-extend-it-with-plugins) and discover how you can fix this.
Send a Telegram message with Darklang
Tags: darklang
Published: 2020-12-28 16:35:46

---
title: Send a Telegram message with Darklang
tags:
  - darklang
cover_image: https://images.unsplash.com/photo-1521931961826-fe48677230a5?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=600&q=80
published: true
canonical_url: https://cri.dev/posts/2020-03-04-Send-a-Telegram-message-with-Darklang/
---

**Originally posted on [cri.dev](https://cri.dev/posts/2020-03-04-Send-a-Telegram-message-with-Darklang/)**

In this example you can see how to emit a *Worker* event with Darklang.

### Telegram endpoint `/sendMessage`

Using the endpoint [`messages.sendMessage`](https://core.telegram.org/method/messages.sendMessage) you can simply send a message on Telegram by calling this endpoint via GET and the needed parameters in the query string.

## The worker

The worker is named `send_telegram_message` and looks like this:

```haskell
let chat_id = "YOUR_CHAT_ID"
let bot_token = "YOUR_BOT_TOKEN"
let url = "https://api.telegram.org/bot" ++ bot_token ++ "/sendMessage"
let query = {
              chat_id : chat_id
              text : event.text
              parse_mode : "HTML"
            }
HttpClient::getv4 url query {}
```

## Calling the worker

The worker is then called with and *event body*, which should contain *the text to send via Telegram*:

```haskell
let event = {
              text: "Hello from Darklang"
            }
let _ emit event "send_telegram_message"
```

This is how the worker looks like:

![dark telegram](https://cri.dev/assets/images/posts/dark/dark-telegram.png)
Simple .npmrc management
Tags: node, javascript
Published: 2020-12-28 16:34:59

---
title: Simple .npmrc management
tags:
  - nodejs
  - javascript
published: true
canonical_url: https://cri.dev/posts/2020-02-25-Simple-npmrc-management/
---

**Originally posted on [cri.dev](https://cri.dev/posts/2020-02-25-Simple-npmrc-management/)**

One way to provide environment variables when running a script with npm, is to create a file called `.npmrc` in the root of the project (same level as `package.json`).

Here is an example `.npmrc` (*note: lowercase*):

```yaml
telegram_token=abc
telegram_chat_id=123
```

> **git ignore this file, especially in public repos**

I find it useful to have an **npm script** called `node`, which runs node, but by loading the `.npmrc` file:

In your package.json
```json
  "scripts": {
    "node": "node",
    ...
```

Then, in your Node.js script, you would read the environment variables with the `npm_config_` prefix.

You can run this now with `npm run node -- index.js`

The `index.js` file:

```js
console.log(process.env.npm_config_telegram_token)
> abc
console.log(process.env.npm_config_telegram_chat_id)
> 123
```

Here is how I personally [manage my environments in Node.js](https://cri.dev/posts/2020-02-08-Minimal-environments-with-dotenv-and-Node.js/).

# Example

Below you can find an example using the library `simple-telegram-message`:

```js
const { sendMessageFor } = require('simple-telegram-message')
const sendMessage = sendMessageFor(process.env.npm_config_telegram_token, process.env.npm_config_telegram_chat_id)
sendMessage(`Hi from bot!`)
```
Best domain for student developer?
Tags: javascript, discuss, help
Published: 2020-12-28 16:32:34

Hey, I have been using `Netlify` as hosting service for my portfolio and other projects. (BTW, check out my portfolio [here](https://ashutoshdash.netlify.app/).)
But I don't like when `netlify.app` is added after my websites.
Can you suggest me some really good and affordable hosting services?
Also, I'm looking for a domain. Which domain would you suggest which looks professional and doesn't cost much?
How to run the React example code in the Bochuk book
Published: 2020-12-28 16:29:23

I'm just starting React, and have completed the Mozilla tutorial.

Then I bought the Packt book React... by Bochuk, which looks really good (much cheaper from them than from the zon!).

I downloaded the code, which also looks good. 

But, the book wisely advises us to run the code samples, and I can't see any way to do this.

Has anyone seen this, and solved it?  

On the Mozilla tut, there was a mass of stuff , including node.js, and npm, bundled with the single source file, which slowly grew.  To run, you just did 'npm start', and a server on localhost started, and your code ran.

This time I installed node and npm separately, and checked they worked, but still no luck. 

There must be a way to run the code. They mention next.js, well on in the book.  I tried that, successfully, with the next.js example code, but couldn't see how to do it with the Packt examples.

Help!

PS -- I'm new to DEV, this is my first post, I see the advice to add tags, but not how to do it.  Help again:-(...
Merge two arrays
Tags: javascript, codenewbie, webdev, beginners
Published: 2020-12-28 16:19:08

```js
const a = [1, 2, 3];
const b = [4, 5, 6];

// 1. .concat()
console.log(a.concat(b)); // [ 1, 2, 3, 4, 5, 6 ]

// 2. spread operator
console.log([...a, ...b]); // [ 1, 2, 3, 4, 5, 6 ]
```
---

**Thanks for reading 💙**  
Follow **@codedrops.tech** for daily posts.  
[Instagram](https://www.instagram.com/codedrops.tech/) ● [Twitter](https://twitter.com/codedrops_tech) ● [Facebook](https://www.facebook.com/codedrops.tech/)

Micro-Learning ● Web Development ● Javascript ● MERN stack ● Javascript  
**[codedrops.tech](https://www.codedrops.tech/)**
search for text or link on all pages in a specific web page
Published: 2020-12-28 16:17:51

I need a good way to find a specific text or link for my company's website.
Scenario: Content managers have decide to remove the name of a product from our website. My job is to verify that the change have occurred. I can't navigate through all the pages as there are many. I have heard about scrapy but it seems to only work on defined pages and that is not what I need. 
Help or advice would be very much appreciated
thanks
JavaScriptmas Solutions
Tags: scrimba, javascriptmas
Published: 2020-12-28 16:10:15

1. [Candies](https://scrimba.com/scrim/co709467ba5fb4e8b9c624216)
2. [Deposit Profit](https://scrimba.com/scrim/coedc4cc195038cdcfb805186)
3. [Chunky Monkey](https://scrimba.com/scrim/coaf24fa7a935ad6c3fa2448a)
4. [Century From Year](https://scrimba.com/scrim/co43e45d79f40afa6b6448a47)
5. [Reverse a String](https://scrimba.com/scrim/coe7848f0b5f88950966a040a)
6. [Sort by Length](https://scrimba.com/scrim/co5764f3b8b5587ae92a2296b)
7. [Count Vowel Consonant](https://scrimba.com/scrim/co6c146719d82523eee8637cc)
8. [Rolling Dice](https://scrimba.com/scrim/co9a845f4b55d7a6e4fb59912)
9. [Sum Odd Fibonacci Numbers](https://scrimba.com/scrim/co27d4995bbf71819ce74e5d5)
10. [Adjacent Elements Product](https://scrimba.com/scrim/co3b44d72a669fc7f6cfec308)
11. [Avoid Obstacles](https://scrimba.com/scrim/cofef40febf152a663b51bf83)
12. [Valid Time](https://scrimba.com/scrim/cof3d470a9b57c0f1152979b0)
13. [Extract Each Kth](https://scrimba.com/scrim/coc804b6cb63a2fa166de4078)
14. [Maximal Adjacent Difference](https://scrimba.com/scrim/co576409bb2d73265f5ba9ed6)
15. [Carousel](https://scrimba.com/scrim/co3b0492087be55c93dca1e00)
16. [Insert Dashes](https://scrimba.com/scrim/co6ff44b685319d3c43aa35c1)
17. [Different Symbols Naive](https://scrimba.com/scrim/co6bc40d0b75216f392057fc4)
18. [Array Previous Less](https://scrimba.com/scrim/co3574e5c90516bd31c3fa99a)
19. [Alphabet Subsequence](https://scrimba.com/scrim/cofd34877bc3eab174c17eda7)
20. [Domain Type](https://scrimba.com/scrim/cocde4d61be0e0aa333ebf429)
21. [Sum of Two](https://scrimba.com/scrim/co74741efb01a6b75c13b54b7)
22. [Extract Matrix Column](https://scrimba.com/scrim/co7d7429c8ecc4dc194e0655a)
23. [Social Media Input](https://scrimba.com/scrim/coc7c474eba1091ed313d802d)
24. [Test Your Agility](https://scrimba.com/scrim/cofa94c628921ff9293e3da53)
25. [Max Consecutive Sum](https://scrimba.com/scrim/cocfc40ab8c9d864677b4293b)
Google Calendar Troubleshooting Info
Tags: googlecalendar, testing
Published: 2020-12-28 15:56:00

Troubleshooting an issue can be difficult when you don’t have helpful information to go by. A Google Calendar event id is a unique identifier for an event and can help when troubleshooting Google Calendar issues. However, it’s not something that displays normally. Let’s learn how to get the Google Calendar Troubleshooting Info menu option to appear!

## Event Debugging

When you visit Google Calendar in a web browser, the url will look something like below.

```
https://calendar.google.com/calendar/r
```

Let’s add a special url argument that enables event debugging. By adding the **eventdeb=1** argument to the url and hitting enter to reload the page, the Troubleshooting info menu option will now be available.

```
https://calendar.google.com/calendar/r?eventdeb=1
```

## Troubleshooting Info

![Troubleshooting Info](https://dev-to-uploads.s3.amazonaws.com/i/xxbpvq6bo2f05773l1rr.png)

1. Select any event on the calendar.
2. Select the Options menu.
3. Select Troubleshooting info.

```
Event{ eid=73fn1srp11s663vvsvodaksvb3, ...
```

The **eid** property provides the event id value for the event you selected. In the above example, the event id would be 73fn1srp11s663vvsvodaksvb3. This can be a helpful piece of information when troubleshooting Google Calendar issues, especially when working with Google Calendar APIs.

---
#### Visit our website at [https://nightwolf.dev](https://nightwolf.dev) and follow us on [Facebook](https://www.facebook.com/NightWolfDevelopment) and [Twitter](https://twitter.com/nightwolfdev)!
---
Capture Custom Response Header Using Angular Interceptor
Tags: angular, javascript, webdev
Published: 2020-12-28 15:46:37

In a recent project, the API server exposed a custom response header called request-id, which uniquely identified the network request. If the network request failed, the request id could be used to find its respective entry in the error log. However, the typical end user wouldn’t know how to provide this information when reporting an issue. Let’s learn how to use an Angular Interceptor to capture a custom response header!

## HttpInterceptor

The [HttpInterceptor](https://angular.io/api/common/http/HttpInterceptor) interface provides a means of intercepting HTTP requests and responses to transform or handle them before passing them along.

Let’s create a service that implements the HttpInterceptor interface.

```javascript
import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, HttpResponse } from '@angular/common/http';
import { Injectable } from '@angular/core';
 
import { Observable, throwError } from 'rxjs';
import { catchError, filter } from 'rxjs/operators';
 
@Injectable()
export class ErrorInterceptor implements HttpInterceptor {
  intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
    return next.handle(request);
  }
}
```

For my particular scenario, I was only interested in HTTP responses, specifically internal server errors (HTTP status code of 500). We’ll add a pipe and make use of the **filter** and **catchError** operators.

```javascript
return next.handle(request).pipe(
  filter(event => event instanceof HttpResponse),
  catchError(error => {
    if(error.status === 500) {
      const requestId = error.headers.get('request-id');
      ...
    }
 
    return throwError(error);
  })
);
```

We filter the entries specific to HTTP responses and then catch any errors that occur. We check for the error status of 500 and then capture the request-id header value.

You could then pass this information off to another service or maybe store it in local storage. Create a routine to display this information to the end user and they can include it when reporting an issue!

## Provide the Interceptor

In order to actually use the interceptor, you have to define it as a provider in whatever module you want to use it in. In my particular use case, I provided it in the app module so I could capture errors across the entire application.

```javascript
import { HTTP_INTERCEPTORS } from '@angular/common/http';
 
import { ErrorInterceptor } from '/path/to/interceptor';
 
@NgModule({
  ..
  providers: [
    { provide: HTTP_INTERCEPTORS, useClass: ErrorInterceptor, multi: true }
  ]
  ..
})
export class AppModule {}
```

You can use multiple interceptors, but keep in mind that Angular provides them in the order that you provide them. For example, if you provide interceptors A, then B, then C, requests will flow in A > B > C and responses will flow out C > B > A.

---
#### Visit our website at [https://nightwolf.dev](https://nightwolf.dev) and follow us on [Facebook](https://www.facebook.com/NightWolfDevelopment) and [Twitter](https://twitter.com/nightwolfdev)!
---
Created a cool looking Basic Banking Website
Tags: javascript, html, css, design
Published: 2020-12-28 15:31:48

## What I built
I have created frontend of a basic banking system.
I have focused more on improving the UI.
Give it a try [here](https://ashutoshdash1999.github.io/YourMoney-BasicBankingSystem/index.html).
[GitHub Repo](https://github.com/AshutoshDash1999/YourMoney-BasicBankingSystem).
Feel free to give your feedback. It will help me to improve my project. :)

### Additional Info
I'm looking forward to collab with creative individuals who can contribute to making the design better and improve the UX and coding stuff. 
Also, if you are new to contribution, it will be great if you can contribute to improving the README.md file.

Feel free to connect with me over Linkedin [here](https://www.linkedin.com/in/ashutoshdash1999/).