teleren/devto huggingface dataset:
NextDNS, a good companion for everyday internet usage
Tags: nextdns, dns, tool
Published: 2021-02-24 11:02:34

![NextDNS Logo](https://news.jae.moe/IMG/arton6.png?1613569319)

I have been using [NextDNS](https://nextdns.io) for well over a week now and here is what I have to say about it.

First, what is NextDNS?  
Well, it is a DNS firewall that can be used to block tracking and annoying domains.  
It is especially useful for mobile devices, on which ad-blockers such as uBlock Origin aren't available.  
As a bonus, NextDNS can also be configured to block telemetry from the major OSes such as Microsoft Windows, Apple macOS or Google's Android.  
 ![](https://news.jae.moe/IMG/png/screenshot_2021-02-17_at_14.49.02.png?1613569759)

The service itself is free to use up to 300k requests per month, which is more than enough for a regular user.  
The next plan costs 2.- per month for unlimited requests and that's about all that is added.  
All features of NextDNS are free by default (except for the unlimited requests).

Setting up NextDNS itself is really easy, they do have an Open-Source client available on all major desktop OSes such as Linux, Windows, macOS, iOS, Android and even FreeBSD (even tho it is the same as the Linux client).  
 ![](https://news.jae.moe/IMG/png/screenshot_2021-02-17_at_14.46.52.png?1613569623)

It is also noted that NextDNS can protect you from [CNAME Cloaking](https://medium.com/nextdns/cname-cloaking-the-dangerous-disguise-of-third-party-trackers-195205dc522a) and that the service offers hundreds of blocklists to choose from.

My favourite part of the service must be the 'analytics' tab which offers you an insight into your requests.  
 ![](https://news.jae.moe/IMG/png/screenshot_2021-02-17_at_14.54.04.png?1613570053)  
There, you can see your total number of queries, your top resolved and blocked domains, the devices that have sent the most requests, a map of where your requests are going and something called "GAFAM dominance" which is a graph of all requests made to the [GAFAM](https://en.wikipedia.org/wiki/Big_Tech)s.

In the end, NextDNS is a good service which I recommend using if you want to avoid being tracked on your mobile devices and have a rather clean web experience.
Be gone AWS access keys
Tags: aws, cloud, cdk
Published: 2021-02-24 11:33:28

Many people start with a single AWS account, start reading up, find examples, create a new user with too much access and then setup access keys. These keys stay in your AWS cli credential file and this might not be such a great idea.

It's actually pretty easy to fix this problem, AWS have been busy working on organizations and AWS SSO, these two services will help setup up some structure for us to build on and resolve long lived access keys.

> Both AWS organizations and AWS SSO are free!!

### Why should I care
Keys living in a plain text file that don't expire is generally a bad idea. Anyone who gets access to those keys can use them, if someone is trying to access your keys it's probably not to pay your AWS bill.  

Some more food for thought:
* Malware targeting credential files
* Developers committing credentials to a code repository

### How does it work you say?
Basically, AWS SSO comes with it's own user directory. You might be familiar with the IAM user directory? The SSO one is purely for SSO, you can creates and assign users to groups and permissions. 

If you have your own directory like Azure Active Directory you can also connect that up to AWS SSO and use that instead, which is pretty cool.

When you configure AWS SSO you'll also need to configure the AWS CLI (version 2). This will launch an authentication session via SSO and provide temporary credentials (1 hour) to your CLI session. Now, you'll have access to do what you need to do and if someone gets the keys (after your session has expired) they won't be any good. The next time your authenticate your keys will be updated and you'll be good to go.

### Regions
When you setup AWS SSO within your AWS organizations you're only allowed to have one AWS SSO globally. So you'll need to pick a region, if you do go to create an SSO instance and you have one already you'll be notified to remove the current one first before creating the new one in your region.

### Word of caution for CDK users
If you're a CDK fan just be aware, this is all doable but you'll need to implement a workaround to copy your version 1 cli temporary credentials into the old style version 1 credentials file as CDK doesn't support SSO just yet. There are heaps of open source fixes for this, some are pretty feature rich.

I'm using yawsso, so maybe check that one out. It's also pretty common to roll your own as it's basically just copying the creds from the ~/.aws/config to ~/.aws/credentials file.

### More information
This should be enough to get you thinking about using AWS SSO and migrating to a more structured approach. If you get stuck or want some additional information I have done a much longer write up on my blog for those interested:

https://www.talkncloud.com/aws-temporary-creds-sso-cdk/

If you are using AWS organizations and AWS SSO I'd be keen to hear your experience so far, any tips etc.
The requirement is to wrap the child app in a container to be used inside the parent app.
Tags: reactnative, react
Published: 2021-02-24 11:16:17

We have 2 independent react native applications, a parent and a child application. The requirement is to wrap the child app in a container to be used inside the parent app. The child app should be accessible from the parent app in such a way that the child app opens and operates inside the parent app without triggering a launch as a separate independent app as in the case of deep linking. 

Any suggestions?
we have already tried creating child application's tgz file and import it into parent but while child has any dependencies then it start creating issues.

Any help is much appreciated.. Thanks in advance
Deploy Anywhere Next.js app using SSG and Dynamic routing
Tags: react, nextjs, webdev, productivity
Published: 2021-02-24 10:50:25

SSG stands for Static Site Generation and Next.js recommend it officially. When I look at this term first, I thought "it generates just a simple HTML, I can deploy it anywhere". But that was a misunderstanding.

## I can't handle it as simple HTML

The reason is `<Link>` tag. If you click `<Link href-"about">about</Link>`, It navigates you to /about. **Not /about.html**. That's why In some cases, this routing resource may not be there if you didn't deploy it to so kindful infrastructure(for example Vercel). That's why if you reload this URL, you can't get any resources. No page is shown. In many cases, if you want to open this page directly, you should rewrite URL routing to `*.html`.

## rewrite for Dynamic routing

The above problem is solved if you write rewrite config. For example

```
/about -> /about.html
/me -> /me.html
```

But how do you write a dynamic HTML page's route config? NextJS can generate a page and URL at build time depends on some outer resources(for example API). The URL will be like `/user/1`, `/user/posts/1`, and so on. If you know all endpoints and data, you may be able to write all. But this is so hard and in many cases impossible.

## Naive Solutions

If you deploy to good infrastructure, they may provide some config to rewrite dynamic URL. For example netlify.toml, firebase functions, lambda and cloud front, amplify console and so on.

But this solution depends on your environment and a little difficult. How can I deploy it anywhere **easily**?

## Solution: Use trailingSlash config

The simple solution is just to use `trailingSlash ` in `next.config.js`.

```next.config.js
 trailingSlash: true,
```

https://nextjs.org/docs/api-reference/next.config.js/exportPathMap#adding-a-trailing-slash

That's all! This navigates to *.html when you click `Link`. Then you can treat your SSG site as a simple static website. You can deploy it anywhere.
I want to check if a user is signed on Angular
Tags: angular, typescript
Published: 2021-02-24 10:49:20

my view.ts
```
import {
  Component,
  OnInit,
  ViewChild,
  ElementRef,
  AfterViewInit,
  HostListener,
  Input
} from '@angular/core';
import { INavData } from "../../Models/navItem.model";

@Component({
  selector: 'app-home-navbar',
  templateUrl: './home-navbar.component.html',
  styleUrls: ['./home-navbar.component.scss'],
})
export class HomeNavbarComponent implements OnInit {
  user: any;

  isScrolled = false;

  constructor() {}

  @HostListener('window: scroll')
  onWindowScroll() {
    const scrollPosition = window.pageYOffset;
    if (scrollPosition >= 100) {
      this.isScrolled = true;
    } else {
      this.isScrolled = false;
    }
  }
  ngOnInit(): void {}
}
```

my navbar.ts
```
export interface INavAttributes {
  [propName: string]: any;
}
export interface INavWrapper {
  attributes: INavAttributes;
  element: string;
}
export interface INavBadge {
  text: string;
  variant: string;
  class?: string;
}
export interface INavLabel {
  class?: string;
  variant: string;
}
export interface User {
  email: string;
  id: number;
}
export interface INavLinkProps {
  queryParams?: {
      [k: string]: any;
  };
  fragment?: string;
  queryParamsHandling?: 'merge' | 'preserve' | '';
  preserveFragment?: boolean;
  skipLocationChange?: boolean;
  replaceUrl?: boolean;
  state?: {
      [k: string]: any;
  };
  routerLinkActiveOptions?: {
      exact: boolean;
  };
  routerLinkActive?: string | string[];
}

export interface INavData {
  user?: User;
  name?: string;
  role?: string;
  url?: string | any[];
  href?: string;
  icon?: string;
  badge?: INavBadge;
  title?: boolean;
  children?: INavData[];
  variant?: string;
  attributes?: INavAttributes;
  divider?: boolean;
  class?: string;
  label?: INavLabel;
  wrapper?: INavWrapper;
  linkProps?: INavLinkProps;
}
```

i am trying to import my navbar component to use for checking, but i'm pretty new to angular. any solution?
Introduction to Functional Programming 
Tags: javascript, functional, react
Published: 2021-02-24 10:46:50

In Functional Programing, we want express our whole program in terms of functions.
Functional Programing is Declarative. Which means we focus more on ** what to do ** instead of **How to do**

First lets understand why Functional Programming is so important.
Functional Programming enables us to 

- Write re-useable code.
- Debug easily.
- Read better.

>Functions are 1st Class Citizens
because functions can be :

- Assigned to variables.
- Can be added to objects and arrays as well .
- Sent to other functions as a argument.
- Can be Returned from other functions.

Let's get right into it.

**Non Functional Way**

```
let name = "Sayuri" ;
let message = "Hey, fellow devs, I am " ;
console.log(message + name)

---> Hey, fellow devs, I am Sayuri
``` 

**Functional Way**
```
function message(name) {
    return "Hey, fellow devs, I am " + name ;
}

message("Sayuri")

---> Hey, fellow devs, I am Sayuri
```

### --> Pure Functions

> A Pure Function is a function which,
Given the same input, will always return the same output.


A Pure Function :
- Takes in at least 1 parameter.
- Return Something (A value or a function).
- Does not mutates any arguments.

Not Pure 
```
let name = "Sayuri" ;

function message(){
    console.log("Hey, fellow devs, I am " + name )
} 
```

The above code is not pure because 

- --> It is not taking **name** as an parameter. 
- --> It's dealing with something in the global scope.
- --> Also it not having a **return** value.

Pure Functions have no *side effects* which means it cannot alter anything outside the function.

**Pure Function**
```
function message(name) {
   return "Hey, fellow devs, I am " + name
}
```

### Higher Order Function

> 
A higher order function is a function that takes a function as an argument, or returns a function or does both.

```
const greet = function takeName (name){
    return function message(msg){
        return msg  + name 
    }
}

greet("Sayuri ")("Hey, fellow devs, I am ")

--> Hey, fellow devs, I am Sayuri
```

### Immutable Code
Immutability means can't be changed.

**Mutation --> (Bad)**
```
const code= [ "Javascript", "Python", "React" ]
code[ 2 ] = "Node"
console.log(code)

--> [ "Javascript", "Node", "React" ]
```

**Immutation**
```
const code = [ "Javascript", "Python", "React" ]
const code2 = code.map(lang=> {
  if(lang=== 'Python') {
    lang= 'Node';
  }
  return lang;
});

console.log(code2)

--> [ "Javascript", "Node", "React" ]
```

Last but not the Least 
Do not Iterate using for or while/loops --> Use Map, Reduce, Filter etc. 

Let me your thoughts.
The Benefits of Backbone JS Which Every Web App Developer Must Know
Tags: javascript, webdev, devops
Published: 2021-02-24 10:33:14

It is amongst the most extensively used JavaScript libraries, which depend on MVP designer patterns. It is often considered a JavaScript framework; however, it happens to be a library that will enable you to create single-page apps. The main objective of this framework is to develop single-page apps.


Below, we have mentioned some well-known Backbone JS features that should be considered by you while developing an app.
 

1. It enables developers to create an application by making use of JavaScript functions. Apart from this, the HTML code of any application is updated by it automatically.

2. A free and open-source library, including more than 100 extensions, is provided by Backbone JS. It features a library that helps to separate business and user interface logic.

3. The data model consisting of user data can be managed by it, and this is displayed with the identical format, which is written at a client-side. Besides this, it also enables the developers to develop web and mobile apps in a proper format.

4. Backbone JS helps make sure that it is possible to perform the communication to the server entirely using a RESTful API. The web is likewise emphasizing that the content must be exposed utilizing an API.

 
When can you use Backbone JS?

The developers should make use of Backbone JS while developing a single-page Java application. Backbone JS features Model View Framework, which allows much more than structuring JavaScript architecture. It will help the developers eliminate several issues that they might be facing while developing apps.

Backbone JS will be employed when it is needed to minimize HTTP requests to servers. Also, it is used when you need to streamline complicated UI design.
 
Why we need Backbone JS?

While developing a single page app, the developers need to structure code to save time. Consequently, developers might begin to look for any MVC framework that happens to be a mature framework with a powerful community and documentation.

However, for what reason do you need a library such as Backbone JS? The developers might be required to confront several issues without Backbone. For example, it is quite difficult to structure large apps. Also, it is challenging to avoid data and views, and code data do not teach DOM.

 
Let's know here the Benefits of Backbone JS: https://www.rlogical.com/blog/the-benefits-of-backbone-js-which-every-web-app-developer-must-know/
Installing a Gemini pod
Tags: firstpost, gemini, docker, tutorial
Published: 2021-02-24 10:28:50

Greetings everyone, this is my first post on there and today, I'll tell you how to install a Gemini pod.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6ecl3ev4tg3nywgrwf7e.png)

[Gemini](https://gemini.circumlunar.space/) is a lightweight protocol made to be private and to be light.
Today, I'll teach you how to deploy your own server, named "pod" so you can brag about it online.

## Prerequisites
 - A brain
 - Some time (20 minutes maximum)
 - A server (dedicated, VPS, magical potato)
 - A domain pointed to that server
 - Basics in Docker
 - Something that tastes good to drink as a reward after

## Starting up
For simplicity reasons, we will use [docker-compose](https://docs.docker.com/compose/).
As for the server image, we will use [adrianhesketh/gemini](https://github.com/a-h/gemini).

Create a `docker-compose.yml` file containing:
```yaml
version: '2.1'
services:
  gemini:
    image: adrianhesketh/gemini:latest
    ports:
      - 1965:1965
    environment:
      - PORT=1965
      - DOMAIN
    volumes:
      - ./certs:/certs
      - ./content:/content
```

In order to contain the domain, create a `.env` file containing:
```
DOMAIN=my-domain.tld
```

Now, let's create the required directories by doing `mkdir {certs,content}` and move on by generating the certificates.
Navigate in the 'certs' directory using `cd certs` and generate the SSL certificates using:
```bash
openssl ecparam -genkey -name secp384r1 -out server.key
openssl req -new -x509 -sha256 -key server.key -out server.crt -days 3650
```

> Note: you can use SSL certificates from Let's Encrypt, Zerossl or any other source if you wish.

Now, return to the root (where the docker-compose.yml is) and edit the file `content/index.gmi`.
Put inside:
```gmi
# Hello world!
## This is my Gemini Pod~
```

Now, all you have to do left is to execute `docker-compose up -d` to start your server.
After booting it up, navigate to your domain using a [Gemini browser](https://github.com/kr1sp1n/awesome-gemini) and you should see a nice page saying "Hello world!".

Congratulations, you have now your own Gemini pod, you can now drink whatever you prepared earlier!
You can learn more about the page syntax of Gemini by going on their [official website](https://gemini.circumlunar.space/docs/gemtext.gmi).

[Original article on my blog!](https://news.jae.moe/Installing-your-own-Gemini-pod.html).
Apple Cider Vinegar: Benefits, Side Effects, Dosage | Why Should You Use Apple Cider Vinegar? | iLeaf Naturals
Published: 2021-02-24 10:24:38

Apple juice vinegar is aged juice from squashed apples. Like squeezed apple, apple juice vinegar may contain different nutrients and minerals, just as dietary fiber. Apple juice vinegar may likewise contain acidic corrosive and citrus extract. Yet, it very well may be difficult to know precisely what's in some apple juice vinegar items. In the U.S., there's no genuine meaning of what an item should contain to be called apple juice vinegar. Therefore, the measure of every part of apple juice vinegar may shift from item to item.

Apple juice vinegar is utilized for weight, diabetes, issues identified with hair and skin, and different conditions, however, there is nothing but bad logical proof to help these employments.

How does it work?

Apple juice vinegar is the matured juice of squashed apples. It contains acidic corrosive and supplements, for example, B nutrients and nutrients C. Apple juice vinegar may help lower glucose levels in individuals with diabetes by changing how nourishments get assimilated from the gut. Apple juice vinegar may forestall the breakdown of certain nourishments.

Proven Effectiveness of Apple Cider Vinegar

- Natural Detox
- Metabolism Boost
- Thermogenic Fat Burning
- Immune Support
- Appetite Reduction
- Weight Loss Management
- Enhance Skin Clarity

<a href="https://ileafnaturals.com/product/apple-cider-vinegar/">Buy Apple Cider Vinegar Supplements For Weight Loss</a> | <a href="https://ileafnaturals.com/product/ashwagandha-root/">Online Buy Ashwagandha Root Powder For Hair Growth</a>
Decentralized Perpetual Trading Platform YFX starts Genesis Mining
Tags: blockchain
Published: 2021-02-24 10:22:06

Decentralized Perpetual Trading Platform YFX starts Genesis Mining

YFX, the first DEX that offers 100x trading leverage on perpetual contracts has just announced YFX token distribution plan. Anyone can participate genesis mining to get rewards of YFX token on Binance Smart Chain, Huobi Heco Chain and TRON.

The genesis mining including three events: trade mining, liquidity mining and trading competition. Each event has its own YFX token pool. When user trade or provide liquidity on yfx.com, he or she will receive Hash Power according to the dollar value of the position. YFX token will be distributed after the events end according to the accumulated Hash Power. here is no public sale of YFX token. All YFX token offer to the public will through these mining events.

The distribution of YFX is the first step YFX enter DAO. YFX token gives voting power to decided key parameters on YFX. It also enables future development work from team outside core development team, it can make sure when new technics came out, YFX could catch up with the trend to evolve by itself.

YFX uses QIC-AMM and a system de-risk mechanism to migrate perpetual futures trading from CEX to DEX without reducing the trading leverage, which makes YFX the first DEX that could offer 100x leverage on a perpetual contract. You can do everything on YFX that you can do on BitMex or OKEx. YFX is poised to compete directly against established centralized exchanges. YFX runs on Binance Smart Chain, Huobi Heco Chain and TRON, for faster transaction times and cheaper gas fees compared to Ethereum. The YFX team is also working on Ethereum’s Layer 2 solution to provide pragmatic perpetual trading on DEX.

About YFX

YFX is the first DEX that offers 100x trading leverage on perpetual contract. YFX Descartes V1 launched on Binance Smart Chain, Huobi Heco Chain and TRON, and all trades are held and processed by smart contracts. The main goal of the YFX team, which is formed by a group of engineers who have years of experience working on trading systems and blockchain, is to build a DEX that can compete with CEX on derivative trading.



Reference:

Website: https://www.yfx.com/

Twitter: https://twitter.com/YFX_Defi

Telegram: https://t.me/YFX_EN

Discord: https://discord.gg/xwAtjpabC5

Media Contact: media@yfx.com