teleren/devto huggingface dataset:
Daily Challenge #307 - Spanish Conjugator
Tags: challenge
Published: 2020-11-12 15:05:04

---
title: Daily Challenge #307 - Spanish Conjugator
published: true
series: Daily Challenge
description: Write a function that will return the Spanish conjugations of verbs.
tags: challenge
//cover_image: https://direct_url_to_image.jpg
---

In Spanish, verbs change according to the person we're talking about. Something similar happens in English when we use the third person singular pronouns he/she: 
```
I run
You run
He/She runs
```

Spanish is similar, the suffix changes depending on who we're talking about. Your task is to write a function called **conjugate** which will return a Spanish verb in all of its conjugations. 

###Examples
`conjugate(comer)`
`["como", "comes", "come", "comemos", "coméis", "comen"]`

`conjugate(vivir)`
`["vivo", "vives", "vive", "vivimos", "vivís", "viven"]`

###Tests
`conjugate(comer)`
`conjugate(bailar)`
`conjugate(caminar)`

Good luck!

***
_This [challenge](https://www.codewars.com/kata/5a81b78d4a6b344638000183) comes from Phares on CodeWars. Thank you to [CodeWars](<https://codewars.com/>), who has licensed redistribution of this challenge under the [2-Clause BSD License](<https://opensource.org/licenses/BSD-2-Clause>)!_

_Want to propose a challenge idea for a future post?  Email **yo+challenge@dev.to** with your suggestions!_
How do you test data pipelines? 🤔
Tags: discuss, data, datascience
Published: 2020-11-12 15:01:33

---
title: How do you test data pipelines? 🤔
published: true
description: Let us know what techniques you use to test your data pipelines.
tags: discuss, data, datascience
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/8hfrgms20u10xcdi047r.png
---


How do you test your Data Pipelines?
Should Data Pipelines be tested?
Do you test in a CI System?
How to Create a data-attribute in Vanilla JS tabs?
Tags: javascript, tabs
Published: 2020-11-12 14:58:38

Hello Programmer,
I have a little Problem. I created tabs with a vanilla JavaScript. I want to call the tabs through data-attributed. But I do not understand how to do.
Here is the link
[Codepen](https://codepen.io/shakibdshy/pen/GRqXaYV)
[jsfiddle](https://jsfiddle.net/shakibdshy/9rmt1jv7/3/)

Thank You
Working on the "Ramda Ramp-Up Guide"
Tags: javascript, ramda, functional
Published: 2020-11-12 14:51:00

---
title: Working on the "Ramda Ramp-Up Guide"
published: true
description: RFC - I'm working on a small-book-length ramda guide
tags: js, ramda, fp
//cover_image: https://direct_url_to_image.jpg
---

Hi, folks!

After using [ramda](https://ramdajs.com) since early 2016 and individually helping so many people level up their functional programming in JS, I've decided to write down all the things at https://ramda.guide. This is a **work in progress**, and I need you to help guide some of the learning.

This **opinionated** guide will cover topics from beginner to advanced skill levels, as well as best practices learned from using ramda at scale in production since 2016. There will also be interactive examples as you learn!

Where do you come in? Answer any of the following in the comments!

* What were your biggest pain points with learning ramda?
* What things do you still not quite understand?
* What would you like to see in a guide?
* How and where do you use ramda?
* What else would you like to say on the subject?

**If you want to help me further, sign up for updates on https://ramda.guide to get updates about when new content is published** (there are also RSS and Atom feeds). This will also help me gauge interest and inspire me to get it done! Content will of course be cross-posted to the https://dev.to community, too.

<3,
Robert W. Pearce
Laravel Breeze - Minimalistic Authentication  Scaffolding  
Tags: laravel, authentication
Published: 2020-11-12 14:11:13

[Laravel Breeze](https://github.com/laravel/breeze) was released by Taylor Otwell and the Laravel team a few days ago: 

{% twitter 1325890243493556224 %}

I was one of the very few who wasn't so tripped with [Jetstream](https://github.com/laravel/jetstream) for authentication scaffolding with the release of Laravel 8. I prefer using only [Larvel Fortify](https://github.com/laravel/fortify) and then build my own UI components around it. 

### Breeze?

According to the Github docs 

> Breeze provides a minimal and simple starting point for building a Laravel application with authentication. Styled with Tailwind, Breeze publishes authentication controllers and views to your application that can be easily customized based on your own application's needs.

This package can be said to be a lightweight simpler version of [laravel/ui](https://github.com/laravel/breeze) but uses Tailwind instead of Bootstrap. It has no presets like React or Vue, although that is subject to change in the future.

To get started with the package:

```php
laravel new breeze-auth
cd breeze-auth
```

Next, we require the breeze library and run the install commands

```php
composer require laravel/breeze --dev
php artisan breeze:install
npm run install
npm run dev
```
Run the migrate command and serve up the project and we should have our application enabled with authentication.

![FireShot Capture 109 - Laravel - localhost](https://dev-to-uploads.s3.amazonaws.com/i/omigi84h495ocho9gjgr.png)

It's that simple to use!
Deployed a Advance Storage on XinFin XDC Network.
Tags: blockchain, solidity, xdc, xinfin
Published: 2020-11-12 14:10:19

created a #SmartContract in Solidity language for a Advance storage, and successfully deployed on XinFin XDC Network under the injected web 3 environment.
Check the code: 

`pragma solidity >=0.5.0;
contract AdvancedContracts {
    uint[] ids;
    function add(uint id) public {
        ids.push(id);
    }
    function get(uint position) public view returns(uint) {
        return ids[position];
    }
    function getall() public view returns(uint[] memory) {
        return ids;
    }
    function length() public view returns(uint) {
        return ids.length;
    }
}`
Solving Perl Weekly Challenge 086
Tags: raku
Published: 2020-11-12 14:08:29

---
tags: raku
title: Solving Perl Weekly Challenge 086
published: true
---

Here comes the [Perl Weekly Challenge 086](https://perlweeklychallenge.org/blog/perl-weekly-challenge-086/).

## TASK #1 › Pair Difference

    You are given an array of integers @N and an integer $A.
    
    Write a script to find find if there exists a pair of elements in the
    array whose difference is $A.

    Print 1 if exists otherwise 0.

A naive, brute-force solution is take the pairwise differece of all numbers and check whethery any one of them is equal to `$A`.

```raku
@N.combinations(2).first(-> @combo { $A == abs([-] @combo) });
```

Which is an algorithm with time complexity of O(n²). If we store the position of each number in a HashMap, we could improve it to be O(n) in both time and space.

```raku
my %pos;
@N.kv.map(-> $k, $v { %pos{$v}.push($k) });
@N.first(
    -> $n {
        %pos{$n + $A}:exists or %pos{$n - $A}:exists
    });
```

The adverb syntax of [`:exists`](https://docs.raku.org/language/subscripts#index-entry-:exists_(subscript_adverb)) in Raku looks special to me. It makes sense though, if we design it to be `%H{$x}.exists()` or `exists(%H{$x})`, then it would look as if we are asking if the value of `%H{$x}` exists, rather than asking the container `%H`.

## TASK #2 › Sudoku Puzzle

I just happened to have a spare sudoku solver in my 'bin/' directory: [sudoku-solutions.raku](https://github.com/gugod/bin/blob/master/sudoku-solutions.raku).

----

本文為《[解 Perl Weekly Challenge 086](https://gugod.org/2020/11/pwc-086/)》之英文版。
Using Promises as a queue
Tags: javascript, promises, queue, async
Published: 2020-11-12 13:56:20

Promises in JavaScript are a very powerful tool, and there are a lot of applications that we never think of in the first place. One of them is to use Promises as a queue.

Let’s imagine you want to execute a number of asynchronous operations in order, one after another. If you know the operations in advance, your code will look like this:

```js
await operation1()
await operation2()
await operation3()
```

But what if you have an arbitrary number of operations to run? And if each of them can trigger more? Then you need a queuing system.

If we come back to the previous case, we could also have written it this way:

```js
operation1()
  .then(operation2)
  .then(operation3)
```

Which translates in pseudo code to

```js
Promise
  .then(FunctionReturningPromise)
  .then(FunctionReturningPromise)
```

Then, queuing an operation would be as easy as this:

```js
add(operation) {
  queue.then(operation)
}
```

Unfortunately, with this implementation, you will always execute your `.then` on the same promise. We need to keep track of what is the last element:

```js
add(operation) {
  queue = queue.then(operation)
}
```

The code is still very wrong, because if one operation throws, the queue will stop. For instance, in this code, ‘second message’ will never appear on your screen:

```js
Promise
  .resolve()
  .then(() => console.log(‘first message’))
  .then(() => { throw new Error(an error) })
  .then(() => console.log(‘second message’))
```

One way to avoid this is to add a catch statement after every `.then`:

```js
add(operation) {
  queue = queue.then(operation).catch(() => {
    // do whatever, log the error?
  })
}
```

Now it’s better; we still need to initialise the queue though. A very easy way to do this is to actually generate a Promise that is already resolved:

```js
queue = Promise.resolve()
```

This gives us a complete implementation here:

```js
class PromiseQueue {
  queue = Promise.resolve()

  add(operation) {
    this.queue = this.queue.then(operation).catch(() => {})
  }
}
```

Drawback: with this simple implementation, you don’t get feedback on whether or not your operation succeeded in the code where you add the operation to the queue. You could also implement `add` so that it returns a promise that resolves once this specific operation has resolved (so you can get the feedback). This should do the trick:

```js
class PromiseQueue {
  queue = Promise.resolve(true)

  add(operation) {
    return new Promise((resolve, reject) => {
      this.queue = this.queue
        .then(operation)
        .then(resolve)
        .catch(reject)
    })
  }
}
```
Quickly ignore .DS_Store files globally
Tags: git, macos, gitignore
Published: 2020-11-12 13:50:46


A global `.gitignore` file is a very useful thing - if you  use one. Personally i didn't, until recently. But there is one special file that allways bothered me in my workflow: `.DS_Store`
For this post, it doesn't matter what these files are or why they exist. What matters is that these small files are annoying because they are often created and committed without notice.

So here's a quick one-line command solution for anyone, who doesn't use a global `.gitignore` yet.* 

#### TL:DR
```sh
git config --global core.excludesfile "~/.gitignore" &&  echo .DS_Store >> ~/.gitignore
```

#### Explanation
This command
- configures the path to a global exclude file (we'll just call it `.gitignore`, but it could also be *.global_gitignore* or somehting else) to the home directory (`~/`), where your global `.gitconfig` usually resides too.
-  then this new `.gitignore` file is created in your home folder (if it doesn't already exists) and a new line with `.DS_Store` is appended.



*If you are already using a global .gitignore, i'll assume that you are already ignoring these type of files globally. If not - please do so, as it should not be necessary to ignore these an a per project basis.


Heres a quick [gist](https://gist.github.com/lpheller/5d977e0108464f03c42d46b2b0cd64ca) if you want to bookmark this command.
Now, you don't have to think twice before sharing some confidential data (file or message).
Tags: note, privatenote, file, privnote
Published: 2020-11-12 13:32:59

---
title: Now, you don't have to think twice before sharing some confidential data (file or message).
published: true
description: Share a confidential note via a web link that will self-destruct after it is read by your intended recipient.
tags: note, privatenote, file, privnote
//cover_image: https://direct_url_to_image.jpg
---
[Safenote](https://safenote.co/) is the free, fast, and secure way to share files and notes with end-to-end encryption and a link that expires automatically. And also it's a free cloud-based service that is functioning via an encrypted SSL tunnel. Safenote doesn't require you to create an account before start using the service and no password or email required. This free service enables you to send a self-destructing message or file to someone. This means once they view the message or download the file, they will no longer be able to access it again.

And the API will help you to share files and notes programmatically. Integrate it with your website/system when you want to share some data with your users.

https://safenote.co/
Never Underestimate The Power of Passive Online Income
Tags: digitalmarketing, writing, education, youtube
Published: 2020-11-15 18:52:57

---
title: Never Underestimate The Power of Passive Online Income
published: true
date: 2020-11-12 13:12:00 UTC
tags: digitalmarketing,writing,education,youtube
canonical_url: https://medium.com/age-of-awareness/never-underestimate-the-power-of-passive-online-income-5b16cfd41906
---

[![](https://cdn-images-1.medium.com/max/1920/1*fT61sjcznDe7x3nHO7if8g.jpeg)](https://medium.com/age-of-awareness/never-underestimate-the-power-of-passive-online-income-5b16cfd41906?source=rss-8f1b0c5dd7cc------2)

Use these 4 pillars of passive online income — and potentially earn while you sleep

[Continue reading on Age of Awareness »](https://medium.com/age-of-awareness/never-underestimate-the-power-of-passive-online-income-5b16cfd41906?source=rss-8f1b0c5dd7cc------2)
MySQL Database connection from NodeJs application
Tags: node, mysql, database
Published: 2020-11-12 13:07:25

---
title: MySQL Database connection from NodeJs application
published: true
description: Using MySQL With Node.js
tags: node, mysql, database
//cover_image: https://direct_url_to_image.jpg
---

Step 1: install MySql using this command `npm install mysql`
Step 2: Import `var mysql = require('mysql')` into **index.js** file

For connecting with DB write here bellow configuration. 
```
var DatabaseConnectionConfig = {
    host: 'localhost',
    user: 'root',
    password: ''
}
```
Using **createConnection** method pass **DatabaseConnectionConfig** value. Then create a connection. 

After running this connection. Then call to **connect** method. Also check connection connect or not. That's why give a **callback** function and pass a **error** parameter. 
```
var con = mysql.createConnection(DatabaseConnectionConfig)

con.connect(function(error){
    if(error){
        console.log('Node DB Connection Failed!')
    }else{
        console.log('Node DB Connection Success!')
    }
})
```

Create a DB like `nodemysql` and update bellow property. 
```
var DatabaseConnectionConfig = {
    host: 'localhost',
    user: 'root',
    password: '',
    database: 'nodemysql'
}
```
**index.js** file final view

```
var mysql = require('mysql')

var DatabaseConnectionConfig = {
    host: 'localhost',
    user: 'root',
    password: '',
    database: 'school'
}

var con = mysql.createConnection(DatabaseConnectionConfig)

con.connect(function(error){
    if(error){
        console.log('Node DB Connection Failed!')
    }else{
        console.log('Node DB Connection Success!')
    }
})
```

Run into terminal using this command. `node index.js`

**Output**

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ke4oqyvffwuec71vyt53.PNG)
Daily Developer Jokes - Thursday, Nov 12, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-11-12 13:00:01

---
title: "Daily Developer Jokes - Thursday, Nov 12, 2020"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Thursday%2C%20Nov%2012%2C%202020"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e12592cb43a5.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q:___ What did the Class say in court when put on trial?

___A:___ I strongly object!
 -->
Platform game engine I'M MAKING FOR THIS GAME
Tags: codepen
Published: 2020-11-12 12:30:28

<p>A simple platform game engine, the map is customisable and scriptable. Refer to the comments in the "map" variable for instructions.</p>

<p>I plan to expand the engine in the future, the ability to use images for tiles and the player is one thing that I have in mind. Any suggestions are welcome.</p>

{% codepen https://codepen.io/dissimulate/pen/CqIxk %}
Tower Blocks
Tags: codepen
Published: 2020-11-12 12:25:34

<p>Tower building game. Place blocks by clicking, tapping or spacebarring. </p>

<p>A clone of Stack <a href="https://itunes.apple.com/us/app/stack/id1080487957?mt=8" target="_blank">https://itunes.apple.com/us/app/stack/id1080487957?mt=8</a></p>

{% codepen https://codepen.io/ste-vg/pen/ppLQNW %}
Extending Express' Types with TypeScript Declaration Merging - TypeScript 4
Tags: typescript, express, javascript, node
Published: 2020-11-12 12:20:43

TypeScript is evolving fast (as are a lot of tools in the Open Source space, gladly!)... but this means that what worked in a previous version may not work the same any more in the next major release. This happened to me in this case with TypeScript 4 and declaration merging.

There are good articles out there (like [this one](https://dev.to/kwabenberko/extend-express-s-request-object-with-typescript-declaration-merging-1nn5), thanks, [Kwabena](https://dev.to/kwabenberko)!), but it's slightly different in TypeScript 4 (and with modern [typescript-eslint](https://github.com/typescript-eslint/typescript-eslint) rules).

Sounds like your issue? Read on (or jump straight to the code example below).

To keep it simple, let's imagine we have some middleware (e.g. [passport](http://www.passportjs.org/)) that makes the current user available on each request, in the form of a `userId` (which may be of type `string`).

On some route or other middleware, we now want to access the `userId` like this:

```typescript
app.get("/some-route", (req: Request, res: Response) => {
  res.send("Hello, world! Your userId is " + (req.userId || "not available"));
});
```

TypeScript won't be happy with this, though. We will get an error like this:

```
Property 'userId' does not exist on type 'Request<ParamsDictionary, any, any, ParsedQs>'.ts(2339)
```

We need to tell the `Request` interface that there is a `userId` property. But how?

The TypeScript 3 way of solving this (using `declare global`) may still work, but it would give me a warning, due to an [eslint rule](https://github.com/typescript-eslint/typescript-eslint/blob/v4.6.0/packages/eslint-plugin/docs/rules/no-namespace.md), which basically states that `declare global` is the old and outdated way.

The new way is to use `declare module`. In our example we can therefore introduce the `userId` to Express' `Request` type like this:

```typescript
declare module "express-serve-static-core" {
  interface Request {
    userId?: string;
  }
}
```

... and voila, the warning is gone, and (more importantly) type safety through TypeScript is restored.

(It isn't overly intuitive that the `Request` type must be extended in the module `express-serve-static-core`...)

Now, what if you add a field to the session (assuming you are using [express-ession](https://github.com/expressjs/session#readme))? The additional field needs to be declared for the `Session` type, inside the `express-session` module, like this:

```typescript
declare module "express-session" {
  interface Session {
    someSessionVar: string;
  }
}
```
hacktoberfest 2020
Tags: hacktoberfest
Published: 2020-11-12 12:15:01

<!-- ✨This template is only meant to get your ideas going, so please feel free to write your own title, structure, and words! ✨ -->


### [Intro Heading]
Hi, I'm Hakim Setyobudi
<!-- If you are new to the DEV community, introduce yourself and share a bit about why you joined DEV and decided to participate in Hacktoberfest this year.  --> 
### Background
I'm new user at dev.to
<!-- Are you brand new to open source? What about coding in general? Tell us about how you got here →

### Progress

<!-- Share a bit about where you’re at in your Hacktoberfest journey. What stage are you at? How has the process been?  -->

### Contributions
https://github.com/EbookFoundation/free-programming-books/pull/4701
https://github.com/wrideveloper/gitting-started-2020/pull/63
https://github.com/EbookFoundation/free-programming-books/pull/4728
https://github.com/EbookFoundation/free-programming-books/pull/4751
<!-- This is where you can list the contributions you made and explain why you chose the projects you did. Don’t forget to add links!  -->


### Reflections
<!-- Overall, how has your Hacktoberfest 2020 experience been? If you’re a first-timer, will you participate again? What have you learned? Have you made any interesting connections? What is your next step in open source?  -->

This is my first time to contribute at Hacktoberfest, lets hacking
NO MORE MEDIA QUERIES
Tags: css, beginners, opensource
Published: 2020-11-12 12:02:41

Just imagine you get a css library that give you freedom from writing media queries in css file.

Intelligently it take care of your user interface in different devices with different sizes. You need not to worry anymore how your UI will look in potrait, landscape, small phone or smart tv etc

xp.css does everything you need for your app. Compatible with all morden browser, it does what it says.

Give a try and request to join our team. It's open-source.

You can find more details and demo here.
{% link https://dev.to/manishfoodtechs/introducing-xtra-power-css-device-size-no-more-a-challenge-1cp1 %}