teleren/devto huggingface dataset:
Using the html <time></time> element with Angular
Tags: angular, htmltime
Published: 2019-08-25 14:42:58

---
title: Using the html <time></time> element with Angular
published: true
tags: Angular,html time
canonical_url: https://www.leonelngande.com/using-the-html-time-time-element-with-angular/
---

> `<time [dateTime]="'2019-08-09 16:22:20'">8/9/2019</time>`

So had to use the html time element today in an Angular component template and ran into this error:

`ERROR Error: Uncaught (in promise): Error: Template parse errors:`

`Can't bind to 'datetime' since it isn't a known property of 'time'.`

Here’s what my template looked like:

```
<time [datetime]="comment.updated_at">
  {{ comment.updated_at }}
</time>
```

I was baffled, I confirmed on [Mozilla Developer Network](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/time) that the time element has a datetime attribute. Further investigation brought me to [this issue in the Angular repository](https://github.com/angular/angular/issues/26255).

There [Alexey Zuev](https://twitter.com/yurzui?lang=en) explains:

I would say that Angular properly uses time tag.

`<time>` tag with datetime attribute should look like:

```
<time [attr.datetime]="'2019-08-09 16:22:20'">4:22:20 PM</time>
```

while <time> tag with dateTime property is:</time>

```
<time [dateTime]="'2019-08-09 16:22:20'">4:22:20 PM</time>
```

So the take-way point here is the difference between the attribute name and the property name as illustrated by [Pawel Kozlowski](https://twitter.com/pkozlowski_os?lang=en) (a comment on the issue mentioned above):

- attribute name is `datetime`: [https://developer.mozilla.org/en-US/docs/Web/HTML/Element/time](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/time)
- property name (default binding in Angular) is `dateTime`: [https://developer.mozilla.org/en-US/docs/Web/API/HTMLTimeElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTimeElement)

So here’s how my template ended up looking:

```
<time [dateTime]="comment.updated_at">
  {{ comment.updated_at }}
</time>
```
Advices for MVP
Tags: discuss, help
Published: 2019-07-12 23:22:06

Hi friends, how are you?

I feel that I need the advice of the community here, for improve one of the points that I think is really bad on me.

*My short history:* My name is Facundo, I'm from Montevideo Uruguay, and I be a develop by 3 years approximately. I love principally with Ruby on Rails but I have some knowledge about Javascript technologies.

Normally I don't have good ideas to develop apps, or start new project, but when I can someone, it's really difficult to me put it on production. 


Basically I have a problem, I want that the product be perfect at the first day, great design, great UX, great code, maintainable code, and so..

And I'm thinking that all of this things are really complicating me to launch some product/app to the stores.

Then I want advices about how to develop an MVP, that I should focus, what techniques I should follow to go from 0 to product ASAP. It's important a crazy design at first?

I have an idea for an app, and I'm thinking about develop it with React Native for develop to the both platforms at the same time, It's a good idea? Even thought I don't have a great knowledge on React and React native?

Thanks for your advices, I really appreciate it.
Nestjs & Inversion Of Control(IoC)
Tags: nestjs, ioc, javascript
Published: 2019-07-12 08:53:40

Hello friends!
I would like to talk about [Nestjs](https://nestjs.com) and [IoC](https://en.wikipedia.org/wiki/Inversion_of_control). First of all I want to point out that I'm not expert of JavaScript world, but I seek for adapting best practice of coding to my js-projects. 
Nestjs has a great documentation. I got acquainted with it and I saw lots of benefits of using that one. Installing skeleton is easy. I don't want to waste time on showing it. 
Let's get down to describing how to use IoC.
Create a contrived interface:
```ts
interface IContrived {
    say():void;
}
```
Create `ContrivedService` and implement `IContrived` interface:
 ```ts
class ContrivedService implements IContrived{
    say():void{}
}
```
After that to add the service provider for that interface:
```ts
const ContrivedServiceProvider: Provider = {
    provide: 'IContrived',//it's an injectable interface 
    useClass: ContrivedService,
};
```
Add `ContrivedServiceProvider` into `ContrivedModule`:
```ts
@Module({
    controllers: [],
    providers: [
        ContrivedServiceProvider,
    ],
    imports: [],
})
export class ContrivedModule {}
```
It's suffice for using IoC with the help of interface. Last step is to inject our interface. 
Inject `ContrivedService` into `ContrivedController` for instance:
```ts
export class ContrivedController {
    constructor(
        @Inject('IContrived')
        private readonly contrivedService: IContrived
    ) {}
``` 
This is a simple implementation of IoC and the first step towards achieving fully loose coupled design.
If you have any questions feel free to get in touch with me.

Best regards!
Attention Web Scrapers and Pen Testers: Slither is now a PyPI package! 🎉
Tags: python, webscraping, showdev, datascience
Published: 2019-07-12 23:10:15

---
title: Attention Web Scrapers and Pen Testers: Slither is now a PyPI package! 🎉
published: true
description: The Slither web-scraping proxy IP and User Agent cycling library is available on pip!
tags: #python #webscraping #showdev #datascience 
---

Hey data science, web automation, web scraping, and data aggregation folks. Are you tired of needing to purchase proxy IP addresses that get blocked on your goal web asset within a couple of days at most? Do you not yet have your own solution for cycling IP addresses and/or user agents? Do you like super salesy pitches like this one and tend to buy things from QVC after being asked stupid rhetorical questions!?! Well then have I got great news for you!

All kidding aside, I've finally gotten around to uploading my proxy IP and user-agent cycling library Slither to PyPI! To check out the GitHub repo, go [here](https://github.com/kaelscion/slither), for the PyPI page, head [here](https://pypi.org/project/slitherlib/)

Only python 3 is supported and **no support for python 2 is planned**. This is my small way of doing my part to encourage Python 3 use over Python 2. To install it in your next project in a Python-3-only environment:

`pip install slitherlib`

for a multi-distro environment:

`pip3 install slitherlib`

To actually use the library in your scraping projects:

```python

from slitherlib.slither import Snake
from random import choice

import requests

s = Snake()
ip_address = choice(s.ips)
user-agent= choice(s.uas)

headers = {
    "User-Agent": user-agents
}

r = requests.get('https://www.google.com', 
                 proxies={'https': ip_address, 
                          'http': ip_address},
                 headers=headers})
```

At this time, Slither pulls IP addresses and User-Agents from free sources around the web and dump them into two variables, `ips` and `uas`. We add new proxy ip:port sources as we can find them and verify, to the best of our ability, that they are not run by hackers looking to steal IP address information. 

As this project grows, we hope to build it into a full web-scraping suite that easily supports concurrency and multi-processing, ROBOTS.txt support, webdriver browser automation, dynamic mouse-moves, and other goodies that will keep the data-collection enthusiast collecting data more and fighting 403 and 404 codes less!

If you like it, please give us a star on GitHub! I welcome bug reports, feature requests, and any comments or concerns you have so that I can make this library the best it can be! And, as always, I LOVE to collaborate so feel free to open a PR if you have improvements or ideas!
How do you like your rice pudding?
Tags: watercooler
Published: 2019-07-12 22:52:28

---
title: How do you like your rice pudding?
published: true
description: 
tags: watercooler
---

I like rice pudding, but I don't like paying high prices so I've bought up different kinds of rice in an attempt to perfect my rice pudding.

I am trying to make creamy rice pudding in my instapot, but so far online recipes seem to be lying about the cooking time. Where 7 mins on high pressure still yield fibrous rice when using Aborio. 

So I need to do the following:
* compare Aborio vs Carnaroli vs Sushi Rice vs Jasmine vs Cheap No Name Rice
* attempt 3 different cook times in my instapot
* try out condensed milk vs sugar vs coconut milk
* flavouring attempts with rose water vs anise stars vs cardamom
* slow cook via the traditional method (stovetop) vs pressure cooker (instapot)

When I make sweet lassi rose water + roasted cumin works well.
I wonder if this combination would result in good results as well.

When I buy rice pudding I normally purchase Kozy Shack pudding.
I've been trying out Senior Rice as of late.

Everybody says not to use cream which I'm surprised.

Some use egg yolks in their rice pudding but honestly, I don't want my rice pudding to taste like custard. I guess this is just like ice cream where you have Philadelphia style (without yolk/custard) and traditional ice cream.

What about raisins? I don't like them too much in my pudding. Maybe currants. Maybe even blueberries. Ripe papaya would be interesting, a tangelo is a serious curiosity. 

If you never had a tangelo, freshly squeezed it takes how I would expect orange juice to taste.

Do you like rice pudding?
How do you deal with naysayers? (friends, family, colleagues...doesn't matter)
Tags: discuss, watercooler
Published: 2019-07-12 21:41:47

People might try to stop you from progressing, especially if they can't keep up with your progress. 

For example, people who have settled in their lives, but might be important to you so their opinion matters. Do you remember that friend who didn't have more ambitions and dreams in his/her life but wanted you don't have to?

How do you handle such behavior, personally?
What are some small steps we can take to save the environment? 🌎
Tags: watercooler
Published: 2019-07-12 22:37:35

A lot of people think that saving the environment means that you need to completely change your lifestyle and go vegan, devout your hours to picking up trash and only eat organic produce. I applaud you if you do happen to do all of those things, though there are small steps everyone can take to leading a more environmentally conscious lifestyle. Some small changes I have made include things like:

* Bringing a water bottle to work.
* Turning off the water when I brush my teeth.
* Recycling old memes on the work slack channel.
* Bringing reusable bags to the grocery store.

What are some small life adjustments you make to save the environment?
![Captiain Planet](https://media.giphy.com/media/KhlVSyjsbx18A/giphy.gif)
Is Slack (et. al.) Scalable
Tags: discuss
Published: 2019-07-12 22:30:24

---
title: Is Slack (et. al.) Scalable
published: true
tags: discuss
---

I ask because, I find that as the company I work for has grown my desire to use Slack has been inversely-proportional to the number of participants (i.e., "it's trending ever downward").

How do you set up your Slack to make it continue to be useful?
Thoughts on Getting Ranked as a Top Student in University
Tags: university, life
Published: 2019-07-12 21:36:45

## Was it worth it?

HELL NO!!

Each one of us turning around an endless non-stop cycle **like the best group team members of ants**. I am sure you’ve all seen them bringing some food to their homes. 

First, they recognize the smell, energy or whatever they need with their little antenna on top of their heads, then they just go for it. 

And when they find the best piece of food, they show their sharp knives and cut it and take it to their homes. Let's take a look at it… what do they do after?

They KEEP WORKING and **never achieve work-life balance**!

## It won't make any difference in your life

Well, working hard will make many differences in your life.

But, there is a red line between the work that will make your life better, and the work that’ll make you turn around the same cycle; nothing changes… no money, no better life but hey, there is a stress, losing confidence, sacrifice of time and all negative feelings that comes to your mind when you guess why I’m writing this article.

Lemme explain, the ants work for a little meals and store it at their home, for long, really long term use, they’re basically clever than us.

As they say, when you are a normal student you will have time to learn new skills in life. Those little skills are defiantly gonna help you to **drain your battery-life level**.

![battery](https://gadgetstouse.com/wp-content/uploads/2016/01/Battery-drain-smartphones.jpg)

What do we do wrong is, we believe that if your GPA is 3.5 and over, you will be a billionaire 😆 

And in your youth, you just believe that and when you open your eyes, well… you already lost what you had: your precious times, the taste of life!

HELL YEAH, it makes a lot of difference. This shitty university system **takes all the good that you have**.

Shit universities shut your mouth and turn off that little spark inside of your heart that could contribute to the world with the most precious things. Inspiration just vanishes!

## What would I do next?

![cat meme thinking](https://www.meme-arsenal.com/memes/b64fc10123a7b2d1889750b37891e6a7.jpg)

This is type of questions that is hardest to answer.

But, I know what to do; **I won't give a shit to the university system** and similar systems by interacting with more experienced people, by reading a lot, **and by indulging more into real life**.

Life is on our hands. Now lemme tell you that you’ve got two options:

Take it (fight for it) or leave it 😉
I have no idea what level developer I am ¯\_(ツ)_/¯
Tags: beginners, career
Published: 2019-07-12 21:27:26

This is my first time posting on this site, but I really love reading about what everyone else is sharing so I thought I would share as well.

I have been writing code since I first started as a computer science student and to be perfectly honest, I was......terrible at it. I had a lot of friends who immediately picked it up, making me think that I was not cut out for it. I considered dropping out of the program because I was already failing. For some strange reason, I went to my professor and begged her to let me stay in the program. To my surprise, she gave me another chance, and I worked hard to get on track with the other students. Eventually, as the result of many sleepless nights, lots of tea, and some great people on YouTube, I was able to pick up the concepts and graduate with some damn good grades. 

Once I did graduate, I quickly learned that everything I learned in school was not all I needed to know to get a career as a junior developer. I had always thought that junior developer meant that you had some school projects, maybe some passion projects under your belt, and a willingness to learn. I was not expecting to see job postings requiring 2-4 years of experience, mastery of a framework, and the ability to walk on water. 

![Confused person](https://media.giphy.com/media/lkdH8FmImcGoylv3t3/giphy.gif)

I have been out of school for almost 2 years now working at a SaaS company doing software support (writing 💩 tons of SQL, CSS, debugging JS), and I feel like I have grown a lot a developer, though, I still feel like I have no idea what level of developer I am. I read/watch lots of tutorials online and I feel like many of them are directed to teach the basics of programming and I feel like I am having a hard time understanding what really is the difference between a someone who knows the basics and someone who can be the most junior of the developer. 

In the last two years, I have built some projects, I even sold my very first website (available at https://montebellohistoricalsociety.org/), which I was very excited about. I picked up some cool new tools and frameworks. My favorites being Netlify and VueJS. Though after everything, I still feel like I am still not at the level Junior Developer needs to be. At this point in my career I know I am not a beginner, but I still don't know what really is a "Junior Developer".
Around the Web – 20190712
Tags: blog
Published: 2019-07-22 13:55:59

---
title: Around the Web – 20190712
published: true
tags: Blog
canonical_url: https://wipdeveloper.com/around-the-web-20190712/
cover_image: https://wipdeveloper.com/wp-content/uploads/2017/07/WIPDeveloper.com-logo-black-with-white-background.png
series: Around the Web
---

And now for somethings to read (or watch) over the weekend, if you have some spare time that is.

## [2.0.6.7/8 release notes](http://www.illuminatedcloud.com/announcements/2067releasenotes)

**Illuminated Cloud**  – 2.0.6.8 (bug fix reissue of 2.0.6.7) Issue 1339 – The Apex string literal injection support added in 2.0.6.7 caused issues with WebStorm. Those issues should be fixed now, and that feature should work in WebStorm just as in IntelliJ IDEA. Issue…

## [Visual Studio Code Remote Development](https://code.visualstudio.com/docs/remote/remote-overview?wt.mc_id=twitter-social-jopapa)

**Visual Studio**  – Apr 14, 2016 – Visual Studio Code Remote Development allows you to use a container, remote machine, or the Windows Subsystem for Linux (WSL) as a full-featured development environment. You can: Develop on the same operating system you deploy to or use larger or…

## [Netlify Analytics – Accurate insights without performance impacts](https://www.netlify.com/blog/2019/07/10/netlify-analytics---accurate-insights-without-performance-impacts/)

**Netlify**  – Jul 10 – Site analytics bring the ability to understand what content on your site is popular, where traffic comes from, and how many visitors you are serving. It is an important capability for those wanting to measure and improve their sites to perform…

## [A native lazy load for the web platform](https://css-tricks.com/a-native-lazy-load-for-the-web-platform/)

**CSS-Tricks**  – Aug 26, 2018, 11:38 PM – A new Chrome feature dubbed ‘Blink LazyLoad’ is designed to dramatically improve performance by deferring the load of below-the-fold images and third-party <iframe>s. The goals of this bold experiment are to improve the overall render speed…

## [Implementing Private Variables In JavaScript](https://css-tricks.com/implementing-private-variables-in-javascript/)

**CSS-Tricks**  – May 31, 4:07 PM – Ship custom analytics today with Keen.io. JavaScript (or ECMAScript) is the programming language that powers the web. Created in May 1995 by Brendan Eich, it’s found its place as a widely-used and versatile technology. Despite its success, it’s…

## Till Next Week

Want to share something? Let me know by leaving a comment below or emailing [brett@wipdeveloper.com](mailto:brett@wipdeveloper.com)  or following and tell me on [Twitter/BrettMN](https://twitter.com/BrettMN).

Don’t forget to sign up for **[The Weekly Stand-Up!](https://wipdeveloper.com/newsletter/)** to receive free the [WIPDeveloper.com](https://wipdeveloper.com/) weekly newsletter every Sunday

The post [Around the Web – 20190712](https://wipdeveloper.com/around-the-web-20190712/) appeared first on [WIPDeveloper.com](https://wipdeveloper.com).
Anchor links with smooth scrolling
Tags: css, javascript, animation
Published: 2019-07-12 20:35:21

---
title: Anchor links with smooth scrolling
published: true
description: Learn how to achieve smooth scrolling effect for anchor links
tags: css, javascript,animation
---
# CSS solution

Anchor links bring us to sections of a page they link to instantaneously. We can replace this "teleportation" with smooth scrolling animation, using single CSS property:

```css
html {
  scroll-behavior: smooth;
}
```

Unfortunately this [does not work on Safari](https://caniuse.com/#search=scroll-behavior). Truly, safari is a new IE6.

# Javascript solution

Fortunately, we can achieve a smooth scrolling effect with a bit of jQuery code.

The snippet below simulates smooth anchor clicking with all its aspects. Thanks to use of history API, back and forward browser buttons work. If user starts scrolling while the animation is still running, it stops to avoid "fighting" with animation movement.

```js
  $('a[href^="#"]').on('click', function(event) {
    var hash = '#' + $(this).attr('href').split('#')[1]
    var element = $(hash)
    if (element.length) {
      event.preventDefault();
      history.pushState(hash, undefined, hash)
      $('html, body').animate({scrollTop: element.offset().top}, 500)
    }
  });   

  window.addEventListener('popstate', function(e) {
    if(e.state && e.state.startsWith('#') && $(e.state).length){
      $('html, body').animate({scrollTop: $(e.state).offset().top}, 500)
    }
  });

  $('html, body').on("scroll mousedown wheel DOMMouseScroll mousewheel keyup touchmove", function(){
    $('html, body').stop();
  });
```
Strings in Kotlin
Tags: kotlin, todayilearned, beginners, codenewbie
Published: 2019-07-12 20:00:18

* Strings are represented by ***String*** word.

* Strings are immutable. Elements of a string are characters that can be accessed by the indexing operation: `s[i]`.

* Strings can be iterated over with a for-loop.

* You can concatenate strings using the + operator. This also works for concatenating strings with values of other types, as long as the first element in the expression is a string or character.

* You cannot perform a string concatenation operation if a first element in the expression is Number or Boolean.
```
val s = “Hello” + 1234
val s = “Hello” + 11.14
val s = “Hello” + ‘J’
val s =   ‘J’    + “Hello”
val s = “Hello” + true

val s = 1234   +  “Hello”    //Compile time error.
val s = 43.24  +  “Hello”    //Compile time error.
val s = true   +  “Hello”    //Compile time error.
```
* Note that in most cases using string template or raw strings is preferable to string concatenation.

##String Literals
---
Kotlin has two types of string literals:
1. Escaped strings
2. Raw strings

####Escaped String

* **Escaped strings —** They may have escaped characters in them. The escaped string is very much like a java string.
```
val s = “Hello World \n”
```
* Escaping is done in a conventional way, with a backslash.

####Raw String

* **Raw strings —** Raw strings that contain newlines and arbitrary text.
* A raw string delimited by a triple quote (“ ” ”), contains no escaping and you can contain newlines and any other characters:
```
val text = """ This is a Example
       Look How concise it is
       That is the magic of kotlin
"""
```
* `trimMargin()` is a recommended way for indentation in a raw string.

```
val text = """
       | Tell me and I forgot.
       | Teach me and I remember.
       | Involve me and I learn.
       | (Benjamin Franklin)
    """.trimMargin()
```

* By default `|` is used as a margin prefix, but you can choose another character and pass it as a parameter, like `trimMargin(">")`. You can also use `trimIndent()`.

* If you need to represent a literal `$` character in a raw string (which doesn't support backslash escaping), you can use the following syntax:

```
val price = """
${'$'}9.99
"""
```
So, guys, that’s it for strings in kotlin. Feel free to let me know if I missed something.

Till then Keep Coding, Keep Loving. Catch you up in another article.

Jai Hind, Vande Mataram 🇮🇳

Wanna get in touch with me? Here are links. I’ll love to become your friend. 😊

- [My Site] (https://www.jaytillu.in)
- [My Blogs] (https://blogs.jaytillu.in)
- [Twitter](https://twitter.com/jay_tillu)
- [Facebook](https://www.facebook.com/jaytillu.1314/)
- [Instagram](https://www.facebook.com/jaytillu.1314/)
- [Medium](https://medium.com/jay-tillu)
- [LinkedIn](https://www.linkedin.com/in/jaytillu/)
- [Github](https://www.github.com/jay-tillu)
- [Stack overflow](https://stackoverflow.com/users/8509590/jay-tillu)
or just mail me at jd.tillu@gmail.com