teleren/devto huggingface dataset:
How to Create a Clipping Path and Opaque Mask
Tags: design
Published: 2019-11-01 11:15:58

To make your illustrations look clean and tidy, Tony suggests using either a <a href="https://www.offshoreclippingpath.com">clipping path</a> or an opaque mask.

If you experience any learning difficulties while taking this course, then you can take an online Adobe Illustrator consultation via Skype.

In today's lesson on the blog, you’ll just be able to learn more about these two tools and learn how to put them into practice (at the request of many readers, a copy of the lesson’s translation is also published on this blog).

With the clipping masks and opacity masks, you can easily select and remove areas that should not be visible. Let's see how it works.

<b>Clipping path</b>

In this illustration, we have 3 layers. Background, rays and sun effect. You need to put the sun's rays in a square.

First, select the sun's rays and background, and group them together.
Select them using the Selection tool and press Ctrl + G to group them.

Draw a rectangle to define the area you want to show. Make sure it is on top of other objects.
 
Select the background and outline you drew. Right-click and select Object> Clipping Mask> Make (Object> Clipping Mask> Make).

After that, move the background to the background by pressing Ctrl + Shift + [

<b>Editing the clipping mask</b>

To make changes to the clipping mask, go to the Layers panel, select the “Clipping Path” sublayer. Now you can move and resize the mask. If you want to undo the mask, select Object> Clipping Mask> Undo (Object> Clipping Mask> Release).

Opacity Mask Opacity allows you to create transparency for your layer. The intensity of black determines the transparency of the layer. Black will be transparent, and white accordingly opaque.

Unlike drawing a square from the previous example, we draw a circle and fill it with a gradient.

Now select both shapes and select the <a href="https://www.bittbox.com/illustrator/opacity-mask-basics-illustrator">Opacity Mask</a> by clicking on the Options icon in the corner of the Transparency Palette.

After that, you will get a mask whose edges will be blurred. An opacity mask is a good way to blur the edges and make a transition to the background color for your illustrations.

<b>A few nuances for those who plan to paint for micro stocks in the future:</b>

- You should not use the opacity mask at all. Remember that, according to the rules of microstock, all effects containing transparency are not allowed. It will not be possible to parse the opacity mask correctly (currently transparency is already enabled on micro stocks, for this, save your vector in EPS-10 format).

- You can use the clipping mask if you want to leave buyers the ability to edit objects that go beyond the image area. But some microstock (for example, iStock photo) requires not just to hide the extra elements but completely cut them off. So if you are preparing a file for several stocks at once, consider this point!

Do you need related info on photo ediitng? Here is additional info on <a href="https://www.offshoreclippingpath.com/photo-retouching-service/">photo retouching</a>
Why JAMstack is Becoming so Popular
Tags: javascript, opensource, webdev, vue
Published: 2019-11-01 11:00:28

Nowadays, the static site generators are becoming very common because they are straightforward to use and they are based on the most modern technologies and JavaScript frameworks like Vue.js or React.

Thanks to static site generators, modern browsers, CDNs, and APIs, we’re now seeing web developers transition from server-side to client-side applications.

With all this, Netlify came out with a new term JAMstack.

So let’s see what the JAMstack is and why it is becoming so popular.

#What is JAMstack?

**JAMstack** is not a technology. Instead, JAMstack is a new way of building websites and apps. 

It is a modern web development architecture based on client-side and it doesn’t depend on a web server.

A definition that I have read on a blog and I like a lot is:

_The JAMstack is a static HTML site, rebuilt automatically every time you update the content, and deployed directly to a CDN._

I think that this definition makes better the idea!

JAM stands for **JavaScript**, **APIs**, **Markup**

**JavaScript**: any dynamic programming during the request/response cycle is handled by JS, running entirely on the client. This could be any frontend framework or library, or even vanilla JavaScript.
**APIs**: all server-side processes or database actions are abstracted into reusable APIs, accessed over HTTPS with JavaScript. These can be custom-built or leverage third-party services.
**Markup**: templated markup should be prebuilt at deploy time, usually using a site generator for content sites, or a build tool for web apps.

#The Benefits provided by the JAMstack

Some of the main benefits of using it are the following:

**Faster and Better Performance**
It can generate new pages at deploy time and serve pre-built markup and assets over a CDN.

**Less expensive and easier to scale**
The lesser complexity of development reduces costs and also hosting of static files is cheap or even free.

**Higher Security**
With the delegation of the server-side and database operations, we don’t need to worry about vulnerabilities anymore.

**Better developer experience**
Frontend developers can focus only on the frontend and debugging, the expanding selection of CMS options for site generators remove the need to maintain. This usually means quicker and more focused development.

Continue to read about **JAMstack** on Medium 

{% medium https://medium.com/notonlycss/why-the-jamstack-is-becoming-so-popular-a26133b12a30 %}
Mocking Modules with Jest
Tags: javascript, testing, jest
Published: 2019-10-11 18:43:15

---
title: Mocking Modules with Jest
published: true
description: How do you mock custom modules with Jest.
tags: javascript, testing, jest
---

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/v42b0n0zxxr39kwuignc.gif)

The other day I posted how frustrated I was with mocking a custom module with Jest. https://twitter.com/brianmcoates/status/1182097590126628864

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/9fy6okstimgwv2o413k0.gif)

