teleren/devto huggingface dataset:
Váš sken dorazil...
Published: 2020-07-13 11:02:50

... a je to HTML!

![Původní e-mail](https://dev-to-uploads.s3.amazonaws.com/i/gc7l3vxyk6vg4b4u5yix.jpg)

Slovo "[EXTERNAL]" do předmětu automaticky vkládá Office 365, aby byl uživatel na pozoru. Standardně jej tam ale nenajdete, tak ho budeme ignorovat.

V tomto případě je zajímavá hlavně technika zvýšení důvěryhodnosti pomocí "forwardu" z jiné adresy domény microsoft.com. Není ale provedená příliš šikovně.

Příloha se bohužel nedochovala, pojďme se tedy alespoň podívat, co je podezřelé v textu.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/k28mqjtvym3jv6tsyr3k.jpg)

1. Adresa odesílatele je zcela jasný signál, že jde o podvod - e-mail se v těle tváří jako Microsoft, ale tady je něco úplně jiného.
1. Ještě nikdy jsem neskenoval přímo do HTML a ani naše tiskárny v kanceláři to v základu nedělají. Je možné, že to umí (nezkoumal jsem), ale šance je malá.
1. Podezřelý účet - rychlé hledání v adresáři prozradí, že takový účet ve firmě není. Kdybychom se zamysleli trochu víc, tak je zvláštní, že "scanner" posílá sken "printeru".
1. Nestandardní formát data.
1. Detail, který ale chytne za oko - "mainPrinter" by mohlo být napsáno alespoň jako "Main printer".
1. Opravdu nemáme jednu "hlavní" tiskárnu.
JavaScript: Type Conversion
Tags: javascript, codenewbie, tricks
Published: 2020-07-13 16:33:41

## To Binary

JavaScript has two boolean values: `true` and `false`. But, it also treats certain values as `truthy` or `falsy`. All values are `truthy` except `0`, `null`, `undefined`, `""`, `false`, and `NaN`.

We can switch values between true and false using the negation operator `!`. This conversion also converts the type to `boolean`.

```javascript
const a = null;
const b = undefined;
const c = "";
const d = 0;

console.log(typeof a); // object
console.log(typeof b); // undefined
console.log(typeof c); // string
console.log(typeof d); // number

const w = !a;
const x = !b;
const y = !c;
const z = !d;

console.log(typeof w); // boolean
console.log(typeof x); // boolean
console.log(typeof y); // boolean
console.log(typeof z); // boolean
```

This did change the type to boolean, but it also switched the value. If you need conversion to boolean but stay on the same `truthy` or `falsy` side, use `!!` 🤯

```javascript
const a = null;
const b = undefined;
const c = "";
const d = 0;

console.log(typeof a); // object
console.log(typeof b); // undefined
console.log(typeof c); // string
console.log(typeof d); // number

const w = !!a;
const x = !!b;
const y = !!c;
const z = !!d;

console.log(typeof w); // boolean
console.log(typeof x); // boolean
console.log(typeof y); // boolean
console.log(typeof z); // boolean

// Let's check if they are all false though and haven't switched to true!

console.log(w); // false
console.log(x); // false
console.log(y); // false
console.log(z); // false
```

## To String

Use `toString()` method.

```javascript
const num = 7;
console.log(typeof num); // number
const numString = num.toString();
console.log(typeof numString); // string
```

Or use the shortcut by appending to `""` 🤯

```javascript
const num = 7;
console.log(typeof num); // number
const numString = num + "";
console.log(typeof numString); // string
```

## To Number

`parseInt()` function parses a string and returns an integer. You pass the string as the first parameter and the second parameter is radix. It specifies which numeral system to use: hexadecimal (16), octal (8), or decimal (10).

```javascript
console.log(parseInt("0xF", 16)); // 15
console.log(parseInt("321", 10)); // 321
```

Or use the shortcut by adding `+` operator in front of the string! 🤯

```javascript
console.log(+"0xF"); // 15
console.log(+"321"); // 321
```

There are situations where the `+` operator might be used for concatenation. In that case, use the bitwise NOT operator ~ twice.

```javascript
console.log(~~"0xF"); // 15
console.log(~~"321"); // 321
```
The 7 Most Popular DEV Posts from the Past Week
Tags: top7
Published: 2020-07-14 15:48:52

