teleren/devto huggingface dataset:
HTML Noob Basics
Published: 2019-08-14 10:34:50

## What is HTML?
It is a language that is represented by **<>** tags. HTML is where we decide what to make bold, italic, justified paragraphs and images. 

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

Lets put it into action, create a test.html file in the php_start directory that we have been following. Write the following piece of code.

```
<h1>Hello Noobs</h1>
```
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/krdngi5tpusg4m2xq9qx.png)

Now lets run the file, Great.

This is a heading tag, its starts with <h1> and ends with a forward slash </h1>

Now here is how a proper html file will start 

```
<!DOCTYPE html>
<html lang="en">
   <head>
     <title>Page Title</title>
   </head>

   <body>
      <h1>This is a Heading</h1>
      <p>This is a paragraph.</p>
      <p>This is another paragraph.</p>
   </body>
</html>
```
* __<!DOCTYPE html>__ This defines that this is now HTML5 (It is a latest version of HTML)
* __<html lang="en">__ This defines that it is the base where we start the file, we have also defined the language in it. 
* __<head>__ This section is where we define the title add styles, add scripts and add the meta of the file where we get search engine optimized pages.
* __<body>__ This is where everything becomes beautiful, by styling that which we want to display.

Now lets see some more codes

```
//LINKS
<a href="url">link text</a>

//IMAGES
<img src="path/to/your/image.jpg" alt="title">

//LISTS
<ul>
  <li>Happy</li>
  <li>Still Happy</li>
  <li>Way Happy</li>
</ul>

//PARAGRAPHS
<p>This is the Noob World</p>

//EMBED YOUTUBE
<iframe width="500" height="500" src="https://www.youtube.com/watch?v=dT4A3rttrs8" />
```
[Noob Index](https://dev.to/th3n00bc0d3r/noob-guides-index-4mne)
Entities properties : public, protected or private ?
Tags: discuss, php, laravel, symfony
Published: 2019-08-14 10:33:54

We all write a lot of models and entities, specially when we are working with frameworks like Symfony.


But, when you code them, you have to make a choice for the properties. Should they be public, protected or private ?

Symfony made a choice: private. 
Laravel chose public.

My coworkers, inside our Symfony projects code them either protected or private, with a bunch of accessors.


I prefer the Laravel's way, and always code them with a public visibility.

I made that choice because most of the time (like 99% of the time), **accessors are useless**, they don't transform the data. I prefer access them with `object->property` instead of `object->getProperty()`

And you, what visibility is your default choice, and why ?
Minecraft: Javascript Edition
Tags: minecraft, javascript, github, game
Published: 2019-08-14 10:33:49

I was looking around LinkedIn when I've found [this](https://github.com/ian13456/mc.js?fbclid=IwAR3zhgG5z_6s4oh29kREvtxuDT7KC9ENRzDOaZ31JqHjQb7UOxXC1sesx5s) article about a minecraft porting with threejs, that's crazy guys!
LychenBASIC - anachronistic, Windows-only, BASIC language programming
Tags: programming, basic, windows, dotnet
Published: 2019-08-14 08:42:23

[LychenBASIC](https://github.com/axtens/LychenBASIC) is not cutting-edge; not particularly modern in any way, shape or form; not platform-agnostic; not anything that will make you fall over yourself trying to download, compile and use.

However, as a platform on which to experiment with C#, it's okay. A previous posting, [Action delegate gives Print to VBScript](https://dev.to/bugmagnet/action-delegate-gives-print-to-vbscript-46o8), refers to it, and it uses a technique discussed in another posting, [Adding Assemblies on the fly in C# ClearScript projects](https://dev.to/bugmagnet/adding-assemblies-on-the-fly-to-lychen-2fn7).

Feel free to ignore it as much as you wish.

Meanwhile, I can now run scripts from within the REPL using `RUN "<name of script>"` and I get meaningful error messages if it fails.
Protecting your freelance work
Tags: freelancing, career, webdev, design
Published: 2019-08-14 08:23:28

I was recently contacted by an agency I’ve worked with on numerous projects. Their client disappeared mid-project and had been in touch to ask about some tweaks on their new site.

Confused, the agency checked out the client’s site. The client had outsourced the completion of the work elsewhere, ripping off the design we had created. Not only this, but the client didn’t want to pay for the work as they _hadn’t used it_.

Without getting into the rights or wrongs of the client’s behaviour, it surprised me that the agency’s contract didn’t include clauses that protected them. The contract I use, based on Andy Clarke’s [Contract Killer](https://stuffandnonsense.co.uk/projects/contract-killer/), has a couple of sections that would have strengthened their position.

Let’s look at the two clauses that could have prevented this happening.

## The ‘Kill Fee’

>“If, after project commencement, you stop communicating with me for a period of 180 days, the project can be cancelled, in writing by me, and ownership of all copyrights shall be retained by me. In this scenario, I reserve the right to charge a cancellation fee for the work completed, with the fee based on the stage of project completion. The fee will not exceed 110% of the total project cost.”

This affectionately-labelled cancellation clause protects you from a client disappearing mid-project and puts the onus on them to remain in regular communication.

It has helped me on a couple of occasions, including some situations I hadn’t anticipated. One particular project stalled after kick-off and the client went silent for nine months. My schedule was then too busy to accommodate the project’s completion and this clause ensured I was paid for the work completed.

## Intellectual Property

>“I’ll own any intellectual property rights I’ve developed prior to, or developed separately from this project and not paid for by you. I’ll own the unique combination of these elements that constitute a complete design and I’ll license its use to you, exclusively and in perpetuity for this project only, unless I agree otherwise.”

This would have prevented the agency’s predicament and is a must-have for any creative work.

The clause states that:

1. The client doesn’t own (and can’t use) the design until it’s paid for
2. The design can’t be replicated to create new sites with the same design

In our scenario only the first sentence is relevant, but the second is a valuable consideration for anyone working in design.

## Strengthening your position

Without these clauses, the client-supplier relationship is too heavily weighted in the client’s favour. At any point, the client can disappear, ask their _nephew who builds websites_ to ‘finish’ your work or replicate your design across their company’s network.

Understandably, my colleague was upset by the way their client had treated them, not least as they would not break even on the work completed.

Their contract has now been amended to include these clauses. If yours doesn’t include them, I’d suggest you do the same.
What are your top three vscode configurations?
Tags: discuss, vscode
Published: 2019-08-14 08:23:11

For me it is all about reducing the noise! There are some basic things like the fact that I almost never have two different files open side by side, but here are my favorite configurations:


**Increased line height**

![](https://thepracticaldev.s3.amazonaws.com/i/hadt4fzwhz6y2ntmix7t.PNG)

I like giving each line some space to breathe. I currently have the line height set to 44, but I like to play with the number every now and then.


## Move side bar to the right

![](https://thepracticaldev.s3.amazonaws.com/i/8ig25029chamyidmbjp7.PNG)

I figured, I usually don't need the available space on the right side, my code is mostly on the left side after all, only that the side bar is also on the left side. With the sidebar on the right, it is no longer in the way. The screenshot illustrates this nicely.

## [file utils](https://github.com/sleistner/vscode-fileutils)

![](https://thepracticaldev.s3.amazonaws.com/i/v44yigeaxabf0mnkdkzs.PNG)

One of my favorite extensions. It's just so nice not having to pick up the mouse or writing out the commands in the terminal.

---


There are more things like font ligatures, disabling the minimap, the material icon theme or zen mode, but the three above make my top three.

What are yours? I would love to hear how you configure your editor!
Turn Horizontal lines into a close button
Tags: css, html
Published: 2019-08-14 07:02:28

In this article, I'm going to show you how to turn Horizontal lines into a close button with very minimal coding using simple CSS.

Mostly we will use these horizontal lines to create a mobile menu. We can also call Horizontal lines as Navigation lines.

HTML Code looks like below:

<section class="navlines">
    <span>&nbsp;</span>
    <span>&nbsp;</span>
    <span>&nbsp;</span>
</section>



CSS Code to create Horizontal lines:

<pre>
.navlines {
    width: 24px;
    height: 24px;
    position: relative;
}

.navlines span {
    position: absolute;
    width: 100%;
    border: 1.5px solid #582c83;
    border-radius: 9px;
    transition: all 0.5s ease;
}
.navlines span:nth-child(1) {
    top: 0px;
}
.navlines span:nth-child(2) {
    top: 10px;
    width: 18px;
}
.navlines span:nth-child(3) {
    top: 20px;
}

</pre>
Horizontal lines ready, now we need to convert horizontal lines to close button.

CSS Code to turn Navigation lines to Close button:

<pre>
.navlines:hover span:nth-child(1) {
    -webkit-transform: rotate(45deg);
    -moz-transform: rotate(45deg);
    -o-transform: rotate(45deg);
    transform: rotate(45deg);
    top: 50%;
}
.navlines:hover span:nth-child(2) {
    width: 0%;
    opacity: 0;
}

.navlines:hover span:nth-child(3) {
    -webkit-transform: rotate(-45deg);
    -moz-transform: rotate(-45deg);
    -o-transform: rotate(-45deg);
    transform: rotate(-45deg);
    top: 50%;
}

</pre>

Demo here:

![Navigation Interaction](https://res.cloudinary.com/practicaldev/image/fetch/s--77UnlMTK--/c_imagga_scale,f_auto,fl_progressive,h_420,q_auto,w_1000/https://thepracticaldev.s3.amazonaws.com/i/0jh4pl7lbj8y99oulmob.gif)
React Tldr; Use React.memo() wisely
Tags: react, codequality
Published: 2019-08-14 07:00:35

Use React.memo() when: 

- You want to mimic PureComponent in function components.
- Your component renders often
- Your component is usually provided with the same props during re-rendering
- Your component contains a decent amount of UI elements to reason props equally check

Source: https://dmitripavlutin.com/use-react-memo-wisely/
HOW TO INCREASE EMPLOYEE'S ENGAGEMENT AND PRODUCTIVITY
Tags: discuss, career
Published: 2019-08-14 06:02:23

---
title: HOW TO INCREASE EMPLOYEE'S ENGAGEMENT AND PRODUCTIVITY
published: true
description: a discussion on how to increase your employee's engagement and productivity
tags: discuss, career
---
Only about 40% of workers in the US are engaged at work. As leaders, we want every member of our team to be engaged at work.
Well, how do you keep your employeed motivated,  engaged and productive?
My way is to learn about what they want. Learn about what's important for them. Then try to help them build their dreams while working in your company.

What's yours?
Android Security: Don't leave WebView debugging enabled in production
Tags: android, security, androidsecurity, webview
Published: 2019-08-14 06:00:16

---
title: Android Security: Don't leave WebView debugging enabled in production
published: true
description: 
tags: android, security, android-security, webview
---


WebView debugging can be enabled via `WebView.setWebContentsDebuggingEnabled(true)`. Leaving WebView debugging enabled in production Android apps is a bad idea. Anyone who gets hold of the unlocked phone can access the app’s data forever.


Consider this, the Tripit app exposes WebView debugging and by using that I can read all the files inside the private data directory. As an example, by connecting a user’s unlocked mobile phone to my laptop, I can extract TripIt OAuthToken.

First connect the phone via ADB, open chrome://inspect in the Chrome browser, then enter the following in there.

```
window.location="file:///data/data/com.tripit/shared_prefs/com.tripit.xml"
document.getElementsByTagName("html")[0].innerHTML
```

Now, you can see all the entries like

```
<string name=”oauthTokenSecret”>f731d36cdbf9006f917307…</string>
```
These auth tokens can be copied and used to get permanent access to the user’s TripIt account.

Original post at [ashishb.net](https://ashishb.net/security/android-security-dont-leave-webview-debugging-enabled-in-production/)
Simple libraries do not guarantee simplicity - Rethinking popular NodeJs libraries
Tags: node, javascript, beginners, architecture
Published: 2019-08-14 04:45:18

> Originally posted at [michaelzanggl.com](https://michaelzanggl.com/articles/simple-libraries-do-not-guarantee-simplicity). Subscribe to [my newsletter](https://michaelzanggl.com/) to never miss out on new content.

So often I see people architecturing their projects around low level routing frameworks like expressjs, hapi, koa etc. They often get advertised as "powerful" and are the main resources to develop "robust" web and mobile applications.

Sure it starts of fairly quick, but soon you will be in need of controllers, error handling, accessing a database, an ORM, authentication, authorization, sending mails, caching, validation, and at that point most definitely, a clean architecture to keep everything together. There are of course many other things that you are missing out on such as events, a repl tool, database migrations, ioc container, logging, csrf protection and a way to write tests easily.

Before you know it, you are trapped in spending a huge amount of time hacking together your own framework, rather than writing the application you wanted to build in the first place. Now I don't know what is so robust about that...

![](https://thepracticaldev.s3.amazonaws.com/i/b238nusnt0n2x4ogy5tt.jpg)

I am going to list down some high level alternatives here: (if you know more, let me know)

- https://adonisjs.com/ (inspired by Laravel ❤️)
- https://nestjs.com/
- https://sailsjs.com/

While the inital learning curve is definitely higher, you will benefit from it in the long run. These frameworks can teach you a lot about clean architecture and code, commonly applied concepts, keeping your application secure and how to focus only on the application you set out to build.

Don't get me wrong, I can certainly see how building everything from scratch is a good learning experience, it was for me! But after I have done it one time and wanted to start another application, I didn't really feel like doing it all over again. You should also be very careful with using your custom built authentication system on production.

Another thing would be onboarding, people familiar with the high level framework can immediately jump into coding, rather than spending a day trying to understand the architecture of the project only to fix a small bug. In case they don't know the framework yet, there is at least documentation and blog posts to read about it.

At the end of the day, we want to **build applications** and **be confident** about the code we have written.
Learning Rust by creating a terminal clock - Part 1
Tags: rust, cli, tui, github
Published: 2019-08-14 04:19:21

---
title: Learning Rust by creating a terminal clock - Part 1
published: true
description: Learning Rust by creating a terminal clock. 
tags: #rust, #cli, #tui, #github
series: Learning Rust by creating a terminal clock
---
In the last (and first) post of this series I introduced the Rust project I created to help me learn Rust. The project is a terminal clock.

At that time I had the minute and hour progress bar complete.

Latest update today is I've added the day and month progress bar.

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

I'm basing this project off of https://github.com/rothman857/chronometer which also lists a year and century progress bar which I may also add but I'm not 100% sure on that yet.

I've created a few issues. One which I'm particularly interested in is creating a CI pipeline. Will have to investigate what types of tools are available for Rust (linters, code quality analysis etc...) so if anyone has any ideas please leave a comment.

The code is also in desperate need of a cleanup. I'm in "get it to work no matter how ugly" mode right now so it may be time to take a step back and do some refactoring which should make continuing on with the project more efficient.

Any and all feedback is appreciated. Feel free to log an issue or send a pull request in the repo: https://github.com/bmitch/relogio
Action delegate gives Print to VBScript
Tags: csharp, programming, todayilearned
Published: 2019-08-14 04:09:36

Today I learned about Action<T> delegates, for those situations where there's a void return. 

I'm writing a VBScript version of my Lychen tool and wanted a "Print" command. I could have made a print "sub" and evaluated it into the [VBScriptEngine](https://microsoft.github.io/ClearScript/Reference/html/T_Microsoft_ClearScript_Windows_VBScriptEngine.htm) with [Execute](https://microsoft.github.io/ClearScript/Reference/html/M_Microsoft_ClearScript_ScriptEngine_Execute_1.htm) or [Evaluate](https://microsoft.github.io/ClearScript/Reference/html/M_Microsoft_ClearScript_ScriptEngine_Evaluate_1.htm) and that would have worked fine. But I was wondering if a "function pointer" could be assigned to the [Script](https://microsoft.github.io/ClearScript/Reference/html/P_Microsoft_ClearScript_Windows_WindowsScriptEngine_Script.htm) object with the name "Print". And it turns out you _can_ do that.

First up, it's called a `delegate` not a "function pointer" and these come in two flavours: `Action` for functions that return a `void` and `Func` for ones that return something else. 

So in my Program class I have the following declaration
```csharp
public static VBScriptEngine vbscriptEngine = new VBScriptEngine(WindowsScriptEngineFlags.EnableDebugging);
```
and later, in an initialization routine, I have 
```csharp
vbscriptEngine
    .Script
    .Print = (Action<object>)Console.WriteLine;
```
That bit of magic adds `Print` to the namespace internal to the VBScriptEngine, with said name pointing to the instance of Console.WriteLine that takes one parameter of type `object`.

Not much but it enables things like this (from the REPL mode (VBScript is case-insensitive)):
```vbscript
Lychen>print 1
1
Lychen>print "lukim yu, wantok"
lukim yu, wantok
Lychen>print CS.System.DateTime.Now.ToString("o")
2019-08-14T12:02:12.9315236+08:00
Lychen>
```
Ten Leadership Lessons from The Lion King
Tags: leadership, career, management, culture
Published: 2019-08-14 02:30:38

I leave below a list with lessons about leadership that I took from the movie The Lion King.

1. Leaders need to teach future leaders because they know that time goes by and they have played a very important role, and a well-prepared successor is needed. 

2. While many only want to have and receive the leader will have to offer.

3. It is not necessary to be present at all times but there will be times when the presence of the leader will be indispensable.

4. Only use your authority when it is inevitable.

5. The leader cannot follow all the councils, he will have to know how to analyze and only follow the wise and correct councils.

6. The leader has a lot of influence to change the future, both to improve and worsen the current situation, be wise.

7. If in some moments you don't act like a real leader you can disappoint, always be prepared.

8. Understand that the leader is the reflection of other people and how everyone is highly influenced.

9. The leader has to protect like no one else everything that has been assigned to him.

10. For being seen by many, there may be people who will laugh at his wisdom, the leader will have to be strong.

If you have any consideration or have noticed other details of the movie, please leave your comment.

Thank you for reading!

Best regards,
Daniel Maurer
Facebook Unofficial API + Chatterbot Bot Part 4: Bot see Bot do
Tags: fbchat, chatterbot, python, bot
Published: 2019-08-14 02:25:26

Unless you teach your bot new tricks its going to remain dum. 

Hello everyone. In this tutorial we are going to teach our bot some new tricks

#### Training your chatbot

As i browsed the web i only found two way to train your chatbot:
* Using Listrainer class
* Using chatterbot corpus

#### Using ListTrainer class

##### Import libraries

```
from chatterbot import ChatBot
from chatterbot.trainers import ListTrainer
```

##### Create bot and start training

```
chatbot = ChatBot('Training Example')

trainer = ListTrainer(chatbot)

trainer.train([
    "Hi there!",
    "Hello",
])

trainer.train([
    "Greetings!",
    "Hello",
])
```

Its that simple

#### Using Chatterbot Corpus

According to the documentation:

Chatterbot corpus is a corpus of dialog data that is included in the chatterbot module.

Corpus data is user contributed, but it is also not difficult to create one if you are familiar with the language. This is because each corpus is just a sample of various input statements and their responses for the bot to train itself with.

##### Installing chatterbot-corpus module
```pip install chatterbot-corpus```

In most cases chatterbot-corpus is not installed by default so you have to install it.

##### Using the corpus

Forgive me i am thinking of the corpus callosum right now. I must be mad right?

```
from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer

'''
This is an example showing how to create an export file from
an existing chat bot that can then be used to train other bots.
'''

chatbot = ChatBot('Export Example Bot')

# First, lets train our bot with some data
trainer = ChatterBotCorpusTrainer(chatbot)

trainer.train('chatterbot.corpus.english')
```

All this stuff can be done from a separate file as long as you specify the correct bot name.


#### THE THIRD WAY

![](https://media.istockphoto.com/photos/monk-walking-in-temple-meditating-under-a-tree-at-bangkokbuddhist-in-picture-id820391192?k=6&m=820391192&s=612x612&w=0&h=Nc1WLwkzxynsk5VgpZl4p28-51OvN_uzyyv2qzJSmIM=)


After some experimentation i discovered that the corpus is not that smart, you can get easily detected by someone who knows how you chat. We could use ListTrainer right?

![Heart hell no](https://sayingimages.com/wp-content/uploads/kevin-hart-no-memes.jpg)


You cant anticipate every conversation, it would take you days if not months or years to include every possible use case. So what should do we do? Curse fbchat and chatterbot authors?........Nope

What if we make chatbot take notes silently as we chart. We do the chitty chat chat and chatbot simply learns from the boss. One day when we are confident enough.......We unleash the beast

![](http://www.quickmeme.com/img/47/473564c4aace0860f8ddf9b92523404fc42405fb417651b5996e1d918bcb4a82.jpg)

Until next time. See you next tutorial


Bye bye