teleren/devto huggingface dataset:
Generate unique color code in javascript
Tags: javascript, ux, codequality, codenewbie
Published: 2020-04-17 12:41:51

Photo by Alice Dietrich on Unsplash

> One fantastic way to make something alive is to fill it up with color. 😍

Well, the browser understands colors in the type call hex code *( it's one of them )*. And choosing one is a little hard so what if you have some function that builds that code for you every time. 
 
Before going further, Welcome to you all in a series of JavaScript Useful Snippet series, where I'm sharing sort codes to make development faster and efficient. If you haven't checked the previous episode go to profile and check now *( hit follow too )* otherwise stay tuned till the end 😃 ... 

### getMyColor() ###

When you need a unique hax-code on app loads or any functions call, getMyColor() will work like a charm. It's so simple to use, we need to just call it once and it'll return hex code right on. Well, let me show you what function does... 

```
const getMyColor = () => {
  let n = (Math.random() * 0xfffff * 1000000).toString(16);
  return '#' + n.slice(0, 6);
};
```
In the first line, it's creating a random hex value by using the toString method of javascript. This function is use to convert a string into any format like binary, octal and hexadecimal. So, here I've used it for hexadecimal by passing 16 as an argument. And then once I got random values, I'm slicing 6 characters from it and concatenate with "#" on front. Boom we got hax code created. *( in generating hax code I've used "0xfffff" which is just represent the hexadecimal value  )* 

#### Result will be like: ####

```
getMyColor()  // output: #59dfd0
```

One good use case I did recently with it is, I've set it to an element of DOM to make it random colored, it was fun. Try for [yourself](https://playcode.io/566635).

{% youtube uSg6XMj8qRM %}

Let me know other possible use cases in a comment. hope this will help you, yes? then hit follow 😂
April 17, 2020: What did you learn this week?
Tags: weeklylearn, discuss, weeklyretro
Published: 2020-04-17 12:39:04

