teleren/devto huggingface dataset:
Know your tools: scratch files in IntelliJ IDEA
Tags: intellij, kotlin, scratchfiles
Published: 2020-08-13 14:18:15

---
title: Know your tools: scratch files in IntelliJ IDEA
published: true
date: 2020-08-13 14:16:14 UTC
tags: intellij,kotlin,scratchfiles
canonical_url: https://le0nidas.gr/2020/08/13/know-your-tools-scratch-files-in-intellij-idea/
---

_I’ve used scratch files in IntelliJ IDEA and Android Studio but I think that can be found in all of Jetbrain’s products._

#### What are they?

Scratch files are files that don’t get tracked by the version control system, can be created at any given time and, most importantly, get bind to the IDE and not the project that is currently open.

#### How do I create them?

The simplest way is to hit _ctrl_+_alt_+_shift_+_insert_. If you can’t remember it press _shift_ twice and start writing `scratch`, you will be presented with the action of creating a new one.

The next step is to choose what kind of file you want to create and this is where it gets interesting since you can choose from a plethora of file types. From plain text, to markdown, Kotlin, JSON, XML, ruby and many many more!

#### How do I use them?

By choosing the file’s type you choose how the IDE will behave when you are working on it, so if you create a `scratch.json` and paste some _json_ in it you can format it accordingly. Or if you create a `scratch.md` you can start writing in markdown and have a preview of your work.

But the most powerful aspect of those files is when you create code related ones. If, for example, you create a `scratch.kts` file and start writing some Kotlin in it, you will see your code being run on the fly presenting to you its result:

