teleren/devto huggingface dataset:
The Contrast Principle
Tags: growth, contrast, productivity, learning
Published: 2021-04-06 11:26:30

---
title: The Contrast Principle
published: true
date: 2021-03-09 05:00:37 UTC
tags: growth,contrast,productivity,learning
canonical_url: https://x-team.com/blog/the-contrast-principle/
---
A black bear looks similar to a dark rock. But if you're ever trapped on a path with the bear on one end and the rock on the other, you'll know in which direction to run. When you've clambered over the rock and are far enough from the bear, you can thank your brain for saving your life. It used the contrast principle to emphasize the differences between the bear and the rock. It made the bear look more different from the rock than it actually is.

The contract principle used to save lives, but is now used to manipulate us. Why do you think real estate agents first take you to highly overpriced properties before they take you to moderately overpriced ones? Because a $250,000 apartment seems like a bargain when you've just been to a $500,000 one.

The contrast principle is a [cognitive bias](https://x-team.com/blog/12-hurtful-cognitive-biases-and-how-to-overcome-them/) that makes one thing seem very different from a similar thing, simply because they're both placed together. Our brain emphasizes the differences because it's easier to make decisions in a black-and-white world over one where uncertainty rules.

It's the reason why car dealers suggest options _after_ you've agreed on the price of the car. Leather seats and Bose speakers for an extra $5,000 seem reasonable when you've just agreed to a $35,000 car.

No one is immune to the contrast principle, even if you're aware of it. But you can protect yourself against manipulation by flipping the principle around and using it in your favor.

- Go to the cheaper apartments before you go to the expensive ones.
- Don't agree on the price of a car unless you've also agreed on its options.

The contrast principle leads to the deeply philosophical conclusion that we never see something as it truly is. Everything we see is influenced by what we saw just before. Keep that in mind next time you make a big decision.
How JavaScript Works 🔥& Execution Context
Published: 2021-03-09 04:13:35

## Do you know how JavaScript works and how the code is executed ?
## Is JavaScript Synchronous or Asynchronous ?
## Is JavaScript Single Threaded or Multy Threaded ?

If you are not familiriar with this so dont worry just keep reading.
So before going further just remember that "Everything in JavaScript happens inside an Execution Context!". You can asume this context as big box or a container in which whole JavaScript code is executed.

So lets divide this box or container in two parts left part will be Memory where all variables will be stored ad key valye pairs
ex: key:value;
And there is also another name for this Memory component which called Varibale Envirement.

The Second container is Code component , so this is the container where the code is executed line by line at the time.And people also call it Thread of Execution.

## JavaScript Single Threaded or Multy Threaded

So when we say Single Threaded it means that JavaScript can only execute one line in a time.
And when we say Synchronous  and Single Threaded that means that JavaScript can only execute one command in a time and in a specific order.Means that it can only go down if the current line has finished executing.
Create a secure Isolated Iframe
Tags: webdev, beginners, programming, html
Published: 2021-03-09 03:40:15

Link to original article with code snippets (recommended): https://gabriellazcano.com/blog/create-an-isolated-iframe/

You might have heard that if you create an iframe, your site might becomes vulnerable to cross-site attacks. And this is true. So there is a way of creating an isolated iframe in order to make it more secure.

This can be achieved just by using the attribute sandbox which enables an extra set of restrictions for the content in the iframe. And being capable of enabling only the required tooling for your iframe with the following attribute values:

allow-forms: Allows form submission
allow-modals: Allows to open modal windows
allow-orientation-lock: Allows to lock the screen orientation
allow-pointer-lock: Allows to use the Pointer Lock API
allow-popups: Allows popups
allow-popups-to-escape-sandbox: Allows popups to open new windows without inheriting the sandboxing
allow-presentation: Allows to start a presentation session
allow-same-origin: Allows the iframe content to be treated as being from the same origin
allow-scripts: Allows to run scripts
allow-top-navigation: Allows the iframe content to navigate its top-level browsing context
allow-top-navigation-by-user-activation: Allows the iframe content to navigate its top-level browsing context, but only if initiated by user

If some some reason you are using injected HTML, as it is useful for many frameworks like Hugo, or you just want to type the inline HTML, you can use the attribute srcdoc which lets you do this securely. Which is the same as src attribute but not cross domain and other differences. Such as being secure in in legacy-browsers and secure browsers.
Day 35: Adding Machine
Tags: 100daysofcode, javascript, react
Published: 2021-03-09 03:05:03

This very basic app allows the user to add any two integers including negative values.

```javascript
function App() {
  const [input1, setInput1] = useState(0);
  const [input2, setInput2] = useState(0);
  const [total, setTotal] = useState(input1 + input2);

  function calculateTotal() {
    setTotal(input1 + input2);
  }

  return (
    <div className="App">
      <h1>Adding Machine</h1>
      <p>This very basic app allows you to add any two integers including negative values.</p>
      <div className="number-inputs">
        <input
          type="number"
          value={input1}
          onChange={e => setInput1(+e.target.value)}
          placeholder="0"
        />
        <input
          type="number"
          value={input2}
          onChange={e => setInput2(+e.target.value)}
          placeholder="0"
        />
      </div>

      <button onClick={calculateTotal}>Compute</button>

      <h2>{total}</h2>

    </div>
  );
}
```
Nevertheless, Ashlee Coded
Tags: wecoded
Published: 2021-03-09 02:38:49

---
title: Nevertheless, Ashlee Coded
published: true
tags: shecoded
---

2020 was both the best and worst year. I challenged myself more than ever and I was also given challenges I have never faced.

- In January of 2020, I started physical therapy to learn how to walk again after having foot surgery a few weeks before. I dealt with inaccessibility in ways I’d never had to before and it was hurtful in a lot of ways. I didn’t quite feel invisible. It was more like people didn’t want to see me and chose not to. They chose to be exclusive and inaccessible.
- In April of 2020, I started [a Twitch channel](https://twitch.tv/ashleemboyer). I’ve met absolutely incredible people through Twitch and I’ve enjoyed every minute of live knitting and live coding. 🥰
- At the end of July 2020, I spoke on [Twitter’s Disability in UX panel](https://twitter.com/twitterdesign/status/1293238566567387136) in front of hundreds of people. It was my largest speaking experience by far and it was fascinating for that moment to be completely remote. The linked broadcast has over 3,000 views. I have no doubt people heard us and are changing how they approach accessibility.
- Also in July of 2020, I quit my job without having another one lined up. I drained my savings and was searching for months for a job. Job hunting was an incredibly demeaning process that I feel like I’ve only just regained my confidence from. I also had a ton of financial support when I asked for it. I don’t know what would have happened without that assistance from the community. 💜
- In November of 2020, I started my 4th job. I’ve had several new and fun technical challenges there and am building my skills faster than I ever have. It’s also in an industry I’ve never worked in and I’m always learning things from people outside of my department.

Aside from these notable dates, I’ve also learned a great deal about myself while exploring a potential ADHD diagnosis. I know myself better than I ever have and also accept myself more than I ever have. And with more time to gaze on the internet, I’ve found a ton of disabled and/or fat and/or BIPOC and/or neurodivergent creators on TikTok where I’ve learned more about our world and myself than I could’ve imagined.

Overall, I feel lucky to say that I came out of 2020 a better person than I went in. It is certainly a privilege to say that. I didn’t get through the year completely healthy, but I didn’t covid and I didn’t lose anyone to covid. I feel very lucky to have survived the year. I’m still here and working hard to speak and write about accessibility. 💜
Top Mobile App Design Tools in 2021
Tags: software
Published: 2021-03-09 02:28:58

Mobile app design is a crucial phase during development and a mobile app’s UI can make or break the application. A mobile app developer has a powerful and direct impact on your user engagement, conversion rates, and consequently revenues.

There are many [mobile app design tools](https://www.designveloper.com/blog/mobile-app-design-software/) that help you sketch your mobile app wireframes, create prototypes, and bring them to life.

##1. Sketch 

The sketch is a vector-based design tool with a focus on-screen design. And, Sketch’s plethora of easy-to-use yet extremely powerful tools allows both beginner and professional designers to focus on what they do best: design. 

Mobile app developers and designers use Sketch to create user interfaces for different mobile devices. Furthermore, Sketch was created with digital designers in mind and it shows how the tools are made to fit all of their needs.

##2. InVision
InVision is undoubtedly one of the most powerful mobile app design tools in the world. It allows you to quickly turn ideas into powerful screen designs with intuitive vector-based drawing and flexible layers.

Moreover, it also gives you the ability to seamlessly navigate the entire design process in one place, keeping everyone fully engaged and aware of all updates.

##3. UXPin
UXPin is a product design platform that allows product and design teams to easily design, collaborate on, and present fully-interactive wireframes and prototypes. 

You can collaborate and share your work with anyone involved in the product, the design team, developers, or clients, and even run live usability tests with end-users.

##4. Figma
Figma is the world’s first collaborative interface design tool. Besides, it allows you to design and prototype your digital experiences, together, in real-time and in one place; helping you to turn your ideas into products, faster.

This app has the tools you need to get your work done. Furthermore, it allows you to create design systems with linked UI components the whole team can use, reduce the friction of turning visual concepts into code, and gives you the flexibility and controls you need to scale Figma for your team.

##5. Origami Studio
 Origami Studio is a free design tool that allows mobile app designers to rapidly build and share interactive interfaces. And, this app was primarily created and is still used to design and build Facebook’s products and mobile apps including Facebook, Messenger, and Instagram.

##6. Framer
A framer is one of the most advanced interactive design tools on the market, and yet intuitively easy all at once. You can just drag and drop in fully functional components from the Framer X Store, their interactive design marketplace.

##7. Fluid UI
Fluid UI lets you create visually stunning prototypes in minutes. Furthermore, you can create interactive mobile app prototypes with taps, swipes, clicks and more gestures using their simple linking system.
Upgrading Electron from 7 to 12
Tags: electron, javascript
Published: 2021-03-09 02:22:51

Hi, it's [Takuya](https://twitter.com/inkdrop_app). I'm making a Markdown note-taking app called [Inkdrop](https://www.inkdrop.app/) with [Electron](https://www.electronjs.org/).
I upgraded Electron from 7 to 12 in this project, and here are some troubleshootings.

## Upgrading packages

```sh
npm i electron@12.0.0 electron-rebuild@latest
```

In case `node-abi` is not the latest, upgrade it:

```sh
npm update node-abi --depth 2
```

## `require()` is not defined

There is the following breaking change:

* Changed the default value of `contextIsolation` to `true`. [#27949](https://github.com/electron/electron/pull/27949)

It overrides `nodeIntegration` option. So, you have to specify options like so:

```js
webPreferences: {
  contextIsolation: false,
  enableRemoteModule: true,
  nodeIntegration: true,
  nodeIntegrationInWorker: true,
  webviewTag: true
}
```

## `remote` module deprecation

There is another breaking change:

* Deprecated the `remote` module. It is replaced by `@electron/remote`. [#25293](https://github.com/electron/electron/pull/25293)

You should fix like so:

```js
// Deprecated in Electron 12:
const { BrowserWindow } = require('electron').remote
// Replace with:
const { BrowserWindow } = require('@electron/remote')
```

```js
// In the main process:
require('@electron/remote/main').initialize()
```

## Failed to serialize arguments

My app calls a function of the main process.
It passed a `BrowserWindow` object as its parameter and that causes the error: `Failed to serialize arguments`.
I replaced that code to use browser window ID instead.

## Ubuntu gets blank screen on VM

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

* [Electron >=10 does not work on Ubuntu 18 under Parallels vm 16 · Issue #26061 · electron/electron](https://github.com/electron/electron/issues/26061)

Apparently, it only happens on Paralells VM.

You can run the app by appending `--disable-gpu` option like so:

```sh
npm start -- --disable-gpu
```

* * *

Hope that helps!
Góc nhìn nói về thương hiệu quý phái nữ giới
Published: 2021-03-09 02:11:35

phong cách nữ giới được khá nhiều KH & những người có trình độ bên trên ngành hàng quan tâm sắc đẹp bình chọn đó là một trong những thiên đàng cho việc tìm kiếm chất làm đẹp chính hãng 100%. những mặt hàng ưu việt, được rất nhiều KH tìm kiếm hàng đầu bên trên trang web đẳng cấp và sang trọng Phá đẹp chính là: mỹ phẩm làm đẹp make up, chăm lo sức khoẻ, âu yếm da,… của tên thương hiệu Maria Galland, Babor, Golden Health,…
https://www.instagram.com/dangcapphaidep.vn/
https://www.facebook.com/dangcapphaidep.net/
Mỹ Phẩm Phái Đẹp
Published: 2021-03-09 02:08:47

nhiều người đang search vị trí sản xuất chất làm đẹp làm đẹp chính hãng, đáng tin and có khá nhiều khuyến mãi tại Thành Phố Hồ Chí Minh, Hà Thành ? Hãy đến với sang trọng phái nữ – website, nhà phân phối nhiều chủng loại chất làm đẹp trang điểm, sản phẩm âu yếm sức khoẻ dành cho những Anh chị trẻ em.
https://vk.com/dangcapphaidep
https://dangcapphaidepvn.tumblr.com/
Nevertheless, Diana Coded in 2021!
Tags: wecoded, career, gratitude
Published: 2021-03-09 01:52:39

---
title: Nevertheless, Diana Coded in 2021!
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k76jo7g9904dpfdg7x9g.jpg
published: true
tags: shecoded, career, gratitude
---
### New beginings
2020 was quite an intense year. I have no words to express what it meant to me, in terms of challenges and successes, of learning, of many losses including the passing of my grandmother, the woman who raised me. 

Yet, 2021 brings hope, regardless of the pandemic... my eyes have opened, my horizons have broadened and I have gained SO much from last year's experience. I learned to connect with people and communities in a way I never thought I would.

### My most recent achievement was…
Completing [ScoutX](https://github.com/alphacentauri82/scoutx). A Diabetes monitoring tool to notify emergency contacts in case of irregular situations. This saved my life, many times. I'm finishing work to build a GPS LoRaWan tracker powered by [WisBlock](https://www.rakwireless.com/en-us/company/wisblock-series) and [Helium](https://helium.com). These companies have been super supportive as well as [The Nightscout Foundation](https://www.nightscoutfoundation.org/). I feel like this year I found a purpose, I can help others, I can use technology for good. I can help fellow diabetics like me improve their lives with the use of technology.

### Advocating for myself looks like…
Standing up for my principles even if it means standing alone.

### My biggest goal is…
Leave a legacy, it suffices me to know that in the last 20 years I may have done something that has paved the way for this and future generations in technology.

### My advice for allies to support underrepresented folks who code is...
DO THE WORK!, actions rather than words!, educate yourself!.

### Special thanks to...
Lauren Lee, Avital Tzubeli, Heather Baden, Natalia Venditto, Nina Zakharenko, Jen Looper, Erica Stanley, Angel Banks, Beth Laing, Ana Chin A Loy, Chloe Condon, Gaby Trueba ... you have had such a deep impact in my life, I have no words to express my gratitude for everything you've done for me. From the bottom of my heart, thank you!
Despite Loss, Tori Coded
Tags: wecoded
Published: 2021-03-09 01:50:56

_TW: miscarriage_

It has been quite the year for me since International Women’s Day last year. I landed my first software engineering role at an amazing company. I got married. I got pregnant, twice. I experienced loss. I moved to a new state and, like everyone else, I have had to navigate living through a global pandemic. It has been a roller coaster of a year, to say the least.

Prior to losing my great grandfather to COVID and having a miscarriage, I was creating a lot of content here on DEV but have been unable to find the motivation to do so since my world kind of turned upside down. I honestly did not know if I would even muster up the energy to write this post, but this is something I have done every year since I started my journey into tech and I did not want to tarnish that, **so**... 

Here I am to say that despite everything that has happened over the last year, I have continued coding. I continue to strive to gain as much knowledge and experience as I can in everything that I do. I choose to make the most of every situation. I continue to be vocal about my pain and loss in order to help comfort anyone who has to go through a similar experience. Last but not least, I continue to feel incredibly grateful to have ended up at a company where I feel valued and safe as a woman engineer.

Feel free to check out my [FireHydrant spotlight](https://firehydrant.io/blog/spotlight-on-tori-crawford-software-engineer-at-firehydrant/) for International Women's Day where I answer a few questions such as important lessons I have learned and advice that I have for women wanting to break into tech.

_Note: This post's cover image comes to you from Static Peak hike in Grand Teton National Park, Wyoming._
Docker: From nothing to something!
Tags: linux, containers, beginners, docker
Published: 2021-03-09 01:18:42

---
title: Docker: From nothing to something!
published: true
description: Learn how to use Docker from scratch starting with a single PHP file.
tags: linux,containers,beginner,docker
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uyf5i59cpyocw0hr4bf1.png
---

Hello everyone, 

I wanted to share a new video that I recently created geared towards beginners that walks you through Docker from scratch. I start the video with a quick explanation of VMs vs. Docker, then we walk through creating a simple PHP file and using a Docker image that contains Apache to host it. 

Several items that I wanted to call out in this videos are: 

* Docker runs everywhere (Mac, Linux, and Windows)
* No cost to you
* You can get started with just a couple of commands
* There are prebuilt images on DockerHub that you can take advantage of
* There are endless possibilities once you get the basics down

I have created a video to show you all of this awesome stuff together! 

Video (14 mins)

{% youtube Zgf79-GfEu0 %}

Conclusion

Stay tuned for [future Twitch streams](https://twitch.tv/mbcrump) as we learn about security and app development or you can watch the condensed version by subscribing to my [YouTube](https://youtube.com/mbcrump). 

Stay connected with me on social platforms for daily software development news.

-[Twitter](https://twitter.com/intent/follow?screen_name=mbcrump) | [Twitch](https://twitch.tv/mbcrump) | [Instagram](https://instagram.com/mbcrump) | [YouTube](https://youtube.com/mbcrump) | [GitHub](https://github.com/mbcrump) | [Website](https://www.michaelcrump.net)
Nevertheless, erica coded
Tags: wecoded, womenintech, theycoded
Published: 2021-03-09 01:11:19

# Well, it has been a wild year. 

I did not expect to live through a global pandemic during my first year as a developer. I don't think anyone did. 

Luckily, I have been able to continue working throughout. Adapting to working from home while still pretty green was an extremely challenging experience. I didn't 
have the same level of communication with the team as I usually would, which made me realize how much I had started to rely on them. There were situations where it 
felt like I had forgotten how to google. While there were some pretty specific situations, there were also bugs that were *hard*. I had no clue where to begin, but 
I knew I had to start somewhere. 

As usual, something happened that happens every time one remembers how to chase bugs. 

I started going down rabbit holes. And it was super fun. There were times I got off track, and I ended up picking up some stray knowledge I wouldn't have found otherwise. 

Beyond that, there's a lot of reflection I could write here on the past year, but lately I've been finding that my time is best spent looking forward. 

## Here are some other great #shecoded articles I'd like to highlight. 

{% link https://dev.to/amandaeducative/the-history-of-women-in-tech-changing-the-master-narrative-54d9 %}

{% link https://dev.to/sylwiavargas/shecoded-a-year-of-silence-and-reflection-2c15 %}

{% link https://dev.to/devcmombasa/nevertheless-she-coded-dalia-abu-ghoush-34d5 %}
365 days learning JavaScript and web development framework
Tags: javascript, webdev, beginners, nextjs
Published: 2021-03-09 00:54:09

Hello everyone 😁
This is my first blog in Dev.to

The main reason is the one seen in the title, I plan to spend a whole year learning JavaScript.
I accept any type of advice to help this my new process 💛

I will be starting with this process very soon, and I will share my experience in these places 📰