teleren/devto huggingface dataset:
Remover "valores falsos" (falsy values) de um array
Tags: javascript, react, node
Published: 2019-08-06 15:47:39

![Remover "valores falsos" (falsy values) de um array](https://thepracticaldev.s3.amazonaws.com/i/67036hoasuwkwy1ppym6.jpg)

Com esse trecho de código (snippet) você consegue facilmente remover os valores falsos, tambem conhecidos como falsy values de um array.

[➜ Participe da nossa lista de desenvolvedores](https://emersonbroga.com/e/participe/)
[➜ Aprenda ES6](https://amzn.to/2J4XnLg)
[➜ Veja as dicas no instagram](https://www.instagram.com/emersonbrogadev/)
[➜ Assita nosso canal no Youtube](https://www.youtube.com/c/emersonbroga/)
[➜ Curta nossa página no facebook](https://www.facebook.com/emersonbrogadev/)
[➜ Não perca as atualizações no twitter](https://www.twitter.com/emersonbrogadev/)

=)
How do you keep your motivation? 
Tags: development, newtech
Published: 2019-08-06 15:47:27

---
title: How do you keep your motivation? 
published: true
tags: development, new tech
---

Hey, everyone, I have a question about a challenge I've been having for a while. How do you find the motivation to learn some new tech knowing that you are about to put in hours but you know there is absolutely no plane to monetize it?
Real Dev - Real-life coding developer challenges
Tags: showdev, challenge, programming, developer
Published: 2019-08-06 15:41:02

---
title: Real Dev - Real-life coding developer challenges
published: true
description: 
tags: showdev, challenge, programming, developer
---

Dev folks,

I believe many of us hate algorithm puzzles during interviews. We especially do so. We believe **Developers are defined by what they can build, not what puzzles they can solve**.

I'm here to proudly present to you what we've been built - [Real Dev](https://real.dev). It's a platform for developers to use tech skills to solve real-life coding challenges!

# What is it

Real Dev is a place with real-life coding challenges.

- They're extracted from projects and code in production.
- Your code will be automatically tested, think of unit/integration tests.
- We get a leaderboard too!

Learn, practice, and have fun here!

# Talk to us

If you believe our philosophy, help us out! You can, spread the word, or add to our challenge list with your unique dev experience!

For companies, we're a company (startup) too. We can assure you using real coding tasks for interviews give so much better signals. Consider talking to us about your tech skills need and let us help!

Hope you enjoy the challenges. Start coding and show them who is the **Real Dev**! ⌨️
I'm here to answer any questions, discussions, and feedback!

PS: Support us on [Product Hunt](https://www.producthunt.com/posts/real-dev/)! 
PPS: If you wanna discuss any challenges, there's a place - [/r/RealDev](https://www.reddit.com/r/RealDev)
What's your non-internet career alternative?
Tags: discuss, career
Published: 2019-08-06 15:35:02

---
title: What's your non-internet career alternative?
published: true
description: If you, like me, make your income via the internet, and the internet were to go away tomorrow, what other skills do you have to make a living?
tags: discuss, career
cover_image: https://images.unsplash.com/photo-1519793945311-767397088877?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1950&q=80
---

**Q:** If you, like me, make your income via the internet (not _just_ through something like ecommerce or Patreon...but also like a day job that is internet related), and the internet were to go away tomorrow, what other skills do you have to make a living?

I don't know if I have any, and that disappoints me.

Photo by Jeremy Bishop https://unsplash.com/photos/kDP7wk1cJLo
Using SCSS maps as object - is it good?
Tags: css, scss, scssmaps
Published: 2019-08-06 15:20:18

Hi to all!

For my latest project I've preferred to use SCSS [maps](https://sass-lang.com/documentation/values/maps) instead of simple SCSS variables.

For example:

```scss
$fontSizes: (
  extraSmall: .75rem,
  small: .9rem,
  normal: 1rem,
  medium: 1.25rem,
  big: 1.5rem,
  extraBig: 2rem
);
```

So I can get those values around my stylesheets as follow:

```scss
font-size: map_get($fontSizes, extraSmall);
```

I just **LOVE** this method, I've converted all my SCSS variables (excluding the atomic variables like **$globalBorderRadius**) into maps, so I can group them into a specific set of scss variables.

*What do you think about SCSS maps?
Have you ever used them? If yes, is this a good way to use them?*

Let me know! :)
Namespaces in Swift
Tags: swift, ios
Published: 2019-08-06 14:58:33

Namespaces in their simplest form are a way to group related areas of code. They make one of the hardest problems in programming, naming things, easier. They exist in a lot of other languages but not natively in Swift.

Microsoft's C++ documentation says:
> Namespaces are used to organize code into logical groups and to prevent name collisions that can occur especially when your code base includes multiple libraries.

### The Problem
If you're working on a large codebase then you probably name classes specifically enough so you won't get them confused with other areas of the codebase. Unfortunately to achieve this we have to make the trade off of longer class names to get this specificity.  Also as we add more and more classes the global namespace gets more polluted, meaning that you end up with an information overload when trying to use autocomplete. 

For example you'd probably make classes like `LoginViewController` or `ContactsDataSource`. This can be taken to more of an extreme as you get into very specific workflows in a large codebase. 

### The Solution
A nice, swifty way to solve this is to use an empty `enum` to create a gateway into the specific workflow and implement all specific classes inside extensions on that enum. You can then access these classes using the dot syntax. So instead of the examples above you would have `Login.ViewController` and `Contacts.DataSource`. 

This also helps you organise code into logical groups - you know all the code related to the login flow will be under the `Login` namespace. 

### Implementation in Code

Making the namespace is just making an empty enum:

```
enum Login {}
```

Then the classes are implemented as extensions to that enum in a new file, in this case probably called `Login+ViewController.swift`:

```
extension Login {
	class ViewController: UIViewController { ... }
}
```

We use an enum instead of a struct because you can't instantiate an empty enum, so it can purely be used for accessing other classes without confusion of what its purpose is.

### References
[Microsoft Namespace Documentation](https://docs.microsoft.com/en-us/cpp/cpp/namespaces-cpp?view=vs-2019)

Some speaker at a Meetup who said that he did this
Corporate Universities are Changing Business, Explained by William T. Sugg
Tags: billsugg, williamtsugg
Published: 2019-08-06 14:39:04

Corporate universities first appeared in the mid-20th century as a response to rapidly changing business environments. Although many new employees receive a college education or formal training, it’s often times not enough preparation for a role in a high-level corporation. As the need for specialization and product development grows, so does the need for a new approach to corporate education. 

With more than 25 years of business experience, William T. Sugg, founder of a 501c (3) Healthcare Foundation and a Corporate University, explains why internal education is key to a healthy, successful company. 

Value to the Organization

An internal corporate university has curriculum that pertains to the organization specifically. Investing in employees has been shown to drive performance and results, as each person is fully equipped for the job at hand. William T. Sugg of Valley County Health Systems suggests that corporate universities also aid in the hiring process by opening the door to candidates who have the right attitude and energy, but perhaps not the experience that would normally be required. Reinforcing a positive and consistent work culture across all departments in the organization is a huge advantage to corporations.

Impact on Employees 

A corporate university encourages individual growth, where employees can develop skills relevant to their career goals. William T. Sugg of Valley County Health Systems has seen how open discussion fosters development and innovation, and allows employees to connect with peers. When the program is complete, employees are more prepared and more confident at work. Corporate universities also create an increase in employee retention rate, as team members have more opportunities to grow within their roles and at the company. 

Strategic Planning and Education 

New research suggests that corporate universities can play a huge role in planning for the future. William T. Sugg of Valley County h=Health Systems explains that it’s a great opportunity to discuss the overall vision for a company, and set multi-year goals for teams. It can help employees understand how their projects tie together and make a difference in the organization. Presenting critical information in a condensed and easy to understand format saves time, and puts everyone on the same page with a shared vision. 

About William T. Sugg

Throughout his management career, William T. Sugg of Valley County Health Systems, also known as Bill, has worked through almost every major crisis possible in a hospital setting, including deadly tornadoes, floods, fires, scandals and rebuilding the 17th most beautiful hospital in the United States. He is a politically astute healthcare executive with more than 25 years of experience. His leadership style is approachable, transparent, and people centered. William T. Sugg believes in a strong teamwork culture that promotes respect, trust, commitment, and dedication to goals and values.
#CodepenChallenge Fairly Colourful Profile Card
Tags: codepen, design, html, css
Published: 2019-08-06 14:27:50

<p>A simple and a little bit colorful design concept of a profile card.</p>

<p>This is my first time to use the Stylus CSS preprocessor. This challenge was the best opportunity for me to test it (I just coded it after I forked, without changing the preprocessor/s).</p>

<p>This thing doesn't have any functionalities. Just a simple design. But there is a small interaction, like when you hover on the picture, or the button.</p>

{% codepen https://codepen.io/takaneichinose/pen/xvpqgo %}
Handy note
Tags: chromeextension, vuewebextension, javascript
Published: 2019-08-06 14:25:12

---
title: Handy note
published: true
description: My first chrome extension.
tags: chrome extension, vue web extension, javascript
---

Hello everyone. It is my first programming related post anywhere ever so bear with me.

I got interested in coding in my final year studying mechanical engineering in the university because; 

a) I hated mechanical engineering. I got into it because I wanted to be like my father.

b). My grades were poor.

I decided to go into coding and the rest is history.

Recently, I find myself carrying a small note around because I did most of my reading on the web with a browser on a PC. Sometimes, I'd forget to go somewhere with my notes and I'd have to buy a new one. I racked up quite a number of notes which kind of defeated the whole purpose of taking notes because I could have notes related to one topic in different notes and wouldn't be able to find it when I needed it.

I installed quite a few extensions but they mostly opened a new tab. I just wanted a pop up to type in and after that download what I typed.

Last week I decided to make it myself and today it is on chrome web store with the name "Handy notes."

I used the vue web extension repository by klocal 
{% github Kocal/vue-web-extension %} to scaffold it.

I've made the it available for free on chrome web store and the code is available on github {% github ekediala/web-note-extension %}.

I will hopefully do a post on how I made the extension for newbies like me and publish it.

I'd welcome reviews and criticism. Thank you for your patience reading through my babble.

Here's what the extension looks like in use.

<img src="https://thepracticaldev.s3.amazonaws.com/i/wjpb9du0dlt76qkkucck.jpeg" alt="handy notes image"/>
Daily Challenge #34 - WeIrD StRiNg CaSe
Tags: challenge
Published: 2019-08-06 14:15:25

---
title: Daily Challenge #34 - WeIrD StRiNg CaSe
published: true
series: Daily Challenge
description: Write a function that modifies strings to have odd capitalization.
tags: challenge
---

The goal of this [challenge](https://www.codewars.com/kata/52b757663a95b11b3d00062d) is to write a function that accepts a string and returns the same string with all even indexed characters uppercased and all odd indexed characters lowercased. 

This indexing should be zero-based with the index in position zero being considered even. The input string will consist of only alphabetical characters and spaces. Spaces should only be present when there are multiple words. 

**Example:**
to_weird_case('String'); # => returns 'StRiNg'
to_weird_case('Weird string case') # => returns 'WeIrD StRiNg CaSe'

Happy coding~!

---
_This challenge comes from user xDranik. Thank you to CodeWars, who has licensed redistribution of this challenge under the 2-Clause BSD License!_

_Want to propose a challenge for a future post?  Email **yo+challenge@dev.to** with your suggestions!_
So I rebranded my SaaS and ditched the logo 💪
Tags: management, devops, webdev, github
Published: 2019-08-06 13:45:56

I've had the idea to rebrand my SaaS ploi.io for a long while now, but the biggest problem was that I am a core backend developer and not good at designing.

Luckily for me I have a designer friend who helped me setup a whole new brand for ploi: and boy was it a challenge 💙

We used to have the green color, but I always liked blue more over green. Which makes me feel its a whole more complete product now.

With the frontend redesigned and rebranded - we couldn't leave the panel behind (which is the most important part of the complete application).

So we overhauled that too! (Image in header and below this post some more screenshots)

Oh, and we are on product hunt too!

<a href="https://www.producthunt.com/posts/ploi-io-1?utm_source=badge-featured&utm_medium=badge&utm_souce=badge-ploi-io-1" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=163491&theme=light" alt="ploi.io - We make deploying a piece of cake | Product Hunt Embed" style="width: 250px; height: 54px;" width="250px" height="54px" /></a>

To sum up the changes;

- Ditched our logo (all text now)
- Changed branding color from #62A6A6 to #1853DB
- Completely redesigned frontend website
- Completely hauled over the panel design
- Changed login, register & password forget page
- Code editor highlighting added
- Exported sites & servers to 1 general search bar
- A lot of new features added to API (server creation is still in progress & changelog page is coming to https://developers.ploi.io)
- Ability to export personal user data to see what we save
- Speed improvements panel
- Bug fixes panel

I am really curious to hear what you think of the rebranding and new design, let me know!

![ploi1](https://thepracticaldev.s3.amazonaws.com/i/5ib912cl07wpbywoj0n2.png)
![ploi2](https://thepracticaldev.s3.amazonaws.com/i/28wnu8cxa6lb8nk7af39.png)
![ploi3](https://thepracticaldev.s3.amazonaws.com/i/1lmmlf6o6ai8y3io4dql.png)
What to put in your portfolio as a beginner web dev
Tags: beginners, discuss
Published: 2019-08-06 13:35:10

_This article was originally published on www.brianemilius.com/portfolio-ideas. Visit www.brianemilius.com/blog/ for more content._

---

Last week I wrote up a list of advice for beginner web developers. One of the bullets on the list was to build a portfolio.

{% link https://dev.to/brianemilius/my-advice-to-beginner-devs-4fo2 %}

But the challenge with this is that beginners have nothing to show.

Or do they? Here is a list of ideas for beginner portfolios. Please share yours too at the bottom.

* The code to your portfolio itself. Put it up on GitHub and share the link.
* Finish a pet project and display it.
* Design a contact form complete with validation, error messages, and confirmation message.
* How about the same as above, but for a login/signup form?
* Or a newsletter signup/cancellation flow?
* A small site that gathers news from RSS feeds and displays them.
* Photo gallery
* Are you a member of a sports club or do you play in a band? Make a website for that - even if your club doesn't need one.
* Call up non-profits in your area and ask if they would like to make use of your skills (this is also a great exercise in making cold-calls).
* Make a few [insert your preferred CMS] templates.
* A case study of that time you helped your aunt make a genealogy site.
* Or a case study of that other time you helped Non-Profit X tune their SEO and accessibility issues.
* A responsive website navigation (that doesn't default to a hamburger menu) (Why? Because this requires some outside-the-box thinking).
* Contribute to an open-source project. Yes, this is a daunting task for pretty much all beginners, but a great place to start in the open-source community is documentation and translation (fix those comma errors).
* A Tic-Tac-Toe game app, but with your personal twist.
* A To-do app you can speak to.
* An analogue clock.
* A small chat interface, maybe for something like webshop live support.
* Set up a landing page for Relay For Life, even though they never asked you to (seriously, help spread the brand!).
* Share unfinished projects. This can say a lot about your thought process and has real value.

That's 20 ideas for your beginner portfolio. A good one has 6 to 10 examples that show off your skills. Remember; Show me, don't tell me. Use visual examples. Show me what you can do rather than talk about it.

What ideas do you have? Or maybe you want to show off your portfolio so others can be inspired. Share in the comments.
Unit Testing Communication
Tags: discuss, testing
Published: 2019-08-06 13:23:38

Just a question about unit testing. How do you communicate that unit tests are passed. We started putting together libraries for some of our most used database functions. I'm trying to conduct unit testing for some of the stuff I'm adding. I'm curious what others do.

Is it in your guidelines for pushing to your repos that all tests must pass? 

Is it part of your peer review to go over passed tests?

Do you put a comment in your code that the class or method passes.

Is it something else?
How to format a OData v2 Edm.DateTime column
Tags: sapui
Published: 2019-08-06 13:05:36

## Use Case


In many cases, if you are using an OData v2 entity with a column of type ***Edm.DateTime***, you will need to some at some point construct a proper OData query string. This can be a bit of a challenge as if you don't know the correct syntax for the Edm.DateTime type. 

```
/sap/opu/odata/sap/ZGW_JOB_CLASSIFICATION_SRV/JobSet?$format=json&$filter=BeginDate le datetime'2019-08-02T04:00:00' and EndDate ge datetime'2019-08-02T04:00:00'&$select=JobCode,Title,Level,PersonSubArea,Link
```

> **Note:** At first glance, you might notice that this query string has a **DateTime ** prefix in front of the timestamp value.

```
/sap/opu/odata/sap/ZGW_JOB_CLASSIFICATION_SRV/JobSet?$format=json&$filter=BeginDate le datetime'2019-08-02T04:00:00' and EndDate ge datetime'2019-08-02T04:00:00'&$select=JobCode,Title,Level,PersonSubArea,Link
```
buried in the bowels of SAPUI5 framework they have an excellent helper library to help with adding such a prefix.

### Library

sap.ui.model.odata.odatautils

> **Note:** In order to use this library in your controller you'll need to add it to your ***sap.ui.define*** array like so `"sap/ui/model/odata/ODataUtils"`.

### Method

formatValue( date, EdmType)

### Example Usage

```ODataUtils.formatValue(beginDate, "Edm.DateTime")```

As you will see in the below example there is one caveat, the OData query with timestamp needs to be URLencoded so in order to do that we need to use the built-in javascript function encodeURIComponent()

#### Example :
```
var sBindUrl = "/JobSet(BeginDate=" + encodeURIComponent(ODataUtils.formatValue(beginDate, "Edm.DateTime")) +  
",JobCode='" + oEvent.getParameter("arguments").jobCode + "')?$expand=JobDescriptionSet" +  
"&$filter=BeginDate le " + encodeURIComponent(ODataUtils.formatValue(beginDate, "Edm.DateTime"));
```
Create Awesome CSS Heart Love Loading Animation
Tags: codepen, css, html, loading
Published: 2019-08-06 13:00:01


---
title: Create Awesome CSS Heart Love Loading Animation
published: true
tags: codepen, css, html ,loading
---


{% codepen https://codepen.io/ahmadbassamemran/pen/xLvaEW %}

<hr/>
[Do Not Forget To Like & Subscribe In The Channel:](https://www.youtube.com/AhmadEmran?sub_confirmation=1)
<hr/>

{% youtube 83150v81BCE%}
Finding Elements in iframes with Selenium
Tags: webdev, testing, tutorial, productivity
Published: 2019-08-06 12:21:58

---
title: Finding Elements in iframes with Selenium
published: true
description: A short tutorial for dealing with iframes in Selenium
tags: webdev, testing, tutorial, productivity
cover_image: https://thepracticaldev.s3.amazonaws.com/i/wyn6gvrr3duokx8xakws.png
---

Anyone who is using **[Selenium](https://www.seleniumhq.org/)** has encountered a scenario where they have to deal with an iframe. 

There is no automatic way of detecting that the element you're looking for is inside an iframe.  

The error message only says 'Element not found'. 

You're the one who's going to have to look in the Browser Console and figure out that your element is inside an iframe.


![](https://thepracticaldev.s3.amazonaws.com/i/obteyh9wuqh9milmj0jw.png)

Let's create a test for the **[Stripe Payments Demo](https://stripe-payments-demo.appspot.com/)** which has an iframe.
![](https://thepracticaldev.s3.amazonaws.com/i/v0328429z67s2l7cwr5c.png)


I'll also be making some comparisons between Selenium and **[Endtest](https://endtest.io)**:
{% youtube 4DIVKcs--TA %}

An iframe (inline frame) places another HTML document in a frame.

You need to change the focus of Selenium from one HTML document to another.

In our case, the only element which is inside the iframe is the **Card** input.

I used Python:

*driver.get("https://stripe-payments-demo.appspot.com")*

*nameElement = driver.find_element_by_name("name")*
*emailElement = driver.find_element_by_name("email")*
*addressElement = driver.find_element_by_name("address")*
*cityElement = driver.find_element_by_name("city")*
*stateElement = driver.find_element_by_name("state")*
*zipElement = driver.find_element_by_name("postal_code")*
*countryElement = driver.find_element_by_name("country")*
*iframeElement = driver.find_element_by_name("__privateStripeFrame5")*
*cardElement = driver.find_element_by_name("cardnumber)*
*submitButton = driver.find_element_by_css_selector("#payment-form > button")*

*nameElement.send_keys("Klaus Werner")*
*emailElement.send_keys("klaus.werner@example.com")*
*addressElement.send_keys("Random Street")*
*cityElement.send_keys("San Francisco")*
*stateElement.send_keys("CA")*
*zipElement.send_keys("94107")*
*countryElement.select_by_value("US")*
*driver.switch_to.frame(iframeElement)*
*cardElement.send_keys("4111 1111 1111 1111")*
*driver.switch_to.default_content()*
*submitButton.click()*

Notice how I switched to the iframe before writing in the Card input?

And I also switched back to the main page after that. 

It's a bit easier to deal with iframes if you're using **[Endtest](https://endtest.io)**:

![](https://thepracticaldev.s3.amazonaws.com/i/ffuis31rf1nquye71xpm.png)

Since you're planning to run that test multiple times, you should generate a random email address and store it in a variable. 

You can even test that email with the **[Endtest Mailbox](https://endtest.io/mailbox)**
{% youtube K3k-f9vB8Dc %}