What I found was in Jest when setting up a custom mock you need to pass the function you are wanting to mock to jest.mock() not the mock that you have created but the actual custom module which is ultimately a function.

If you are also using a function on your MOCK to set the context in your tests you will need to import the actual function you are mocking in your tests that you are writing.

Below is an example of importing and using a custom module in one of my tests.

```
import uuid from '../utilities/uuid';
jest.mock('../utilities/uuid');
```

If you aren't setting context or needing to set up the function in anyway you can just get away with doing nothing! IF you make sure your mocks are living in the right place.

The key here is you have to place your mock adjacent to your custom module. There is an example below and here is the Jest documentation on that as well. https://jestjs.io/docs/en/manual-mocks.html

.
├── utilities
│   ├── __mocks__
│   │   └── uuid.js
│   └── uuid.js
├── node_modules
└── views
    
Hope this was helpful.
A cool JS animation for your websites!
Tags: javascript, css, webdev
Published: 2019-11-01 10:28:44

The GreenSock Animation Platform (**GSAP**) is a suite of tools that allow you to create amazing animations!

We can define GSAP with 3 adjectives fast, robust and compatible just think that over **4 millions** of websites are using it.

This JavaScript library is very powerful, here an example of a pretty cool animation created with GSAP 



{% codepen https://codepen.io/93lucasp/pen/xBQGLv %}

If you want to start using **GSAP** I suggest you to read [this article](https://medium.com/notonlycss/starting-with-gsap-c4142fd95dbe)

I animated [my personal website](https://www.lucaspezzano.com/) with GSAP if you want to give a look
Ubuntu Increase Inotify Watcher (File Watch Limit)
Tags: linux, filewatch, ubuntu
Published: 2019-11-01 10:16:22

---
title: Ubuntu Increase Inotify Watcher (File Watch Limit)
published: true
description: 
tags: linux, filewatch, ubuntu 
cover_image: https://scx1.b-cdn.net/csz/news/800/2019/ubuntu.jpg
---
## Technical Details


> Possible cause of Vue.js hot reload or LiveReload not working and failed file watchers on IDE

Listen uses inotify by default on Linux to monitor directories for changes. It's not uncommon to encounter a system limit on the number of files you can monitor. For example, Ubuntu Lucid's (64bit) inotify limit is set to 8192.

The current default is 8192 (see fs/notify/inotify/inotify_user.c in the kernel source), you can verify this by printing the file to stdout:

```sh
cat /proc/sys/fs/inotify/max_user_watches
8192
```
You can bump the number up, for example, doubling this to 16384, using:

```sh
echo 16384 | sudo tee /proc/sys/fs/inotify/max_user_watches
```
bear in mind that inotify watches do consume memory, I think it's around 160 bytes per watch on 64 bit systems.

To set this permanently, add an entry to /etc/sysctl.conf, for example:

```sh
echo fs.inotify.max_user_watches=16384 | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
```
..or manually edit /etc/sysctl.conf (you need root privileges to update it) and then run 

```sh
sudo sysctl -p
```
Customize Fish Shell
Tags: fish, fishshell, jinagamvasubabu, bash
Published: 2019-11-01 10:16:04


Recently I got a chance to taste the `fish` and I must say it's awesome even though I am totally into bash till now. This Fish Shell is a fully-equipped command line shell that is smart and user-friendly. 

There are multiple reasons to say that it is the best tool and some of them are:
* Intelligent Auto Suggestions
* Themes support
* Scripting support - ` Let's talk about it more!!!`


You can find a hell number of articles about this, but I wanted to stress more on customizing your existing Fish shell. 


One of my biggest questions when I initially started using `Fish` was `how to migrate my existing bash profile to Fish Shell?`. 

The answer is `Fairly Simple` - Easy peasy!!!

### `~/bash_profile:`

```
alias idea='open -a "`ls -dt /Applications/GoLand.app|head -1`"'
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home

function .runElasticSearch() {
  docker run -p 9200:9200 -p 9300:9300 --name elastic -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.4.0

docker run --link elastic:elasticsearch -p 5601:5601 {docker-repo}:{version}

}

function .runZookeeper() {
  cd /Users/vasubabujinagam/Documents/softwares/zookeeper/bin
  ./zkServer.sh start
}

function .stopZookeeper() {
   cd /Users/vasubabujinagam/Documents/softwares/zookeeper/bin
  ./zkServer.sh stop
}

function .runKafka() {
  cd /Users/vasubabujinagam/Documents/softwares/kafka_2.11
  ./bin/kafka-server-start.sh config/server.properties
}
```

This is how fish functions looks like:


### `Fish: ~/.config/fish/config.fish`


```
alias idea='open -a "`ls -dt /Applications/GoLand.app|head -1`"'

set -x JAVA_HOME /Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home 

function .runElasticSearch
  docker run -p 9200:9200 -p 9300:9300 --name elastic -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.4.0

docker run --link elastic:elasticsearch -p 5601:5601 {docker-repo}:{version}
end

function .runZookeeper 
  cd /Users/vasubabujinagam/Documents/softwares/zookeeper/bin
  ./zkServer.sh start
end

function .stopZookeeper 
   cd /Users/vasubabujinagam/Documents/softwares/zookeeper/bin
  ./zkServer.sh stop
end

function .runKafka() 
  cd /Users/vasubabujinagam/Documents/softwares/kafka_2.11
  ./bin/kafka-server-start.sh config/server.properties
end
```

You can see there are not much differences from `Bash` to `Fish`. Happy Fishing!!!
Vue Js 2 - password generator (vue04)
Tags: codepen, vue, javascript, html
Published: 2019-11-01 09:50:35

<p> Vue Js 2 password generator </p>

<p>The codepen result</p>

{% codepen https://codepen.io/FlorinCornea/pen/VwwMxLo %}

<p> I developed a small app for generating random strings in vuejs </p>

<p> I wanted to keep it as simple as possible so the most complex part is the algorithm for generating the "random" string </p>

<p> Let's explain the password generator code </p>

<p> The idea was to generate dynamic passwords based on some options like the length of the generated password and the characters it includes </p>

<p> First i declared what was needed </p>

{% runkit %}

data: function() {
      return {
        characters: [
          {
              name: "Lowercase",
              value: "abcdefghijklmnopqrstuvwxyz",
              checked: false,
          },
          {
              name: "Uppercase",
              value: "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
              checked: true,
          },
          {
              name: "Numbers",
              value: "0123456789",
              checked: true,
          },
          {
              name: "Special Characters",
              value: "_-+=)(*&^%$#@!`~",
              checked: false,
          },
        ],
        password: "",
        gLength: 9,
      }
    }

{% endrunkit %}

<p> After that i made a method that fires when the "Generate" button is clicked. Inside that function i added a loop where i concatenated the values of the checked options for characters</p>
<p>Now that we have our custom options, let's begin the magic :))</p>

<p> The idea is to loop and find a new random character until the length option is acquired </p>

<p> This being said, let's loop as many times as we setted up our generator length </p>

{% runkit %}

  for ( var i = 0; i < this.gLength; i++ ) {
    
  }
{% endrunkit %} 


<p> At each pass we need to add a new "random" character to the result, for this we are going to pick up a character from a specific location using the charAt() function. This function accepts an integer so we need to make sure we are selecting a random one</p>

<p> To make sure we are getting an integer, we are going to use the Math.floor() function, so now we have smth like this:  ourString.charAt(Math.floor()) </p>

<p> Now let's create the random number and for that we are going to use the Math.random() and also we need to multiply it to to the our characters string length to make sure we not get a position that doesn't exist </p>

<p> The code looks like this </p>


{% runkit %}

  for ( var i = 0; i < this.gLength; i++ ) {
    result += charactersVal.charAt(Math.floor(Math.random() * charactersVal.length));
  }
  this.password = result;
{% endrunkit %} 


<p>Different design approach</p>

{% codepen https://codepen.io/FlorinCornea/pen/QWWOqzP %}
9 short stories worth reading
Tags: success, fall, rise, father
Published: 2019-11-01 09:37:53

9 short stories worth reading, feeling and forwarding to all those dear to you

1. FALL and RISE
Today, when I slipped on the wet tile floor a boy in a wheelchair caught me before I slammed my head on the ground. He said, “Believe it or not, that’s almost exactly how I injured my back 3 years ago .

2. A FATHER’S ADVICE
Today, my father told me, “Just go for it and give it a try! You don’t have to be a professional to build a successful product. Amateurs started Google and Apple. Professionals built the Titanic

3. The POWER of UNIQUENESS
Today, I asked my mentor — a very successful business man in his 70’s — what his top 3 tips are for success. He smiled and said, “Read something no one else is reading, think something no one else is thinking, and do something no one else is doing.

4. LOOKING BACK
Today, I interviewed my grandmother for part of a research paper I’m working on for my Psychology class. When I asked her to define success in her own words, she said, “Success is when you look back at your life and the memories make you smile.

5. TRY and YOU shall KNOW
I am blind by birth. When I was 8 years old, I wanted to play baseball. I asked my father- “Dad, can I play baseball?” He said “You’ll never know until you try.” When I was a teenager, I asked him, — “Dad Can I become a surgeon?”. He replied “Son, you’ll never know until you try.” Today I am a Surgeon, just because I tried!

6. GOODNESS & GRATITUDE
Today, after a 72 hour shift at the fire station, a woman ran up to me at the grocery store and gave me a hug. When I tensed up, she realized I didn’t recognize her. She let go with tears of joy in her eyes and the most sincere smile and said, “On 9–11–2001, you carried me out of world trade centre.

7. LOOKING BACK
Today, as my father, three brothers, and two sisters stood around my mother’s hospital bed, my mother uttered her last coherent words before she died. She simply said, “I feel so loved right now. We should have gotten together like this more often.”

8. AFFECTION
Today, I kissed my dad on the forehead as he passed away in a small hospital bed. About 5 seconds after he passed, I realized it was the first time I had given him a kiss since I was a little boy.

9. SHARING
Today, I was traveling in Kenya and I met a refugee from Zimbabwe. He said he hadn’t eaten anything in over 3 days and looked extremely skinny and unhealthy. Then my friend offered him the rest of the sandwich he was eating. The first thing the man said was, “We can share it.”
Analyzing python iterables with all() and any()
Tags: python, beginners
Published: 2019-11-01 19:06:38

---
title: Analyzing python iterables with all() and any()
published: true
date: 2019-11-01 09:32:12 UTC
tags: python, beginners
canonical_url: https://wangonya.com/blog/python-all-any/
---

`all()` and `any()` are built-in functions that help analyze python iterables. 

## `all()`

`all()` returns `True` if **all** elements of the iterable are true (or if the iterable is empty).

```sh
Python 3.7.4

>>> x = [2, 3, 5, 1]
>>> all(x)
True

>>> x = [2, 3, 5, 0]
>>> all(x)
False

>>> x = []
>>> all(x)
True
```

In the second instance, `False` is returned because of the `0` in the list. Note that this would not be the case if the `0` was a string.

```sh
>>> x = [2, 3, 5, '0']
>>> all(x)
True
```

For checking dictionary values,

```sh
>>> x = {'item1': 'pen', 'item2': 'paper', 'item3': 'book'}
>>> all(x.values())
True

>>> x = {'item1': 'pen', 'item2': 'paper', 'item3': False}
>>> all(x.values())
False

>>> x = {}
>>> all(x)
True
```


## `any()`

`any()` returns `True` if **any** element of the iterable is true. If the iterable is empty, it returns `False`.

```sh
>>> x = [2, 3, 5, 1]
>>> any(x)
True

>>> x = [2, 3, 5, 0]
>>> any(x)
True

>>> x = [0, 0, 0, '0']
>>> any(x)
True

>>> x = [0, 0, 0, 0]
>>> any(x)
False

>>> x = []
>>> any(x)
False
```

It also works the same for dictionaries:

```sh
>>> x = {'item1': 'pen', 'item2': 'paper', 'item3': 'book'}
>>> any(x)
True

>>> x = {'item1': 'pen', 'item2': 'paper', 'item3': False}
>>> any(x)
True

>>> x = {}
>>> any(x)
False
```
What Every Developer Must Know About SSL and TLS
Tags: beginners, tutorial
Published: 2019-11-01 09:25:03

---
title: What Every Developer Must Know About SSL and TLS
published: true
description: General concept for SSL and TLS.
cover_image: https://i.ibb.co/Px6tfvP/ll2.jpg
tags: beginners,tutorial,explainlikeimfive,
---

SSL and TLS are often confused as if they are the same thing. But the truth is that SSL is the predecessor to TLS. New versions of TLS came up over the years to enhance security and support advance algorithms. 

#History
TLS was introduced back in 1999 as a new version of SSL 3.0. SSL died in 2014 due to the famous [Poodle Attack](https://en.wikipedia.org/wiki/POODLE). 

##Terminologies:
People still use the terminology of SSL, despite of the fact that it is what TLS that is being used.

The most important or the takeaway of this post if the mechanism of TLS Handshake that takes place between a client and a server.

It is rather a complex concept if we observe under the hood, but let's discuss the general concept for brevity.

##TLS Handshake:


![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/wo4uvkwt81n84hxpgne5.png)


This is also knows as TLS negotiation, after this process is completed the communication starts between client and server.

The first step is when client tries to initiate connection with server over network. Server in response sends a public key with an encrypted certificate (A certificate is a file that is digitally bind with a cryptographic key and signed by CA).The client has a list of valid certificates. The client verifies public key with certificates that it holds, if the public key is invalid and does not align with a certificate on client side the negotiation fails. If that succeeds, the client sends it back in encrypted form with the server's public key.

After the negotiation is successful, client and server communicate over an encrypted channel.


This is TLS handshake in general.


*THIS IS QUITE GENERAL OVERVIEW. THERE IS A TON OF DETAIL, BUT THIS IS TO BE KNOWN TO BE THE LEAST.*


> Good luck with your dev journey and don’t forget to like and share

> Have any questions? just want to say 👋 @MohammadHasham_

*Originally published at muhammadhasham.com/blog*
How To Create Django Models
Tags: django, mysql
Published: 2019-11-01 09:23:12

Create a model field within models.py file

class Contact(models.Model):
    name = models.CharField(max_length=100)
    email = models.EmailField(max_length=100)
    subject = models.CharField(max_length=100)
    message = models.TextField()
    mobile = models.IntegerField(max_length=180)
    created_on = models.DateTimeField(auto_now_add=True)
Associate with settings.py

INSTALLED_APPS = [
    'contact.apps.ContactConfig',
]

Run migrations command

python manage.py makemigrations

Check Migration

python manage.py showmigrations
python manage.py migrate

https://www.youtube.com/watch?v=rugSoarfi58&t=6s

https://realprogrammer.in/how-to-create-django-models/
ng new [in a specific version]
Tags: angular, cli, ng
Published: 2019-11-01 09:16:20

Ever wanted to test out an angular application from a beta version or a release candidate but

    ng new [project]

does always use the latest stable? And 

    ng new --help

doesen`t show up a param to specify a version?

Yeah. Exactly what happened to me. In the post I will share how to do that. 

# Short Story for the busy devs like me

npm version used: 6.12.1
node version used: v12.12.0

You simply install a specific @angular/cli package using npm (or yarn?). I tested with npm to install angular 9rc:

    mkdir angular-9rc
    cd angular-9rc
    npm install @angular/cli@next

where "next" could be a specific older version or a beta tag you will find on npmjs.com: https://www.npmjs.com/package/@angular/cli

After that you are able to use the local installed version using just

    ng new HelloNine

Installation takes quite some time. After all I was able to run the app as usual with 

    ng serve
    ng build
    ng build --prod


So with ivy enabled by default? Following documentation: yes it is. Have a look here: https://next.angular.io/guide/ivy

the 

    ng build --prod 

results in 

![Results in FireFox](https://thepracticaldev.s3.amazonaws.com/i/lyapdlanqxld5xc4i8ra.png)

That`s okay, but I think Ivy could get a way smaller. Thanks for reading!
Larval 6  tutorial
Published: 2019-11-01 08:46:12


In this course, you will learn Larval 6 Functionalities, Laravel 6 CRUD and Laravel 6 Authentication System and many more.

Laravel is an open-source PHP framework, which is robust and easy to understand. It follows a model-view-controller design pattern. Laravel reuses the existing components of different frameworks which helps in creating a web application. The web application thus designed is more structured and pragmatic.

Why We Should Learn Laravel?

Laravel is a first development life cycle and less code functionality
It's easy to learn
Making web applications faster
Configuration error and exception handling
Automation testing work.
URL Routing Configuration is very high in Laravel.
Scheduling tasks configuration and management
It has a huge community
Unlimited resource.
Most importantly it's very easy to get a job if you have Laravel skills.
What you'll learn
 
you can check from my youtube channel

https://www.youtube.com/watch?v=5WHFlzAD2uw&list=PL_o2jYI8ZAeldq-WLItwm4oSbiRsv0kvq