Photo by [Avel Chuklanov](https://unsplash.com/@chuklanov?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/s/photos/learning?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)

It's that time of the week again, just a day early. I'm off tomorrow and Monday so posting this now.

So wonderful devs, what did you learn this week? It could be programming tips, career advice etc.

<center>

![Reading a book in windy conditions](https://media.giphy.com/media/fhAwk4DnqNgw8/giphy.gif)

</center>

Feel free to comment with what you learnt and/or reference your TIL post to give it some more exposure.

{%tag todayilearned %}

And remember, if something you learnt was a big win for you, then you know where to drop it as well.👇👇🏻👇🏼👇🏽👇🏾👇🏿

{% link https://dev.to/jess/what-was-your-win-this-week-17ob %}

<center>

![Young kid winning on Jeopardy](https://media.giphy.com/media/2sXf9PbHcEdE1x059I/giphy.gif)

</center>
April 17 — Daily CodeNewbie Check-in Thread
Tags: codenewbie, checkin, beginners, discuss
Published: 2020-04-17 12:28:26

---
title: April 17 — Daily CodeNewbie Check-in Thread
published: true
description: A daily thread to ask questions, share progress, and stay accountable!
tags: codenewbie, checkin, beginners, discuss
series: Daily Checkin
---

You are encouraged to use this daily thread to:
- Ask for help (all questions encouraged)
- Explore topics you’re curious about
- Share something you’ve written or read
- Celebrate your wins
- Stay accountable to your goals
- Support your fellow programmers

Happy Coding!

---

_Interested in joining the twice-weekly live [#CodeNewbie Twitter chats](https://twitter.com/search?q=codenewbie)?  You can find us [on Twitter](https://twitter.com/search?q=codenewbie) each Wednesday at 9pm ET (1am GMT on Thursday) and Sunday at 2pm ET (6pm GMT)!_
Please tell me, you think ruby is a good language for creating a messenger bot ?
Tags: ruby, sinatra, rails, chatbot
Published: 2020-04-17 12:17:04

---
title: Please tell me, you think ruby is a good language for creating a messenger bot ?
published: true
description: I have been practicing ruby for years and I create ruby on rails applications. I want to create a messenger bot and I would like to know if ruby is a good language for that, because many use nodejs and I do not yet have a good level in javascript.
tags: ruby, sinatra, rails, chatbot.
---
teste
Tags: twiliohackathon
Published: 2020-04-17 12:15:59

Medicines(SMS) to old people

In this project, I'll create a platform to send SMS to older people that need some specific medicines and with the problem because COVID-19, it's not a good idea older people walk around pharmacies to try to find some medicines or specific medical things.

The idea is, older people put two contacts (Email, mobile phone, and address) and choose some medicines that he needs.

After this, all pharmacies have a backoffice to see in the city, what the older people need and can send an SMS to notify the person.

Stack:
Backend - AdonisJS (API REST)
Database - MySQL
Frontend - VueJS or NuxtJS

Best regards.
Arrays vs Tuples in TypeScript
Tags: typescript, javascript
Published: 2020-04-17 12:10:08

TypeScript offers JavaScript developers a robust solution to writing bug-minimal code. It offers more types and stronger type checking than JavaScript. We'd explore tuples and arrays in TypeScript.

Typically, a tuple is an array with fixed size and known datatypes. This is to say you'd use a tuple for a static, well-defined array.

## Let's have an example
We have a tuple of primary colors with known values
```ts
const primaryColors: [string, string, string] = ['#ff0000', '#00ff00', '#0000ff'];
```
If we exclude one of the `string` in the definition of the types, we get an error. If we don't include all three primary colours, we also get an error. i.e
Doing this throws an error
```ts
const primaryColors: [string, string] = ['#ff0000', '#00ff00', '#0000ff'];
// throws an error
```
Doing this also throws and error
```ts
const primaryColors: [string, string, string] = ['#00ff00', '#0000ff'];
// throws an error
```

## Using an array instead

If we were to store the same data in an array, we'd simply do this.
```ts
const primaryColors: string[] = ['#ff0000', '#00ff00', '#0000ff'];
```

Note: We can also store other datatypes in a tuple. Here's an example.
```ts
const nameAge: [string, number] = ['Osinachi', 10011];
```
Same as arrays
```ts
const nameAge: (string | number)[] = ['Osinachi', 10011];
```

## Why do we need tuples?
To store data in an unchanging array.

So, tell me other uses of tuples you've come across. If you have never used TypeScript, check out the [docs here](https://www.typescriptlang.org/docs/). If you want an interesting introduction, check out this [Scrimaba tutorial on TypeScript](https://scrimba.com/course/gintrototypescript/enrolled).

Thanks for reading. Let's connect on [Twitter](https://twitter.com/ChukwujamaV) and [LinkedIn](https://www.linkedin.com/in/chukwujama-osinachi/).
Being in Charge
Tags: work, podcast, interview
Published: 2020-05-13 08:39:29

---
title: Being in Charge
published: true
date: 2020-04-17 12:03:33 UTC
tags: Work,Podcast,Interview
canonical_url: https://julien.danjou.info/being-in-charge-10x-engineers-le-podcast/
---

 ![Being in Charge](https://julien.danjou.info/content/images/2020/04/Le-Podcast-header.png)

If you never heard of the 10x engineer myth, it's a pretty great concept. It boils down to the idea where an engineer could be 10x more efficient than a random engineer. I find this fantastically twisted.

Last week, I sat and chat with Alexis Monville in [Le Podcast](https://alexis.monville.com/en/category/podcast/) — a podcast that equips you to make positive change in your organization. [We talked](https://alexis.monville.com/en/2020/04/10/do-you-want-10x-engineers/) about that 10x Engineer myth, and from there we digressed on how to grow your career and handle the different aspects of it.

This was a very interesting exchange. Alexis is actually going to publish a new book next month (May 2020) entitled [I am a Software Engineer and I am in charge](https://iamincharge.club/).

![Being in Charge](https://julien.danjou.info/content/images/2020/04/image-1.png)

Lucky me, this week, I had the chance to be able to read the book before everybody else — which means I actually read _after_ our recording. I understood why Alexis said that a lot of what I was talking about during our podcast resonated with him. I send [a detailed review of the book to Alexis and Michael](https://iamincharge.club/2020/04/16/the-first-review/) if you're curious. I'm definitely recommending this book if you want to stop complaining about your job and start understanding how to pull the strings.

I wish I had this book available 10 years ago! 😅
Daily Developer Jokes - Friday, Apr 17, 2020
Tags: jokes, dailydeveloperjokes
Published: 2020-04-17 12:00:21

---
title: "Daily Developer Jokes - Friday, Apr 17, 2020"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Friday%2C%20Apr%2017%2C%202020"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1259369613c.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit.*

<!-- 
Joke text:
___Q:___ How does a sysadmin keep a fire going?

___A:___ They rotate the logs.
 -->
The Nuxt Loading Progress Bar
Tags: nuxt, vue, loading
Published: 2020-04-17 11:42:46

---
canonical_url: 'https://debbie.codes/blog/nuxt-loading-progress-bar'
---
Nuxt.js automatically gives you a loading progress bar component which is shown between routes. Did you know you can customise it, disable it or create your own component?

To change the colour for example all you have to do is add the colour you want to the loading property in your nuxt.config.js file.

```javascript
export default {
  loading: {
    color: 'blue',
  }
}
``` 
There are many other things you can change such as the height, the duration, the direction for rtl sites and if it should keep animating the progress bar when loading takes longer than the duration.
```javascript
export default {
  loading: {
    height: '10px',
    duration: 1000,
    rtl: true,
    continuous: true,    
  }
}
``` 

If you don't like the progress bar at all you can disable it completely in the nuxt.config.js
```javascript
export default {
  loading: false
}
```
You can also disable it for a specific page.
```html
<template>
  <h1>About Page</h1>
</template>

<script>
export default {
  loading: false
}
</script>
```
And if you want to show loading but don't like the default loading component you can of course create your own. In the components folder create a component called loading.vue.
```html
<template>
  <div v-if="loading" class="loading-page" >
    <p>Loading...</p>
  </div>
</template>
<script>
export default {
  data: () => ({
    loading: false
  }),
  methods: {
    start () {
      this.loading = true
    },
    finish () {
      this.loading = false
    }
  }
}
</script>
<style scoped>
.loading-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: yellowgreen;
  text-align: center;
  padding-top: 100px;
  color: red;
  font-size: 80px;
  font-family: sans-serif;
}
</style>
```
Then in the nuxt.config.js file add the component to the loading property.
```javascript
export default {
  loading: '~/components/loading.vue'
}
```
And that's it you now have your own custom loading component for when changing routes and your content is loading.
What Makes A Great Tutorial?
Tags: discuss, tutorial, writing, beginners
Published: 2020-04-17 11:17:17

Everyone learns in different ways but something you usually can't escape is tutorials for new concepts, but what makes a tutorial great for you?

---

My team and I spend our time jumping around a load of different stacks or pieces of tech to test concepts for the business, build out some prototypes and try and integrate some of the newer ideas into our existing solutions!

To build these ideas out, we end up reading a load of docs, academic papers and combing search results for what the best tutorials or breadcrumbs to start out - over time we've got this down to a fine art. Most of the time, we can quickly pick up a post and decide to move on or keep reading,

There are some standout points that push one a tutorial one way or the other for me are;

- Clarity & communication - how easy it is to read
- Length & depth - is it a simple vertical or a step by step to a specific goal
- Explained code snippets as a % of the content
- Links to further resources & repos

This is my personal preference, and I'm sure everyone has something different, so what makes a __great__ tutorial for you?
Graphics Asset Management Software
Tags: design, webdev, productivity, ui
Published: 2020-04-17 11:00:54

Graphic design <u>organization is hard</u>. But I was lucky enough to get a chance to check out [Eagle App](http://eagle.cool/) recently, which is a cool piece of software which helps organise assets.

{% youtube RmU89OJsE9k%}
<strong>[Youtube: Graphics Asset Management](https://youtu.be/RmU89OJsE9k)</strong>

<em>This is my first sponsored post! I'm really excited to do it, but all reviews and opinions my own!</em>

If you are like me, you probably have <strong>files all over the place</strong>. I have dozens of folders without good labelling with fonts, videos, images and music. I use these on a daily basis to make videos for youtube, research and even just for inspiration. 

But I waste heaps of time looking for them. I honestly have a folder called Dribbble in my Chrome which has hundreds of bookmarks. Their title isn't very specific, and every time I go back to look for something takes me ages to find the file I was looking for.

![Eagle App Adrian Twarog Bookmarks](https://adriantwarog.com/wp-content/uploads/2020/04/chrome-bookmarks.jpg)

So what's the goal here. Well using the application I was able to literally drag and drop most things and have them organised pretty damn quick. But was really cool was the fact that I could search and preview them really fast.

![Eagle App Adrian Twarog Example](https://adriantwarog.com/wp-content/uploads/2020/04/example-eagle-app-adrian-twarog-scaled.jpg)

Simple mouse overs were enough to preview music, and I could even double click on fonts to test them out. 

Some of the features that were cool included:
* Easy simple place for all my photos (or thumbnails!)
* Chrome Extension that lets me drag and drop images to save them quickly
* Search by color, lets me filter images by any shade or tone!
* Preview music by mouse over, with time skip!
* Font previews (on a web-like a screen)

Hopefully, this might help you too! You can check them out on the link below:
https://en.eagle.cool/

## Follow and support me: 
Special thanks if you subscribe to my channel :)
* [🎞️ Youtube](https://www.youtube.com/channel/UCvM5YYWwfLwpcQgbRr68JLQ?sub_confirmation=1)
* [🐦 Twitter](https://twitter.com/adrian_twarog)
* [💬 Discord](https://discord.gg/nGdThpE)
* [❤ Patreon](https://www.patreon.com/adriantwarog)

## Want to see more:
I will try to post new great content every day. Here are the latest items:
* [Adobe XD to Fully Responsive WordPress Site](https://dev.to/adriantwarog/adobe-xd-to-fully-responsive-wordpress-site-16e0)
* [Adobe XD to HTML Full Process](https://dev.to/adriantwarog/adobe-xd-to-html-full-process-ao6)
* [Full Tutorial on how to use SASS to improve your CSS](https://dev.to/adriantwarog/full-tutorial-on-how-to-use-sass-to-improve-your-css-57on)
* [Creating a Mobile Design and Developing it](https://dev.to/adriantwarog/creating-a-mobile-design-and-developing-it-5c4o)
04: Vanilla JavaScript 
Tags: javascript
Published: 2020-04-17 10:55:34

It’s hard to become a strong developer without knowledge of the core of the language itself. Just as you need to understand fundamental principles of the law before you can jump into a particular field of law. This comparison is purely accidental.

I understand that the majority of aspiring web developers want to get hired as soon as possible. I wanted this as well.

It seems much easier to do a crash course on JavaScript basics, jump into some fancy framework, make a ToDo list (let a puppy die), upload it to GitHub, then start looking for a job.

----

##*…but investing time in Vanilla JavaScript will pay off in the long run*
Don’t get me wrong here. I am not biased against JavaScript frameworks in any way. It’s exactly the opposite. Many of them help you to write more readable and maintainable code. They let you write more abstract code that is often easier to debug.

*But the JavaScript ecosystem is evolving pretty fast. New frameworks are being created. New functionalities are being added to the existing ones. And most important, many of today’s hottest frameworks will eventually be replaced, such as Angular 1*

In such circumstances, do you still think that knowledge of a particular JavaScript framework is sufficient for a web developer?

Or is it better to understand how the language which all these libraries and frameworks are based on works under the hood?

---- 
f you posses a solid knowledge of JavaScript fundamentals, the only thing you need to get yourself familiar with when starting to work with a new framework is its syntax. The basic rules will be the same since under all the layers of abstractions. It is still just plain ol’ JavaScript.

If your knowledge is limited only to a single JavaScript framework, you will have a hard time learning a new one. Different frameworks are often based on a different set of JavaScript principles. In the long run you will spend more time trying to understand various frameworks and debugging the code you write in them.

All the JavaScript frameworks and libraries are inevitably based on its Vanilla core.

This should convince anyone that knowledge of a pure JavaScript is a must in the long run. It is a prerequisite for any successful developer, especially for one working mainly in the JavaScript ecosystem.


----
[Is Vanilla JavaScript worth learning? Absolutely.](https://www.freecodecamp.org/news/is-vanilla-javascript-worth-learning-absolutely-c2c67140ac34/)
Get started with a simple application development
Tags: adeleyeayodeji, developer, php, codedeyo
Published: 2020-10-03 14:14:11

---
title: Get started with a simple application development
published: true
date: 2020-04-17 10:35:56 UTC
tags: adeleyeayodeji,developer,php,codedeyo
canonical_url: https://medium.com/@adeleyeayodeji/get-started-with-a-simple-application-development-a31fa63d35c5
---

![](https://cdn-images-1.medium.com/max/1024/1*3PyskNzBJgI0Amd6kk7lyA.png)<figcaption>adeleyeayodeji | androidapp</figcaption>

Get started with a simple application development using a simple framework IONIC along with CORE PHP CRUD. All easy coding

Give it a try: [https://github.com/adeleyeayodeji/PHP-Blog-plus-Android-App-Ionic-Angular](https://t.co/JQzpCHFIIO?amp=1)

[@hackSultan](https://twitter.com/hackSultan)

[@CodifyNigeria](https://twitter.com/CodifyNigeria)

[@WomenWhoCode](https://twitter.com/WomenWhoCode)

[@googledevs](https://twitter.com/googledevs)

[#Stay\_Home](https://twitter.com/hashtag/Stay_Home?src=hashtag_click) [#Stay\_Safe](https://twitter.com/hashtag/Stay_Safe?src=hashtag_click) [#100DaysOfCode](https://twitter.com/hashtag/100DaysOfCode?src=hashtag_click) [#PHP](https://twitter.com/hashtag/PHP?src=hashtag_click) [#javascript](https://twitter.com/hashtag/javascript?src=hashtag_click)
Fine Tuning Resnet34 for a 2 class, classification
Tags: machinelearning, resnet, classification
Published: 2020-04-17 08:34:37

---
title: Fine Tuning Resnet34 for a 2 class, classification
published: true
description: How would you fine-tune a network using a pre-trained Resnet model for a 2 class output
tags: machine learning, resnet, classification
---

This python demo notebook shows how to fine-tune a 1000 class output network to a 2 class output network. The dataset I have consists of 60 data points, 30 for each class (dog and cat images), and 24 data points for validation dataset, 12 for each class.

Python Notebook -
https://github.com/rishiraj824/MachineLearningAlgorithms/blob/master/resnet/resnet34-finetuning.ipynb

Dataset - 
https://github.com/rishiraj824/MachineLearningAlgorithms/tree/master/resnet/data

Basic requirements for training a large network like `resnet` is that you have to choose a valid loss function and an optimizer. For this example, I have chosen a Cross-Entropy Loss which is minimized by my model. This is useful as it already comes with a `Softmax layer` in it, in the `pytorch` library.

I am using the `SGD (Stochastic Gradient Algorithm)` to solve for the minimization and to optimize the model. And then at the end of the trained model, I add a Linear layer which changes the feature sets to 2 classes

```
num_ftrs = model_conv.fc.in_features
model_conv.fc = nn.Linear(num_ftrs, 2)
```

### Observations:

Plotting the Training Loss and the Validation Loss with the iteration shows us how quickly it converged. This was bound to happen as this is a large network and the dataset we used was very small. But since our main objective was to fine-tune the network we were able to achieve that. This code would work for any number of data size. I hope this helped to get a brief idea of how fine-tuning works.
News: Crawler auto-generation tool!
Published: 2020-04-17 09:56:43

The Octoparse 8.1(bate) is Octoparse brand new version, helping to improve the non-programmer's experience of web scraping. The greatest thing about this new version is the crawler auto-generation function.

**Crawler auto-generation algorithm**
Traditionally speaking, if someone wants to create a crawler, he/she should start from learning computer languages, like Jave Script, R, Python or some others and then write the codes with the assistance of the open-source libraries, like Github and Beautiful soup. Or they can choose a web scraping tool to get it done. The topmost popular tools are Octoparse, webscraper.io, and Parsehub, according to their traffic.

![ranking](https://scontent-hkt1-1.xx.fbcdn.net/v/t1.0-9/93529788_538259157091186_1408944195883761664_n.jpg?_nc_cat=103&_nc_sid=730e14&_nc_ohc=0y0iAxLa8s8AX_Y-SgG&_nc_ht=scontent-hkt1-1.xx&oh=951c10f8a6cea17cdf9dffb2ffe9cb7c&oe=5EBDA7D9)

Compared with using computer languages to create a crawler, a web scraping tool could be an easier choice as learning using the tool is easier. To make it easier than easier, Octoparse develops the auto-generation algorithm to empower non-programmers the ability of web scraping. Everyone is able to achieve auto-generating a crawler after entering a URL.


Octoparse 8.1(bate) has been released with the crawler auto-generation function and available for everyone to have it a try!
[Download](https://helpcenter.octoparse.com/hc/en-us/articles/900000557043?dev)


Here're two videos for further references.
https://www.youtube.com/watch?v=s6pirJKtVk0&t
https://www.youtube.com/watch?v=6TWJ2LKGWQk


If you have figure out a better way to create a crawler to scrape data online, please leave your message in the comment area!