![](https://le0nidasgr.files.wordpress.com/2020/08/screenshot-from-2020-08-13-16-14-29.png?w=652)

#### TDDish

You can even work test first if you need to figure out a quick algorithm and have your test run in every change you make!

I usually start with an `assertThat` function and a failing test and start from there:

![](https://le0nidasgr.files.wordpress.com/2020/08/screenshot-from-2020-08-13-16-50-40.png?w=952)<figcaption>failing</figcaption>

Its a simple one but you get the point:

![](https://le0nidasgr.files.wordpress.com/2020/08/screenshot-from-2020-08-13-16-52-12.png?w=772)<figcaption>passing</figcaption>
Use JavaScript to prepare for coding interviews?
Published: 2020-08-13 21:52:17

Hi there, I need some suggestions from this community-

I am in final year now and going to start preparing for job interviews. I am basically starting to practice Data structures and Algorithms.

I am a Full stack developer specialised in Frontend (React) development. 

I'll be targeting full stack (MERN) developer role for my career.

I know most of the people use C++/java/python to do DS+Algo but since I am targeting Full stack developer role, I am thinking of using `JavaScript` to do the same. 

I don't think using C++ will benifit me as I'll be using JS for my daily job.

So here is my question-


### Should I go ahead and use JavaScript to practice DS+Algo for the preparation of job interviews?






Any extra suggestions/tips/resources will be appreciated 🙂




Please don't hesitate to discuss/share your opinions/experience. It will be helpful for me and other people having the same confusion.
If you want a professional looking website then you pay for a professional to create it for you.
Tags: javascript, webdev, wordpress
Published: 2020-08-13 21:44:45

 Hi there. I’m Brandon.

JavaScript Developer, with 4 years of experience, mostly working with:
JavaScript | Node | React | HTML | CSS | Git | Firebase | WordPress

Based in South Africa and open to any exciting new opportunities

I’m a natural Divergent Thinker, and a creative Problem Solver – always searching for new possibilities. These talents enable me to easily spot patterns and make connections between (seemingly) disparate ideas.

Passionately curious about all things with a deep need to know what it is, how it works, why and where it fits into the bigger picture, this is the driver, which leads me in my life long journey to continuously, research, learn, and grow my knowledge in my career.

https://bthunter.co.za/
How to pass coding job exercises?
Tags: tutorial, webdev, beginners
Published: 2020-08-13 21:44:11

Most of the time, this is the first step in a software developer recruitment process. For most developers out there, this is the last step as well, because they make silly mistakes.

During my career, I did them a lot of times, and now I can share my tips and thoughts with you fellas about how you can avoid doing them.

To make sure you will stand out from the other candidates, you need to make an as best first impression as possible. To succeed, you need to do everything you can to get to the next step.

Sometimes, this "everything" is too much, sometimes we forget about something, we don't do what we should have to do, so in this post, I'll provide a quick formula that you need to follow.

#1. Understand the task

Read it multiple times.

Say it out loud and understand what they want from you to make sure you don't miss anything and lose points, which can lead you to fail the submission as most candidates do.

There's always a chance that even if you make only one mistake, you can say goodbye to your dream job, which can be frustrating.

#2. Do what they say

If you don't do what they want from you, you'll probably fail and not pass the exercise.

Do what's written, don't go beyond that, because you can risk not getting to the next step of the recruitment process.

If you don't understand something, and if you have any doubts, don't hesitate and ask questions.

#3. Always ask questions!

A different employer wants different things from you, so you need to make sure that you don't misunderstand something or do less than they expect.

From my experience I know, that even the easiest thing to do can make you fail the exercise if you don't do it.

So, you'd better not be afraid to ask.

#4. Test it, test it!

Test your submission, and check it in every possible way, such as:

-   cross-browser compatibility,
-   RWD,
-   design,
-   contrast,
-   SEO,
-   useless comments,
-   commented code,
-   hard to read code,
-   errors,
-   poor Lighthouse score

There are more things to take care of before submitting it, but I listed I think the most obvious ones.

Keep in mind that even if the brief doesn't mention the responsiveness, make it responsive. Brief doesn't say to test it in the Internet Explorer? Test it.

# Conclusion

Nothing should be perfect in programming, but this process has to be as flawless as possible. Even if you struggle to land that job after reading that post, don't let the defeat stop you from learning, because there's no defeat at all.

One thing I know for sure, there's always an experience.
We want to feature your voice on DevDiscuss! This week's topic: Vim
Tags: podcast, discuss
Published: 2020-08-13 21:34:53

---
title: We want to feature your voice on DevDiscuss! This week's topic: Vim
published: true
description: Share your thoughts on this topic with us for the chance to be heard on DevDiscuss
tags: podcast, discuss
---

The [DevDiscuss Podcast](https://dev.to/devdiscuss) begins with an interview and ends with commentary from listeners.  
For your chance to appear on an episode:

- Call our Google Voice at +1 (929)500-1513 and leave a message 📞

- Send a voice memo to pod@dev.to 🎙

- Leave a comment here and we'll read your response aloud for you 🗣

_Please send in your recordings by August 19 at 5 PM PT (8 PM ET, 12 AM UTC)_

### This week's prompt: "What are your thoughts on Vim?" 

---

Don't forget to check out the [Season 2 premiere](https://dev.to/devdiscuss/s2-e1-how-to-build-good-habits-and-be-more-productive), released earlier this week!
[Day 2] Securing server with firewall
Tags: ubuntu
Published: 2020-08-13 21:31:35

Hello guys!

As I mentioned in previous post, today I will begin securing my server. Today's topic is disabling `root` access and setting up firewall.

## Disable `root` and changing default SSH port

This one is very easy to achieve. With `nano` I edited file `/etc/ssh/sshd_config` by adding rule:

```bash
PermitRootLogin no
```

Also I learned that you should change port for SSH from default 22. In the same file I entered new value:

```bash
Port 12345
```

After that, SSH service restart is needed by command `sudo service ssh restart`. Now to log in to the server, I have to specify to which port I want to connect myself:

```bash
ssh login@XXX.XXX.XXX.XXX -p 12345
```

## Firewall

Most common dependency for firewall is UFW. It was preinstalled on my machine, so all I have to do is to set up necessary rules.

The list of allowed communication both for IPv4 and IPv6 will be for now:

* SSH (only for new port)
* HTTP
* HTTPS

```ssh
sudo ufw default deny incoming # by default ban all incoming connections
sudo ufw default allow outgoing # by default allow all outgoing connections
sudo ufw allow 12345 # allow to connect to new SSH port
sudo ufw deny 22 # deny to connect to old SSH port
sudo ufw allow http # allow to connect with HTTP connection (port 80)
sudo ufw allow https # allow to connect with HTTP connection (port 443)
sudo ufw enable # enable firewall
```

And very basic server securing is done! Tomorrow I will give a try with some other dependencies to prevent unauthorized access to my machine.

---

## References

* [Disabling `root` access](https://askubuntu.com/questions/27559/how-do-i-disable-remote-ssh-login-as-root-from-a-server)
* [Changing SSH port](https://www.ubuntu18.com/ubuntu-change-ssh-port/)
* [Setting up firewall UFW](https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-with-ufw-on-ubuntu-20-04)

---

Cover image: <span>Photo by <a href="https://unsplash.com/@sonance?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Viktor Forgacs</a> on <a href="https://unsplash.com/s/photos/firewall?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></span>
How setup BulmaCSS with Parcel
Tags: css, codenewbie
Published: 2020-08-13 21:20:32

Hello, I'm a poor css guy, always use a framework like bootstrap, and today I take the decision to use Bulma CSS.

Bulma allows use by CDN or NPM. The CDN is easy way to use but with some caveats.

- No Sass for customizing.
- Large file (full Bulma framework).

## Bulma from CDN

In your HTML file, you import the css and your HTML is ready to use bulma.

```html
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.0/css/bulma.min.css">
```
CDN is a good approach for testing or basic mockup but not for a real project.

## Bulma from NPM
Bulma also supports be installed from NPM and using this way, it comes with few advantages.

- Sass for customizing.
- Pick with components load from the Bulma framework.

### Requirements
Using Bulma from npm requires you have nodejs installed in your machine.

- https://nodejs.org/en/download/ pick your OS, and install it.

Create a new directory bulmalab and from your terminal go to your directory and install Bulma using npm with the following command.

```bash
npm install bulma --save
```
Bulma is installed, next step is use a bundler for compile our sass and load a webserver with parcel.

### Using Parcel for Sass compilation.

The parcel is an amazing application bundler for sass, javascript, and assets with zero configuration.

I using Parcel because it helps to compiles build my sass files without pain and also generated a final version.

Configure your project with npm package and install parcel-bundler.
```
npm init -y 
npm install -g parcel-bundler
```
Set tasks for Parcel.

Edit the package.json and create a new task into the script with Parcel and your entry point like index.html.

```json
    "server": "parcel index.html",
    "prod": "parcel build index.html"
```

##Import Bulma 

Create a new directory with a file scss/main.scss, the main.scss will import every Bulma file to be able to customize or extends.

the main.scss will import the initial variables and Bulma.

```scss
@import "node_modules/bulma/sass/utilities/initial-variables";
@import "node_modules/bulma/bulma";
```
The index.html import the main.scss.

```html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <link rel="stylesheet" href="scss/index.scss">
</body>

    <h2>hello from bulma</h2>
</html>
```
### Compile Bulma and my sass.

The parcel compiles our sass file on the fly only need start the dev server.

```bash
dany@lx-personal:~/Desktop/bulmacss-step-1$ npm run server

> bulmacss-step-1@1.0.0 server /home/dany/Desktop/bulmacss-step-1
> parcel index.html

Server running at http://localhost:1234 
✨  Built in 2.00s.
```

Our project is ready to be customized with Bulma!

Photo by <a href="https://unsplash.com/@chillysheep?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">James Baldwin</a> on <a href="https://unsplash.com/s/photos/paint-man?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
Coloro - a console tool for show texts with highlighted colors
Tags: linux, cli, terminal, python
Published: 2020-08-13 21:17:38

---
title: Coloro - a console tool for show texts with highlighted colors
published: true
description:
tags: linux, cli, terminal, python
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/eaffrjmxgv20lyc4p6xf.png
---

Let me introduce "coloro" - a simple console tool for output text with highlighted hex colors. I wrote it when playing with my polybar and bspwm design. 

Source available at https://github.com/Insolita/coloro

It can highlight text from arg

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

Highlight text from file
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/8mxvhxpcekjymxougckw.png)

Highlight text from pipe

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


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

And even highlight text from clipboard

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

( -n option allow to parse colors without hashtag prefix )
Earn with GAMING - WORKSHOP
Tags: gaming, workshop, earn, money
Published: 2020-08-13 21:05:57

Learn how to earn money by playing video games A webinar to explain the basics of gaming journalism. After webinar you will be given an unpaid Internship also with mentorship and if selected you will be awarded paid internship. So just learn the art of writing reviews and opinions of games and start making money. Register on the link below


https://www.townscript.com/e/webinar-on-gaming-journalism-033110
Apple has banned Fortnite, Epic Games is filing a lawsuit
Tags: news, ios, apple, fortnite
Published: 2020-08-13 21:05:54

[Apple just kicked Fortnite off the App Store](https://www.theverge.com/2020/8/13/21366438/apple-fortnite-ios-app-store-violations-epic-payments)

Epic Games was _clearly_ ready for a fight, with a video mocking Apple's 1984... Really well executed.

{% tweet 1294015725074554881 %}

This is a continuation of the open dicussion mostly kicked off by Basecamp. Apple mostly shrugged that off, but this could shape up to be a big ordeal for the future of platform businesses and antitrust in general.
Why I love functional programming
Tags: oop, architecture, functional
Published: 2020-08-13 21:05:33

---
title: Why I love functional programming
published: true
description: There's life beyond OOP and that life is awesome
tags: #oop #architecture #functionalprogramming
cover_image: https://modeling-languages.com/wp-content/uploads/2017/06/type-signature.png
---

Not long ago I wrote a bit of rant about things that annoy me about OOP. They were largely conceptual issues, but on the practical side it boiled down to how OOP concepts are largely unnecessary. In development, it's way too easy to write OOP spaghetti and people fight to keep things testable while spending most of their lives debugging the mutable global state.

Why functional programming (FP) can be better?

1. Functions are functions, regardless of language. If you develop around functions, keeping them idempotent, then moving from language to language is simple. Functions are functions everywhere and as long as the languages support FP style development (aka functions are first class citizens) you won't run into surprises. No more 'interfaces mean just slightly different things in that language' or 'inheritance comes with a couple of gotchas' or classes mean slightly different things and they miss stuff. Sure, in Haskell you have real immutability and you may or may not have 'map' as a built-in tool but otherwise, it's a matter of whether or not there are curly braces or whether you need semicolons at line's end or not.
2. Everything's testable - no side effects, it's all about transforming input to output with no surprises. No worries about mocking instances, whether member visibility comes in the way or not.
3. Composition is at the core - yeah, OOP adopts it as well. No more entangled code that you can't really reuse in different projects.
4. Immutability - sadly it's mostly up to developers to respect immutability but when you live by FP you know that there won't be surprises. Things don't change from under you in unexpected ways and code is mostly self documented (particularly if you design for totality) 
5. Composition, immutability and idempotency go a long way to make sure that FP programs are concurrency-friendly. Whether the language itself offers concurrency constructs (Golang, Erlang, Rust, etc) your approach already allows you to identify potential race conditions and to manage them in various ways.
Installing A New Font for VS Code - In THREE(3) Simple Steps
Tags: vscode, codenewbie, beginners, webdev
Published: 2020-08-13 21:02:30

Most beginner developers like me at one point or the other, get tired of their default vs-code font. In fact, I just changed mine a few days back and I thought documenting the process will be a great idea for others that would like to follow suit and don't know how to get around it.

###**Step one (download the font)**

A great resource to get free and really good fonts is [Google Fonts](https://fonts.google.com/). Although there are other great fonts out there, I recommend downloading the **Fira Code** font, because its one of the most preferred font by developers and also because its my personal favorite for now . 

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

Click on download family button and a zip file should be downloaded on your PC.

###**Step two (installing the font)**

Navigate into the newly downloaded font zip file and you should have a screen like this.

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

Click install and now you have the font installed on your PC

###**Step three (using font in VS CODE)**

In your VS code editor Go to File > Preferences > settings and search font.

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



Insert the name of the newly downloaded font("Fira Code") before other default fonts and voila!! you have successfully installed a new font for your **vscode editor** ...

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


wait a moment.... another thing to note is that, you might need to restart your PC before the changes take effect

###**Bonus**
you might want to enable font ligatures also, it also makes font look great...


###**Conclusion**
The default vscode font is not bad, but changing your font can make you feel more at home in your code editor and even increase the excitement to code. Happy Coding!!
How can solve it for genius  
Tags: javascript
Published: 2020-08-13 20:53:52

i want u to write this algorithm below and you work in general not in exemple Bonjour i want u to think in général   
Warning : B is not always capital you should work with ch1 and ch2 us they lowercase string

var ch1 = "jourbon"
let's go complete this function circularword (ch) {
let ch2="bonjour";
}

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/t6h47nyeuu86nno722g6.png)
MMT Tech Meet-up August 2020 - Featuring GatsbyJS
Tags: gatsby, kontent
Published: 2020-08-13 20:43:43

---
title: MMT Tech Meet-up August 2020 - Featuring GatsbyJS
published: true
description: This meet-up covers GatsbyJS Recipes, GatsbyJS update and a Q&A with Gatsby founder Kyle Mathews
tags: GatsbyJS, Gatsby, Kontent
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/u2of8h2c4s6phh3duiw8.jpeg
---

## MMT Tech Meet-up August 2020

This meet-up featured GatsbyJS and various topics of discussion around it. 

We had the following speakers for this meet-up:
- Gatsby Recipes with [Ilesh Mistry](https://www.ileshmistry.com) (MMT Digital)
- Gatsby Update and Q&A with [Kyle Mathews](https://www.gatsbyjs.com) (Gatsby)

This is the recording from the tech meet-up
[![MMT Tech Meet-up - Aug 2020 - Featuring GatsbyJS](https://img.youtube.com/vi/TPNw7Z6wKy4/0.jpg)](https://www.youtube.com/watch?v=TPNw7Z6wKy4)

Video contents are shown below:
00:00:00 - Introduction to MMT Tech Meet-ups by Ilesh Mistry
00:03:00 - Gatsby Recipes by Ilesh Mistry
00:17:00 - Gatsby Update by Kyle Mathews 
00:38:45 - Gatsby Q&A with Kyle Mathews
01:22:39 - End

### *** Bonus extended trial *** 
Kentico Kontent - 90 days extended trial - http://bit.ly/KontentMVP 

### Useful links
- Gatsby Recipes with Gatsby CLI - https://www.gatsbyjs.org/blog/2020-04-15-announcing-gatsby-recipes/
- Gatsby Recipes Alpha 2 - https://www.gatsbyjs.org/blog/2020-08-04-Announcing-Gatsby-Recipes-Alpha-2/
Day 28: Readme
Tags: 100daysofcode
Published: 2020-08-13 20:28:05

My readme files have always been a maximum of one statement. I guess i had not wrapped my head around the necessity of a readme file. I'm still tying to figure out what goes to a readme especially for an API project. For a start [the readme generator](https://www.npmjs.com/package/readme-md-generator) was quite useful. I came up with this [readme](https://github.com/M-Tee/SCAMP-Assesment) for my sales API project.


It's certainly not the best in town but i consider it a great improvement. 

_Day 28_
Building U-Boot and Linux Kernel for Toradex Colibri iMX6ULL SoM
Tags: toradex, tutorial, linux
Published: 2020-08-13 20:25:32

I sometimes find Toradex documentation hard to google and browser, hence this quick note which has all the essentials in one go!

1. **kernel tree**: imx6ull colibiri is very well supported upstream. for everything 5.x kernels just use mainline
2. **uboot tree**: I use the toradex uboot released here https://git.toradex.com/cgit/u-boot-toradex.git/ (tested tag toradex_2020.07)
3. **uboot defconfig**: use `colibri-imx6ull_defconfig`
4. **linux defconfig**: use `imx6_imx7_defconfig`; maybe add your own fragments with kernel scripts/merge-config.sh
5. **device tree**: the dtb to use for a standard colibri imx6ull with 256M of RAM is: `imx6ull-colibri-eval-v3.dtb`; for the wifi/bluetooth edition use: `imx6ull-colibri-wifi-eval-v3.dtb`
6. **toolchain**: any modern cross toolchain worked well for me. I used musl and glibc linaro toolchain for armhf for the time being, e.g. good binary musl cross toolchains are available from https://musl.cc/
7. **format**: Toradex uboot default configuration is happily booting zImage, but not uImage, so go for the former.

Give it a try!