teleren/devto huggingface dataset:
You should create a Brag Document.
Tags: career, mentalhealth
Published: 2020-01-24 16:49:38

#What's a Brag Document? 

Julia Evans explains it in her [post](https://jvns.ca/blog/brag-documents/): **Get your work recognized.**

We tend to forget the things we accomplish, the work we've done a few months ago, even that small API feature that you don't remember how you went about it matters. Why?

Because Impostor Syndrome is strong in our industry and this is a way for us to look it straight in the face and say: 'Not today.'


#So how does it work?

You essentially create a text document in your favorite app and start writing! What worked for me is to follow a template (which will be at the end of the post).

The goal of the Brag Document is to list any work that you want to remember further along the year, in a daily or weekly basis, whatever works for you! It can be some code you've written, a nice post that helped you understand a concept, or just something like 'I wrote a nice code review and helped someone'! 

And if your organization does performance reviews, this can help on having a clear picture of your progress so far. If they don't, then you can measure your own progress ;)

>_Motivation is to keep track of my daily work on my career in which I can later reflect upon it. Also, avoiding the feeling of fuzziness when looking back on my previous accomplishments._ 

[Source: github repo of this document](https://github.com/lucasgdiez/brag-document)


#Example!
I would like to leave my document as an example and encouragement for you to start your own! I personally follow a template I've created myself and I've been writing on it on a daily basis, since I've discovered that's what works best for me. 

Here's the link http://tiny.cc/brag-document, this will take you to the Notion page.


###Inside the link you'll find:

* The public Notion document in which I track my progress. This gets updated daily.
* A template to copy/modify to suit your needs.
* Milestones achieved.
* Useful links that help me become a better software developer.



And remember!

>What gets measured, gets improved. - _Chris Do_



Thanks for reading!
SumAllRange
Tags: replit, node
Published: 2020-01-24 16:36:04

---
title: SumAllRange
published: true
tags: replit, nodejs
---

function sumAll(arr) {
var a = arr[0]; var  b =arr[1];
var n = (a+b+a+b); 
var p = (a+b); 
for(let i=0; i<arr.length;i++){
  if(p<=5){
   arr = n;
  }if(p>10){
    arr = p+n;
  }
    console.log(arr)
  return arr;
}
}
sumAll([1, 4]);

{% replit @oscarhernandez6/SumAllRange %}?signin=true
そのContext呼び出しはProvider以下にあると保証できますか？
Tags: javascript, typescript, react
Published: 2020-01-24 16:31:49

# はい

reactのcontextは便利です。Reduxキラーとして君臨し、多くの開発者を苦しめてきました。特にhooksが登場してからというもの、`useContext()`によりその利便性はさらに高くなりました。

```js
const {data} = useContext(DataContext);
```
あるいは
```jsx
<DataContext.Consumer>
    {({data}) => /* render something */}
</DataContext.Consumer>

```

さて、このとき`DataContext.Provider`以下でこれらが呼び出されることを保証できるでしょうか？結論から言うとできません。TypeScriptにおいても同様です（そりゃそうだ）
ちなみに、ProviderがなければcreateContextのデフォルト値がそのまま利用できます。

```tsx
const DataContext = createContext({ hai: "haijanaiga" } as
    {
        hai: string
    });

export default App: React.FC = () => {
  const data = useContext(DataContext);
  return <h1>{data.hai}</h1>;
}; // its equally `<h1>haijanaiga</h1>`

```

しかし、たいていの場合において`<Context.Consumer />`および`useContext()`はProvider以下で呼びたいことが殆どでしょう。
しかし、Reactはこのときエラーになってくれません。デフォルト値が存在するためです。
また、ほとんどの場合開発時にのみ問題になりうるものですから、そのときにエラーになってくれればよいものです。すると、次のようなコードを書くことになるでしょう…


```tsx
type SomeContextType = {
    hai: string
}

const DataContext = createContext(undefined as undefined | SomeContextType);

const DataProvider = DataContext.Provider;

const useDataCtx = (): SomeContextType | never => {
    const ctx = useContext(DataContext);
    if (!ctx) throw new Error("Not children of DataContext.Provider")
    return ctx;
}
```

このとき、`<DataProvider state={{hai: ""}}>`がない状態で`useDataCtx()`が呼び出されても、適正にエラーが送出されるため、健全性が高まると言えます。
あるいは、非同期処理を利用などの理由でわざと`undefined`を挿入しているとしても、`if (typeof ctx === "undefined")`などで代替し、読み込みの状態については`null`を注入することもできます。もっとも、nullを注入するような行為は健全性に欠けますが…
単純に考えましょう。読み込み中であるstateたとえば`{suspending: true}`をProviderに注入する方法が効きます。

ところであなたのContextは健全ですか？
Hot Restart available in Uno Platform
Tags: news, xamarin
Published: 2020-02-19 18:22:23

---
title: Hot Restart available in Uno Platform
published: true
date: 2020-01-24 16:30:59 UTC
tags: News,Xamarin
canonical_url: https://platform.uno/hot-restart-available-in-uno-platform/
---

With the release of Visual Studio 16.5 Preview 2, [Microsoft and the Xamarin.iOS team released a preview of the Hot Restart feature.](https://devblogs.microsoft.com/xamarin/visual-studio-2019-version-16-5-preview-2/)

This provides a way for Xamarin developers to create and debug Xamarin.iOS applications using a physical device using only a Windows machine, where a mac used to be required. This make the developer loop a lot shorter when deploying on a device.

As a reminder, Uno Platform relies on Xamarin ‘classic’ ([see architecture diagram](https://platform.uno/how-it-works/) and how Uno works) to deliver your UWP/WinUI apps to mobile – iOS and Android. Therefore, any advancement in Xamarin.Android or Xamarin.iOS can be easily inherited by Uno as well.

With some simple modifications, it’s possible to develop an Uno Platform app on iOS, using both Xamarin.iOS hot restart **and** Uno Platform XAML Hot Reload **.**

To use this feature in your app, all you’ll need is to modify your main.cs file in the iOS project head to look like the following:

 

```
public class Application{ // This is the main entry point of the application.  static void Main(string[] args)  {  // if you want to use a different Application Delegate class from "AppDelegate"  // you can specify it here.  UIApplication.Main(args, null, typeof(App));  } }  #if DEBUG public class HotRestartDelegate : Xamarin.Forms.Platform.iOS.FormsApplicationDelegate {  public override bool FinishedLaunching(UIApplication uiApplication, NSDictionary launchOptions)  {  Windows.UI.Xaml.Application.Start(\_ => new App());  return base.FinishedLaunching(uiApplication, launchOptions);  } } #endif
```

 

 

You’ll also need to install the [Xamarin.Forms nuget package](https://www.nuget.org/packages/Xamarin.Forms) for the added class to run properly. Head to the [Microsoft docs on Xamarin Hot Restart](https://aka.ms/hotrestart-doc) to get started!

 

**In Closing**

If you are new to the Uno Platform, you may want to run through the [Getting Started tutorial](https://platform.uno/docs/articles/getting-started-tutorial-1.html). This will ensure you have the correct environment set up and that you have the latest release of Uno. If you have already worked with Uno, you may want to update your Uno package via your Visual Studio NuGet package manager.

 

 

 

 

 

The post [Hot Restart available in Uno Platform](https://platform.uno/hot-restart-available-in-uno-platform/) appeared first on [Uno Platform](https://platform.uno).
Bongo Pagination
Tags: go, mongodb
Published: 2020-01-24 16:26:05

---
title: Bongo Pagination
published: true
description: 
tags: go, mongodb
---

In our previous article, we made a collection with bongo.

If you haven't read it, you can look here [Make the collection find using Go bongo](https://dev.to/yasaricli/make-the-collection-find-using-go-bongo-3h3o)

Now we will paginate our query.

we continue the connection in the same way

* Perpage 20
* Active Page 1 

```go
package main

import (
  "log"

  "github.com/globalsign/mgo/bson"
  "github.com/go-bongo/bongo"
)

type User struct {
  bongo.DocumentBase `bson:",inline"`
  Username          string
}


func main() {

  // Bongo Connection Config
  config := &bongo.Config{
    ConnectionString: "localhost",
    Database:         "test",
  }

  connection, err := bongo.Connect(config)

  if err != nil {
    log.Fatal(err)
  }

  result := connection.Collection("users").Find(bson.M{})

  // Perpage = 20, activePage = 1
  info, _ := result.Paginate(20, 1)

  users := make([]User, info.RecordsOnPage)

  for i := 0; i < info.RecordsOnPage; i++ {
    _ = result.Next(&users[i])
  }

  
  log.Println(users)
}
```
Does anyone know how the google sign in prompt works from a technical standpoint?
Tags: security, android, webdev, javascript
Published: 2020-01-24 16:15:36

Hello, I've been wondering for a while how Google has managed to make the little sign in prompt that asks if you want to sign in or not appear on your android when you're trying to sign in via the log-in on your PC. Does anyone know how it works?
Need your feedback on a react project
Tags: react, typescript, redux
Published: 2020-01-24 15:40:10

Hi!
I need some feedback on a project I have been working on, please.
- the topic is a library with 2 views
- the tech stack is React redux and typescript

the project is available at: https://github.com/sandraDEVswift/LibrayBooks

I need your feedback about :
- code quality
- what can I improve
- suggestions to make the code more modular
- etc


Thanks a lot in advance
FontAwesome support in DEV.to?
Tags: help
Published: 2020-01-24 14:14:57

:eyes: Wondering if there is support for fontawesome to do things like:

```html
<i class="fa fa-quote-left fa-3x fa-pull-left fa-border"></i>Hi FontAwesome
```

<i class="fa fa-quote-left fa-3x fa-pull-left fa-border"></i>Hi FontAwesome

Thanks :metal:
2 ways to merge Python dictionaries
Tags: python, tutorial
Published: 2020-01-24 15:23:23

There are basically two ways of merging two or more dictionaries in Python.

If you search randomly on the internet, you may find other approaches, but they are either inefficient computation-wise or just bad practices.

##How to do it before Python 3.5##

If you are using Python 2 or any version bellow Python 3.5, you have to use a two-step approach using the copy() and update() functions.

```python
#initialize first dict
four_or_more_world_cups = {'Brazil': 5, 'Italy': 4, 'Germany': 4}

#initialize second dict
two_world_cups = {'Argentina':2, 'France':2, 'Uruguay': 2}

#copy first dict to a new third dict
top_six_world_cup_winners = two_world_cups.copy()

#update third dict with the second dict
top_six_world_cup_winners.update(four_or_more_world_cups)

print(top_six_world_cup_winners)
#output:
{'Brazil': 5, 'Germany': 4, 'Uruguay': 2, 'Italy': 4, 'Argentina': 2, 'France': 2}
```

##Python 3.5 and beyond##

As of Python 3.5, the merging notation is greatly simplified and the whole thing can be done in a single command.

```python
#initialize first dict
four_or_more_world_cups = {'Brazil': 5, 'Italy': 4, 'Germany': 4}

#initialize second dict
two_world_cups = {'Argentina':2, 'France':2, 'Uruguay': 2}

#merging dicts in a third dict
top_six_world_cup_winners = {**two_world_cups, **four_or_more_world_cups}

print(top_six_world_cup_winners)
#output:
{'Argentina': 2, 'France': 2, 'Uruguay': 2, 'Brazil': 5, 'Italy': 4, 'Germany': 4}
```

That's it! If you want to know more about Python dictionaries, check out my post on
[Python Dictionary: a quick reference](https://renanmf.com/python-dictionary/).

_Originally published at [renanmf.com](https://renanmf.com/2-ways-merge-python-dictionaries/)_
Google uses schema org to provide rich search results
Published: 2020-01-24 15:18:00

You can use schema org to provide better results from your site in 
- Businesses and organizations
- Events
- People
- Products
- Recipes
- Reviews
- Videos

Rich search result example from google
![rich search result example from google](https://i.imgur.com/6djbvH3.png)


Actually I don't want to repeat all that is already written in [google's guide on scheme org](https://developers.google.com/search/docs/guides/intro-structured-data).

[Read about Schema org and how it can help in increasing your search results](https://developers.google.com/search/docs/guides/intro-structured-data)
Daily Challenge #170 - Pokemon Damage Calculator
Tags: challenge
Published: 2020-01-24 15:12:40

---
title: Daily Challenge #170 - Pokemon Damage Calculator
published: true
series: Daily Challenge
description: Calculate the total damage of Pokemon attacks. 
tags: challenge
---
###Setup
For this challenge, you'll be thrown into a Pokemon battle! Calculate the damage that a particular move would do using the following formula:

`total damage` = `base damage` * (`attack` / `defense`) * `effectiveness`

`base damage` = the original power of the attack
`attack` = your attack stat
`defense` = the opponent's defense stat
`effectiveness` = the effectiveness of the attack based on the type matchup

Attacks can be `super effective`, `neutral`, or `not very effective` depending on the matchup. 
- `super effective` : 2x damage
- `neutral`: 1x damage
- `not very effective`: 0.5x damage

To prevent the challenge from being too tedious, you'll only deal with four types: fire, water, grass, and electric. Here are the matchups:
<pre>
fire > grass
fire < water
fire = electric
water < grass
water < electric
grass = electric
**Any type against itself is not very effective
</pre>

Overall, the function you implement must take in:
- your type
- the opponent's type
- attack power
- the opponent's defense

... and must output the `total damage` of the attack. 

###Tests

What are the `total damage` outputs of these attacks?
1. "grass", "electric", 57, 19
2. "grass", "water", 40, 40
3. "grass", "fire", 35, 5
4. "fire", "electric", 10, 2

Good luck!

***
_This [challenge](https://www.codewars.com/kata/536e9a7973130a06eb000e9f) comes from yaphi1 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!_
Framework to guide a Mentee.
Tags: teaching, mentoring, learningindepth, artofteaching
Published: 2020-01-24 14:50:29

---
title: Framework to guide a Mentee.
published: true
description: Framework on guiding mentor which results in huge impact for both mentor and mentoree.
tags: teaching, mentoring, learning_in_depth, art_of_teaching
cover_image: https://pbs.twimg.com/media/EIyfgdzUcAAu2Bg?format=jpg&name=900x900
---

We all might have gone through a saying in our life time many times, "Teaching can help anyone's career moves forward". Teaching will put you in a situation to learn the things in depth before teaching someone.

Before pitching into the actual story. I would like to clear a few things, few of us can think like why should I teach someone, and how spending time on teaching can improve yourself as well. We always used to consider *questioning* as an opportunity for growth (whoever asking it). Then what can be for the tutor? *you have the answer*.

## Right way to approach people:

Be nice to people. Someone can jump into your desk and ask you anything. Irrespective of their experience we have to follow the below approach.

1. Wrong approach: Just answering them a fix.

2. Better approach: Use the opportunity to teach someone something, So they can solve their problems in the future by themselves.
   . Teach them how to approach something.
   . Teach them to identify the root cause.
   . Teach them to doubt.
   . Teach them to think. 
   . Teach them to make mistakes and learn from them.
   . Teach them how to teach others.


## How to Set Expectations:

1. Have Realistic expectation, as we have passed the same path we can set the realistic expectation.

2. Don't try to compare your mentee with you. People need time, we can't grow a tree in short time.

3. You cannot expect them to absorb everything at once.

4. Maybe we might missed to notice the way how they are progressing.

## Closing thoughts:

> Teaching is an art, so don't worry if you don't follow the above approach, as we are learning everyday.

> Teaching can improve you in building confidence, solidifying your own knowledge, practicing your ability to communicate effectively.
Testing rescue with RSpec
Tags: ruby, rspec, rails
Published: 2020-01-24 14:24:05

How to test rescue with RSpec? How to check returned value?

```ruby
require 'rspec'

class Foo
  def self.call
    Bar.call('first')
  rescue StandardError
    Bar.call('second')
  end
end

class Bar
  def self.call(message)
    message
  end
end

RSpec.describe do
  context 'Bar raises error during first execution' do
    it 'retries call' do
      expect(Bar).to receive(:call).once.and_raise
      expect(Bar).to receive(:call).once.and_call_original

      expect(Foo.call).to eq('second')
    end
  end
end
```
Gist Test Based on Question
Tags: github, question
Published: 2020-01-24 14:11:00

Here is my first post based on this question;

{% link https://dev.to/jinglescode/can-we-embed-github-gist-on-dev-post-306b %}

Trying for my old Gist from Github...

{% gist https://gist.github.com/serkanalgur/348cc2d93fa6259bd67631f9afdf6560 %}

Please check Editor Guide... https://dev.to/p/editor_guide

Thank you for reading...
How to read, add and clear an input field?
Tags: javascript, beginners, help
Published: 2020-01-24 14:04:29

 Hello everyone,

I want to read 1 input field.
Like input type="text" id="bedragen" and add this input to an existing var, when enter key is pressed.
It has to read the input type, and add the (numerical) value when the user presses the Enter/Return key.
Then the value needs to be added to the previous inputs.

After pressing return key, the input field needs to be cleared.

I hope you'll can help me.
I have here a little start: https://codesandbox.io/s/test-inzend-19t5r

EDIT: Please not only post the outcome, but also some explanation! Thank you!
What software development tools (libraries/frameworks/apps/whatever) make you feel most anxious while you're working with them?
Tags: discuss
Published: 2020-01-24 13:43:02

The reverse of this post...

{% link https://dev.to/practicingdev/what-software-development-tools-libraries-frameworks-apps-whatever-make-you-feel-relaxed-while-you-re-working-with-them-30ff %}
FINDEAD 
Tags: react, finder, findead, deadcomponents
Published: 2020-01-24 13:10:44

---
title: FINDEAD 
published: true
description: To find react dead components in projects
tags: react, finder, findead, dead components
---
## :dart: Motivation: *Dead Components* 
Many times in large or even small projects, we forgot some components in code that we'll never use and we never take time to search one by one and remove. 

## :rocket: Npm Package
Recently I've launched npm package to find dead components in project: `FINDEAD`

## :camera: Demonstration
![](https://media.giphy.com/media/iFfljysdC7VDyuFh4r/giphy.gif)

To open issues, contribute, star, follow, see, test: [findead](https://github.com/narcello/findead)
Daily Developer Jokes - Friday, Jan 24, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-01-24 13:00:07

---
title: "Daily Developer Jokes - Friday, Jan 24, 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=Friday%2C%20Jan%2024%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/5e125988c2636.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:___ Why did the web developer always go to the wrong hotel room?

___A:___ They were in room 301.
 -->
Machine (technical) test for HTML and CSS
Tags: html, webdev, interview
Published: 2020-01-24 12:44:40

---
title: Machine (technical) test for HTML and CSS
published: true
description: 
tags: HTML, webdev, interview
---

Task: Create an HTML skeleton code of the below structure.  

*Here interviewer wants to see your strategy of converting a design (mockup) to HTML, your knowledge of semantic tags, accessibility, good practices, and arrangement of the HTML elements.*

Share your solution and I would love to review the solution.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/tlpcn9w74busbf0hq66i.jpeg)
Draw with CSS
Tags: html, css, sass, codepen
Published: 2020-01-24 12:12:42

---
title: Draw with CSS 
published: true
description: 
tags: #html #css #sass #codepen
cover_image: https://thepracticaldev.s3.amazonaws.com/i/atqmxdmowq3b12a771eq.png
---



For a while, I started coding the visuals I encountered on the internet with CSS. I do this through my codepen account. I also collected all the drawings I did in a GitHub repo. 

All the work I've done until now:
### 🔸 Emoji
{% codepen https://codepen.io/busramemis/pen/yLybROK %}

### 🔸 Snowman
{% codepen https://codepen.io/busramemis/pen/povwgOe %}

### 🔸 Pokemon Ball
{% codepen https://codepen.io/busramemis/pen/QWwgzJN %}

### 🔸 Santa Claus
{% codepen https://codepen.io/busramemis/pen/oNgwabV %}

### 🔸 Gameboy
{% codepen https://codepen.io/busramemis/pen/zYxaoYM %}

### 🔸 Slot Machine
{% codepen https://codepen.io/busramemis/pen/OJPpvZG %}

### 🔸 Wall-e Eyes
{% codepen https://codepen.io/busramemis/pen/LYEjGMr %}

### 🔸 Groot
{% codepen https://codepen.io/busramemis/pen/NWPYwgW %}

### 🔸 Sweet Home
{% codepen https://codepen.io/busramemis/pen/mdyGprK %}

I created a codepen collection so that you can see all these projects together. You can reach them all by clicking [here](https://codepen.io/collection/njaZGk).

You can also access projects via Github. I created a repo called [Draw Exercises](https://github.com/busramemis/Draw-Exercises).
Neumorphism | Soft UI
Tags: html, css, ui, ux
Published: 2020-01-24 12:00:22

---
title: Neumorphism | Soft UI
published: true
tags: html, css, ui, ux
---

#####In this article we will take a look at a practical example of neumorphism or soft UI, a web design trend that is getting very popular in 2020. We will be using HTML and CSS's box-shadow to create this effect. 


> Free source code available on [Codepen.io](https://codepen.io/atulcodex/pen/NWPJPVM?editors=0100)


{% codepen https://codepen.io/atulcodex/pen/NWPJPVM %}

> [👆🏼 Buy one get 👍🏼 one free programming course](https://www.eduonix.com/lifetime-learning-access/UHJvZHVjdC0xMzE1MDIw)
13 Reasons Why Online Tutoring is the Best!
Tags: onlinetutoring, homeschooling, database
Published: 2020-01-24 11:52:31

“Online learning is not the next big thing, it is now the big thing.”
– Donna J. Abernathy

There is a prolific rise in online tutoring, virtual classroom phenomenon and students are chasing wildly popular online tutors. If you are wondering what the buzz is all about
just GOOGLE online tutoring and see the search results yourself!

Read more: https://www.tutoreye.com/blog/online-tutoring/13-reasons-why-online-tutoring-is-the-best-learning