---
title: The 7 Most Popular DEV Posts from the Past Week
published: true
description: A round up of the most-read and most-loved contributions from the community this past week.
tags: icymi
cover_image: https://thepracticaldev.s3.amazonaws.com/i/sfwcvweirpf2qka2lg2b.png
---
_Every Tuesday we round up the previous week's top posts based on traffic, engagement, and a hint of editorial curation. The typical week starts on Monday and ends on Sunday, but don't worry, we take into account posts that are published later in the week. ❤️_

### One dev's SCSS "Northstar" tips

Annie shares eight of SCSS best practices from the guideline that made them rethink the way they structure their CSS code (— tips are geared towards SCSS vs pure CSS). 

{% link https://dev.to/liaowow/8-css-best-practices-to-keep-in-mind-4n5h %}

### 👀 💡 ⚛️ 🙌🏽 

Three cheers for Naya, who created Gomojii, an emoji themed application that will contain multiple emoji-themed widgets using React + Redux.

{% link https://dev.to/greedybrain/react-redux-project-gomojii-5d6i %}

### On the flip side...

Gabriel calls for an embrace of the "separation of backend from frontend instead of remaining in [an] ambiguous in-between state." 

{% link https://dev.to/g_abud/why-i-quit-redux-1knl %}

### "Did someone say GIFs!?"

Monica walks us through the new GitHub profile-level README feature in all its glory, which includes utilization of more fun visual components like gifs! 

{% link https://dev.to/m0nica/how-to-create-a-github-profile-readme-1paj %}

### According to our calculations, dark mode looks really good

This simple tutorial (using HTML, CSS, and JavaScript) will get you a slick calculator with dark mode. Thanks, Mohammad!

{% link https://dev.to/mohammadfarmaan/simple-calculator-with-dark-mode-545c %}

### Investing your luck in an independent future

Ilona explains that developers are lucky in having found a growing, lucrative career path. But they also believe that without a sound investing and saving practice, you'll be left spinning your wheels financially. Ilona to the rescue!

{% link https://dev.to/ilonacodes/the-importance-of-financial-independence-for-software-developers-98m#chapter-4 %}

### "Find flaws and fix them!"

Emmanuel shares an awesome generalization of the flaws and fixes for front-end frameworks for Web Apps in Rust, complete with pros, cons, and actionable takeaways

{% link https://dev.to/emmanuelantony2000/valerie-rethinking-web-apps-in-rust-4cl3 %}


_That's it for our weekly wrap up! Keep an eye on dev.to this week for daily content and discussions...and if you miss anything, we'll be sure to recap it next Monday!_
Day 43 : #100DaysofCode - The Amazing Faker Gem
Tags: 100daysofcode, codenewbie
Published: 2020-07-14 02:45:09

If you are relatively new to code and learning all about Ruby and Ruby on Rails, then you most likely have experience or heard of the ``seed.rb`` file. The file allows us to create objects/ data and add it to our database. In general, you would run ``rails db:seed`` or ``rake db:seed`` AFTER running your migration. Today, I wanted to add information to my seeds file so that I could manipulate and interact with the data in my console to confirm that everything was working properly. 

My schema was simple, it looked like this: 

```
 create_table "patients", force: :cascade do |t|
    t.string   "name"
    t.integer  "age"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end
```
In order to generate information in my database, I was going into my console or manually creating the information by manually creating objects and filling them in like so:

```
homer = Patient.create({name: "Homer Simpson", age: 38})
bart = Patient.create({name: "Bart Simpson", age: 10})
marge = Patient.create({name: "Marge Simpson", age: 36})
```

But then I was introduced to the <a href="https://github.com/faker-ruby/faker"> Faker Gem </a> that changed my life. First, I added the faker gem to my Gemfile ``gem 'faker'`` then I added this simple iteration to my ``seeds.rb`` file:

```
5.times do |t|
    name = Faker::Name.name 
    age = Faker::Number.between(from: 15, to: 90 ) 
    Patient.create(name: name, age: age)
end
```

Lastly, I ran ``rails db:seed`` and TADA, my database was filled with five patients. The <a href="https://github.com/faker-ruby/faker"> Faker Gem </a> has tons of information available for times when you need to generate information quickly for your database. I recommend checking out the documentation and adding it when necessary to save you the time.

I hope this helps another code newbie like myself.

Thanks for reading!

Sincerely,
Brittany
Hi ! Help Needed to remove custom Domain on GitHub pages
Published: 2020-07-14 06:23:29

Hi!,
someone who are familiar with GitHub. Please help me. I added a custom domain to use GitHub pages. Now I decided to remove but I don't know how to do it. The problem is this:
when i created dummysite.github.io to publish, it is always pointing to www.dummysitesz.com.
How to remove the custom domain?
TOP 2 New APIs in Chromium
Tags: webdev
Published: 2020-07-14 12:14:08

## 1- Screen Wake Lock API

### Supported in

* **Chrome 83+**

This API helps to prevent devices from dimming, locking or turning off the screen when your web application needs to keep running.

## 2- Web NFC

### Supported in

* **Chrome 79+**
* **Chrome for Android 80+**
* **Edge 79+**
* **Opera 66+**

Can only be enabled in Chromium based browsers using the
`enable-experimental-web-platform-features` flag

It allows a website to communicate with NFC tags through device's NFC reader.
What does the terms front-end and back-end cover? (opinions)
Tags: discuss
Published: 2020-07-15 01:32:45

For example, whenever I hear the term **front-end** I think about sketching, design, color theory, UI/UX, coding...

For **back-end**: databases, coding, algorithms, devops, systems...

My definitions could be completely wrong, but that's just how I personally perceive them.

How do **you** perceive those two terms? :)
The story of how I got into web dev... 
Tags: webdev, watercooler, codenewbie
Published: 2020-08-13 17:00:52

Hey everyone, my name is Nazanin but my online friends call me Zani lol
I saw people sharing their stories and how they got into coding so i thought I'd do the same 
Here we go :

Coding was never my passion, hell i didn't even know  what it is. I never knew what I liked or what I wanna do, The only thing I knew was that I wanna be a barista but couldn't make that happen (still can't btw), Other than that I didn't know anything. 
I've always had a habit of dropping things off and never finished what I'd started. 
I tried fashion design but dropped it. 
I tried drawing but dropped it. 
I even dropped coding the first time I tried it lol

So after quite sometimes I started coding again for the second time and only because I was so bored and was like let's try coding one more time. 

The first week of learning was just for fun BUT somehow things changed after that. Suddenly I was so into this and kept googling.the more time passed the more I took it seriously. 
It took me a while to decide which direction to go. I couldn't choose between web dev and app but somehow I ended up choosing web dev.
As I said I started it just for fun but now I'm really talking it seriously and wanna build a career in this field. 

Getting into web dev really has changed me in every way. 
I literally went from " being a lazy person who has no goals" to having so many goals and trying so hard to achieve them ^^

A big shout out to mimo app for teaching me the basic in the best way possible, and to my amazing supportive friend, Discors and to Dain Miller's awesome podcast for being a huge help. 

Okay that's it. Thank you all for reading my journey ^^
ES6 Modules: How to use import and export in JavaScript
Tags: javascript, tutorial
Published: 2020-07-15 03:32:42

ES6 provides the ability to split JavaScript into multiple files (modules).

Modules can then be exported and imported as required into other files.

The biggest benefit of modules is they help keep large amounts of JavaScript organised.

To better understand how modules work let’s create a simple project with following files and folder structure.

```
|- index.html
|- app.js
|- /src
  |- location.js
  |- weather.js
```

First add the following markup to the index.html file:

```html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Our Application</title>    
  </head>
  <body>
    <div id="app"></div>
    <script type="module" src="app.js"></script>
  </body>
</html>
```
Notice the `type="module"` so that the browser treats the script as a module, it wont work without it.

##Exporting

Before we can import we must first export the code from the weather.js and location.js files.

In weather.js let’s create a `weather()` function with an `export` directive.

```javascript
export function weather() {
  const temperature = "15c";
  const conditions = "Sunny"
  return temperature + " " + conditions;
}
```

And in location.js we’ll export multiple variables by adding the desired members to the `export` directive.

```javascript
const country = "Australia";
const state = "Victoria";
const city = "Melbourne";

export { country, state, city };
```

##Importing

Now in the app.js file we can import the external JavaScript.

```javascript
import { country, state, city } from "./src/location.js";
import { weather } from "./src/weather.js";
```

Once imported it can be used just as it would if it existed in the same JavaScript file.

To complete the project we’ll output the imported modules into the index.html.

```javascript
const getWeather = weather();
const currentWeather = "<h2>Weather " + getWeather + "</h2>";
const currentLocation = "<h1>" + country +  " | " + state + " | " + city +  "</h1>";
document.getElementById("app").innerHTML = currentLocation + currentWeather;
```

If everything is correct you should see the following when index.html is viewed in a browser.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/urldng179k9t522d71ut.png)

Note: Modules will only work in files served via http(s) not in the local file system (file:///).
.NET CIL interpreter in F#
Tags: dotnet, functional
Published: 2020-07-15 15:30:42

I've prepared compact [.NET CIL](https://en.wikipedia.org/wiki/Common_Intermediate_Language) interpreter called [Fint](https://github.com/sergeyt/fint) in pure F# for [NskDotNet Meetup #6](https://www.meetup.com/NskDotNet/events/265652338/).

It can run C# programs with the following features at this point:
- all control flow statements (if, for, switch, etc)
- arithmetic operations including bitwise one
- boolean algebra operators
- string concatenation
- static function calls
- Console.WriteLine calls

It can be easily extended with other features.

Some code in this project is just ported from [PageFX project](https://github.com/GrapeCity/pagefx) I wrote about [recently](/flash-viewer-story).

It would be nice to try porting Fint to JavaScript using [Fable](https://fable.io/) and run .NET binary code right in a browser.
Later we can try to port [Roslyn C# compiler](https://github.com/dotnet/roslyn) to [WASM](https://webassembly.org/) with [Blazor compiler](https://dotnet.microsoft.com/apps/aspnet/web-apps/blazor) and build online tutorial that:
- compiles small C# program to .NET PE file in browser
- runs .NET PE file in browser
- shows CIL code for given method
- provides debugging experience of CIL instruction set

This could be a great web resource to help learning .NET code at low-level.

If you like Fint repo please stargaze it on github.

Here is [a recording](https://www.youtube.com/watch?time_continue=4&v=d-NbhhxRRW4&feature=emb_logo) of my presentation. Sorry for speaking so boring :smile:

Enjoy! EOF :smile:
A quick start base for python developers looking to build AI based chat apps
Tags: machinelearning, python, tutorial
Published: 2020-07-15 16:02:04

Today, We will learn how to set up a base for a Python based AI chatbot using the MACHAAO + RASA Sample Chatbot Template.

So, I have chosen the above mentioned chatbot template because it is easy to learn, build, deploy, monetise, integrate and manage.

We will require ngrok (optional) secure introspect-able tunnels to localhost / your laptop.
Rasa: Open source conversational
Machaao Chatbot template
MessengerX.io API Token / Key

So, assuming we have all the above covered - Let’s get started!

Courtesy: @Abhishek Raj

Follow the complete FREE tutorial -> https://www.linkedin.com/pulse/create-deploy-python-chatbot-within-minutes-abhishek-raj/
Free Product-Market Fit consultancy (30 mins)
Tags: startup, tips, developer
Published: 2020-07-16 09:01:22

Are you having problems finding a product-market fit for your app or have questions about fundraising or how to do customer discovery?

You can have a free one-to-one consultancy session call with one of the volunteers of GetAdvice

https://getadvice.github.io/warren.fauvel.html

Disclaimer: I'm the guy behind GetAdvice (volunteers are needed!!). This is a way to promote getadvice.github.io and get more volunteers and users into the site too.
Send data between tabs with JavaScript
Tags: javascript, webdev, tutorial
Published: 2020-07-16 10:13:47

Did you know you can send information between open browser tabs using JavaScript?

Let's say your user is viewing your site with multiple tabs and something happens one tab which you want to react to on the other tabs - you can do this using the [Broadcast Channel API](https://developer.mozilla.org/en-US/docs/Web/API/Broadcast_Channel_API).

Before we start, I want to mention that this only works between browsing contexts on the [same origin](https://developer.mozilla.org/en-US/docs/Glossary/origin).

#### Browser Support

Please also check browser support before using this API. As of July 2020, it doesn't appear to be supported by Safari. Please see the Can I Use... link [here](https://caniuse.com/#search=broadcast%20channel)


### Sending Data
To send something to another tab, we need to first create a new `BroadcastChannel` instance. This is super easy, and looks like this:

```js
    const channel = new BroadcastChannel("my-channel");
```
Notice how we passed in `my-channel` - this is the **name** of the channel which we are *subscribing* to. When subscribing to a channel, you're then able to post and receive messages from it.

Speaking of posting messages, let's do that right now:

```js
    channel.postMessage("Hey, how's it going mate? I'm from a different tab!");
```
We can send multiple different kinds of objects with the `postMessage` method, for example:

```js
    // array
    channel.postMessage([5, 10, 15, 20]);

    // object
    channel.postMessage({ name: "Dom", age: 30 });

    // blob
    channel.postMessage(new Blob(["sample text"], {
        type: "text/plain"
    }));
```
### Receiving messages
Now, on the second tab, we can listen for and receive those messages. Open up a new tab (on the same origin, i.e. `localhost`) and include this code:
```js
    // subscribe to the same channel, "my-channel"
    const channel = new BroadcastChannel("my-channel");

    channel.addEventListener("message", e => {
        console.log(e.data);
    });
```
Once this code is included, open up both the tabs, then refresh the original one (the one doing the posting), and you should see the data appearing in the console.

It's that easy! You simply listen for the `message` event and once you have it, access the data with the `data` property.

### Video Tutorial
If you prefer a video version of the above tutorial, you can view it on my YouTube channel, **dcode**:

{% youtube wYcvzLFHFN0 %}

## [Enrol Now 👉 JavaScript DOM Crash Course](https://www.udemy.com/course/the-ultimate-javascript-dom-crash-course/?referralCode=DC343E5C8ED163F337E1)
If you're learning web development, you can find a complete course on the JavaScript DOM at the link below 👇
[https://www.udemy.com/course/the-ultimate-javascript-dom-crash-course/?referralCode=DC343E5C8ED163F337E1](https://www.udemy.com/course/the-ultimate-javascript-dom-crash-course/?referralCode=DC343E5C8ED163F337E1)


![Course Thumbnail](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nurocyfs69g4yk02uq43.jpg)
My First Programming Project
Tags: ruby, cli
Published: 2020-07-16 12:00:02

Leading up to my first project, I was feeling anxious, nervous and excited at the same time. It’s crazy to this that a month ago I had no coding background, and now I’m tasked with creating a project based off the knowledge I’ve learned in the past month. I felt that I could do it and was excited to put my knowledge to the test.

I decided to scrape the Formula Drift schedule webpage and give the user the option to select which event they would like to learn more info on. I then created my plan on how I wanted the structure of my program to be based on a user’s point of view. I watched Avi’s CLI walkthrough and liked how he didn’t focus on every issue that he thought he would need to solve, but instead one issue at a time starting from the what he wanted his program to do. Once I decided on how I wanted the CLI to work, I then built the CLI with fake information. This allowed me to establish a functional CLI so I could then worry about the logic the rest of the program. From there I started inspecting the web page to get an understanding of how I would need to go about retrieving the information that I needed. After poking around a bit, I finally discovered the correct css selector that captured the entire table of event information. This was great because it allowed me to only have to scrape the website once for all the attributes of every event. After that I established my scraper class and created a class method that scraped the website and organized the scrape information into a hash of event with attribute keys pointing to the event specific values. I stored this hash in an array to then iterate through and create new instance of the event class for each event with the appropriate attributes. I found that to be difficult, and constantly wonder if there is a simpler way to do it. When an instance of the event class is instantiated, each instance is pushed into the class variable ‘all’ which stores every instance of the event class. I used that to iterate through for the information I need in certain parts of the CLI.

Overall I found the project to be challenging and fun at the same time. I particularly had trouble with the actual logic of certain things and constantly found myself not liking my original code and searching for a “dryer” way. However I did really enjoy doing it and find it really satisfying that I completed it. It definitely gave me a confidence boost that I needed!
What are your best meeting hacks? 👨🏻‍💼🚀
Tags: discuss, watercooler, productivity
Published: 2020-07-16 13:29:25

I've been thinking a lot about meetings recently. So many of us are stuck with unproductive meetings day in and day out. So I wrote a post about it on Medium today and shared my best tips on how to make meetings productive.

You can find the post here!

[![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/6jakb110vdjtvjqo9qr0.jpg)](https://medium.com/skynox/productive-meetings-guide-d3f8b8ebe48d)

## tl;dr

1. A meeting isn't always needed. Asynchronous communication can replace a lot of meetings.
2. Meetings should have a deadman switch and should be short by default.
3. Always have a solid agenda! Don't aimlessly conduct meetings.
4. Fewer people = better meetings!
5. Get team members to engage more. Make sure quieter members also contribute to discussions.
6. Always have someone take meeting notes and share them afterward. People should know what actionable items have been decided!

### Got any hacks of your own?
I'm curious and always looking to make communication with my team more productive! Share your best advice with me. You can do it in the comments or on this Twitter thread.

{% twitter 1283744732275896321 %}

### [Here's a cheatsheet for better meetings.](https://blog.skynox.tech/how-to-make-meetings-un-suck/)

Anyway, share your thoughts! Cheers!