teleren/devto huggingface dataset:
Thoughts for the Week - Issue 1
Tags: discuss
Published: 2019-08-08 06:50:02

As a way to decompress 💆‍♂️ from work I write a few notes on the way home. I’ll add some details and related links then they get posted to Twitter [@iamsteveworsley](https://mobile.twitter.com/iamsteveworsley) and collected here for discussion. ⚡️

——

Updating a design system, consuming pattern/component libraries and consuming micro-frontends sure is tricky. More places it can fall over but hopefully with the code split the impact of the issues will be smaller.

——

Anyone else find it hard to provide an immediate and useful update on your work? Or say what you've been doing over the past week if asked out of the blue? [Read more](https://listed.to/@iamsteveworsley/7131/hey-you-what-are-you-working-on)

——

Lift and Shit: performing a Lift and Shift but leaving the re-platformed code in a worse state than it was originally created. Occurs when a lift is rushed resulting in sudden pain and fumbling of the shift. Disappointment is akin to receiving a damaged parcel through the post which you can’t return because the seller has shut-up shop and retired to a farm to start a greenfield project to breed rare Yaks for their wool.

——

A challenge I’ve found with design systems and pattern libraries is finding the time to get competent with the varieties of tooling - beyond just using them as and when needed. Particularly Fractal and Storybook.

——

Interesting projects, a desire to help people and fear of missing out make it hard to say no. I had so much on during the run up to Senior it became extremely stressful. So part of my PDP refresh will be around focus, working on one or two discretionary effort style things and saying “no thanks” more often. Read more on [speed and velocity](https://fs.blog/2018/03/speed-velocity/)

——

I’ve not come across [AHA](https://kentcdodds.com/blog/aha-programming) before (Avoid Hasty Abstractions) 😆 but I’ve certainly come across some bat-shit abstractions and probably a few I wrote my self. 🙈 The Befuddlement Ratio - Every click through you perform in your IDE your intelligence decreases in percent the number of characters used in the abstracted function name.

——

See you next time! 🤩
Dark Side of the Moon : HackerEarth Data Science Competition
Tags: machinelearning, challenge, python, datascience
Published: 2019-08-08 07:52:02

Can you predict the time duration of the lunar eclipse. ---

This challenge is picked from <a href="https://www.hackerearth.com/challenges/competitive/dark-side-of-moon-data-science-competition/?utm_source=devto&utm_medium=devto"> Dark Side of the Moon : HackerEarth Data Science Competition</a>

<b>Problem statement</b>

Consider that you have been recruited as a research scientist at a space station. Now, it is predicted that the next lunar eclipse is going to happen soon on a particular date. The space station wants to live stream the lunar eclipse on social media and show it to all the viewers. 

However, the space station has to plan its social media calendar so that the live streaming of the eclipse doesn’t clash with any other social media activity. Hence, they have asked you to predict the time duration of the lunar eclipse. 

<b>Data set</b>

The dataset contains all the essential parameters that affect the duration of the eclipse. For this particular dataset, the training set includes details such as the date of occurrence of the eclipse, the time difference of the rays to travel during the eclipse, angle of rays during the eclipse, gamma radiation value, and magnitude of both first and second eclipses. 

The benefits of practicing this problem by using Machine Learning techniques are as follows:

This challenge will encourage you to apply your Machine Learning skills to build models that can predict the duration of the eclipse

This challenge will help you enhance your knowledge of regression actively. Regression is one of the basic building blocks of Machine Learning

Your mission, should you choose to accept it, is to predict the duration of the eclipse.

Join the challenge now at <a href="https://www.hackerearth.com/challenges/competitive/dark-side-of-moon-data-science-competition/?utm_source=devto&utm_medium=devto"> Dark Side of the Moon : HackerEarth Data Science Competition</a>
Js Docs
Published: 2019-08-08 07:34:17

---
title: Js Docs
published: true
description: 
tags: 
---

Anyone who has worked with both Python and Javascript here? I feel like JS package documentations are a joke compared to what Python offers.
Just contrast between https://www.npmjs.com/package/jsonwebtoken and
https://pyjwt.readthedocs.io/en/latest/
I'm an ex-bartender/waiter who is now a web developer and DevOps engineer, Ask Me Anything!
Tags: ama
Published: 2019-08-08 07:15:48

---
title: I'm an ex-bartender/waiter who is now a web developer and DevOps engineer, Ask Me Anything!
published: true
tags: ama
cover_image: https://thepracticaldev.s3.amazonaws.com/i/a8s0bjom1djv8ftos1p2.jpg
---
At around the age of 21 I dropped out of uni before getting my bachelor's in physics, and went to work on a crew ship. After that, I spent almost 6 years traveling around and working in hotels and restaurants.
At the age of 27 I "woke up", left my bar manager job at Oxfordshire and worked my way back to tech and programming.

![me back then](https://thepracticaldev.s3.amazonaws.com/i/78995ik600yy8kv6185u.JPG)

2011 Puerto Vallarta. I may look good, but I had tough times on the ship. Not complaining though.
1 week left to win a $75 Amazon giftcard!
Tags: survey, remote, developers
Published: 2019-08-08 06:50:53

---
title: 1 week left to win a $75 Amazon giftcard!
published: true
description: 
tags: #survey #remote #developers
cover_image: https://thepracticaldev.s3.amazonaws.com/i/mb86jcv6c57w1sftkyjx.png
---

Share *your* experience as a **remote developer or technical leader** in our  5-minute “State of Remote Developers” survey. The **survey closes EOD Monday, August 12th**! 

###**[👉 SURVEY HERE](https://codemntr.io/devto-stateofremotedevs)**


Two $75 Amazon giftcards are up for grabs and winners will be contacted mid-August. 🎉
React Tldr; Component Story Format 

Published: 2019-08-08 06:27:31


- Component stories have no dependence on Storybook, so consuming them is as easy as importing an ES6 module
- Built int tools to migrate from storiesOf api to CSF without effort
- Benefits of using: 
	- Writing stories is as easy as exporting ES6 functions from your story file in a clean, standard format
	- Component stories are easily consumed anywhere ES6 modules live
	- Component stories don’t need any libraries other than your components. 
	- The declarative syntax is isomorphic to higher-level formats like MDX, enabling clean, verifiable transformations.
	- Component stories hide Storybook’s underlying API, giving maintainers flexibility to improve Storybook without breaking any contracts.

Source: https://medium.com/storybookjs/component-story-format-66f4c32366df
Want Feedback on my Resume
Tags: career, resume, discuss
Published: 2019-08-08 05:17:49

[This is my resume](https://drive.google.com/open?id=1qjMf_Umeb7Hd7AgYAd5BHP9_-CtyPqwU) want some feedback if it needs any improvements, I had kept it simple one column as I came to know that many companies use ATS to scan the resume which finds difficult to read if it is in two-column.
Best SEO service 2019
Tags: seo, smm
Published: 2019-08-08 04:05:57

                   SEO ( Search Engine Optimization ) 
Search engine optimization is the most important part to build up your business or site. SEO is a valuable process to rank your website in search engine. You can rank your website or blog site or increase traffic by using SEO. You can optimize your website in two ways which have given below:

1. On-page SEO: If you want to rank or optimize your website on-page SEO is the most important part for it. You need to know about the content. That means how to create content for SEO. For example, you need to know about H1 or H2 tag. Then you need to know about admin panel, keywords, and other English grammar. 

After research your target keywords you can create content according to keywords. And enhance your content. Always think about your content because it is the most valuable to rank your website at present. If you have sufficient content according to your competitor’s website. Then you can rank your website very easily. Before optimizing your content you need to see your competitors website. For example, if your competitor’s website has 500 words in 1 post. Then you need to target almost 600 words. Then you can apply off-page optimization. After increasing your DA/PA. You can rank your website and generate traffic for your website. We can say that SEO is part and parcel of digital marketing.

2. Off-page SEO:
Off-page optimization: Off-page, optimization is one of the major parts to rank your website. Without off-page optimization, you can not rank your website on a search engine. If you want to build your website you need to follow some steps.  You can create a backlink for your website. If you want to rank your website very early you need to create some web2.0 then create backlink for your website. If you can get a backlink from any top authority site then it could be very helpful to rank your website. I will discuss in detail in SEO’s part.

If anybody needs SEO's services please visit us. https://freelancetopics.com
Transpile ES5 to ES6/7 (and a gratuitous ad)
Tags: todayisearched, todayilearned, javascript, productivity
Published: 2019-08-08 04:05:41

Today I went looking for a tool that would convert my ".prototype." objects to classes. And *I found one*!

Enter [Lebab](https://github.com/lebab/lebab):

> Lebab transpiles your ES5 code to ES6/ES7. It does exactly the opposite of what Babel does. 

And there's an [online tool](https://lebab.unibtc.me/editor) as well if you're averse to installing yet another npm tool.
What font/s are you using?
Tags: programming, discuss, webdev
Published: 2019-08-08 02:14:10

---
title: What font/s are you using?
published: true
description: Programming
tags: programming,discuss,webdev
---

For me, I am currently using *Monaco*.

![](https://thepracticaldev.s3.amazonaws.com/i/jrlylfjtesjvu0ont3eg.png)



So what are you using my fellow artisans? Share some screenshots 😄


This is also my first post to this amazing community! 🥳
Auto git deploy php script
Tags: git, deployment, webhook, github
Published: 2019-08-08 01:33:16

I've made a sample PHP script to auto deploy git using webhook feature which GitHub, Bitbucket and other servives provide.

Please read the comments inside of deployments.php for the option and how to set-it up.

This deployment script requires certain level of git and server knowledge.

This script is intended for single server use.

Please check it out and test drive, and send me issue or PR to improve the script.

# GitHub Repo

https://github.com/katzueno/git-Webhooks-Auto-Deploy-PHP-Script

# How to set it up

## 1. Set up git

Prepare your git repo

## 2. Set-up server

It is highly recommended to prepare two different domain or subdomains within the same server.
Set-up where you set git deployment script and public area where your actual git deployment.

You must make sure git deploy script is protected with basic auth and SSL.

Obtain all necessary information such as server paths.


## 3. Git clone to the server

### Regular way

- Login via SSH
- cd to the path
- `git clone [GIT PATH]`
    - Make sure you git clone as the same user as web server. If you're using shared host, you may not have to worry about.
    - e.g.,) `sudo -u (nginx|apache) git clong [GIT PATH]`
- Make sure that /.git directory is NOT publicly visible to the web.
    - Apache: add this line to .htaccess: `RedirectMatch 404 /\.git` (mod_rewrite is required)
    - Nginx: add this line to your Nginx config `location ~ /\.git { return 404; }`

### Separate Git Directory and Work Directory (more secure)

Is is very secure way of place git repository outside of publicly visible www root.

- Login via SSH
- cd to the path
- `git clone --mirror [GIT PATH]` to the directory
- `GIT_WORK_TREE=[www_path] git checkout -f [your desired branch]`

## 3. Set your config & upload the file

- Set all necessary config setting inside of deployement.php
    - Read carefully from line 1-45. You won't need to change below `Main Section`
- Upload your `deployment.php` to where you stage your script
    - Make sure to upload in secure area.
    - You may rename filename.

## 4. Set-up a webhook and test drive

Your web hook URL will be like this.
Set it up as webhook of GitHub, Bitbucket, Gitlab or whatever other git services which supports webhook.

```
https://[Basic Auth ID]:[Basic Auth Pass]@example.com/deployments.php?key=YourSecretKeyHere
```
and enjoy the rest of auto deployment.
Let's Create Own Simple Command 002
Tags: productivity, bash
Published: 2019-08-08 01:13:07

Sometimes we want to know our global IP address. Actually, we can check with googling `ip address`, but why need to open Chrome for that???
(I guess most people are using Chrome for something while they are working, but still need to open a new tab)


### Step 1 Create bash/zsh file
```
$ cd
$ mkdir .sh <-- if you don't have this
$ vim gip.sh
```

```zsh
#!/usr/bin/env zsh
curl http://checkip.amazonaws.com/
```
### Step 2 Add a new alias
`.zshrc`
```
alias gip="~/.sh/gip.sh"
```

### Step 3 Test
`test`
```
$ gip

111.111.111.111 <-- you will see your global ip address
```
Planning vs Execution
Tags: productivity, agile, career, feeling
Published: 2019-08-08 00:26:16

In fact, everyone who spends more time thinking and planning than they do is valuing the wrong thing. 

We believe that planning will eliminate risk and waste but we have to be careful because planning too much can be a trap. I say this because planning brings a decreasing return, that is, the more we do something, the less value it will generate. We need to plan up to a certain point but soon after comes the time to present this planning to the world and execute so that at that moment we can get the feeling of execution.

The world turns in a very different way than we think but in our planning we are biased and try to shape the world for the ideal scenario and then we need the feeling of the thing.

The value of any idea is in the execution and not in the planning, what do you think about it?
[Video] Single Page Apps at Amazon Scale
Tags: video, javascript, spa, cascadiajs2018
Published: 2019-08-08 00:06:08

---
title: [Video] Single Page Apps at Amazon Scale
published: true
description: Many modern web applications are built as single page apps (SPA), with the goals to scale the application for customers, increase developer velocity for feature development, and speed up new team member ramp up time. In this talk we will share top 5 lessons learn - in hindsight, what would we do/don’t do when building a large scale SPA.
tags: video, javascript, spa, cascadiajs2018
---
*As we lead up to [CascadiaJS 2019](https://2019.cascadiajs.com), I'm going to share the 24 amazing talks from 2018 here on dev.to. Sit back and enjoy the show!*

# Patrick Woo
![Patrick Woo](https://2018.cascadiajs.com/speakers/patrickwoo.jpg)

Many modern web applications are built as single page apps (SPA), with the goals to scale the application for customers, increase developer velocity for feature development, and speed up new team member ramp up time. In this talk we will share top 5 lessons learn - in hindsight, what would we do/don’t do when building a large scale SPA.

[Watch the talk on YouTube (16:25)](https://www.youtube.com/watch?v=Zr51LyznkZI)
The Ideal Developer
Tags: rant, developer, interviewquestions, hiring
Published: 2019-08-05 20:21:39

####Skill Set

 - 30% (Problem Solving) Think and solve problems by Q&A, research, and experience / Use new concepts or paradigms when appropriate / Pulling it all together.
 - 20% (Organization) Getting things done / Document your Work & Code
 - 15% (Soft Skills) Collaborator / Seek patterns that work for all / Communicate
 - 15% (The Language) Should have at least researched it before an interview... :)
 - 10% (Learning/Sharing) Ability and willingness research and experiment / Learn from others / Ability to apply new Concepts and share with team
 - 10% (Experience) without Ego / Knowledge & Breadth
 - 0% - (Code a bubble sort algorithm) not even in my top 100 requirements

####What am I asking myself...

 - Can this person bring something to the table that will not only achieve our business goals but also reduce friction in our team and to our processes?
 - Can this person bring experience to our organization without the ego or know-it-all attitude?
 - Can this person find a library with a bubble sort algorithm? (It is a huge waste of resources having a team write code that can be found in a common library)

####Better interview questions might include:

 - "Tell me about the bubble sort and binary tree. Where and why would you use it?
 - "What is the difference between a binary tree and linked list?".  "When might you use one over the other?" (trying to determine what and how much you know - similarities, differences, how you apply knowledge, logic, your modus operandi)

#### The Bottom Line 
I assume and trust that if you can compare and contrast items and understand how and where it applies, I'll trust that you can use a library or code it.

**For the most part, code efficiency questions are a thing of the past.**

... Just my two cents
Binary Search  in JS
Tags: showdev, algorithms, computerscience, javascript
Published: 2019-08-09 03:18:12

---
title: Binary Search  in JS
published: true
tags: showdev, algorithms, computer science, javascript
canonical_url: https://atila.fassina.eu/binary-search/
---

Binary search is a very powerful algorithm for finding results on datasets of any size. Though, with such performance comes also one important required for it to work properly: the list **must** be sorted. Another fundamental requirement is knowing the number of items within said list, but in JavaScript-land this is a given.

### How it works

The mechanism is quite simple actually: the `array` is broken into 2 halves, which leads the program with 2 range of sorted values (already half of the size of initial set). Now, the program checks into which range of values the target value belongs.And, subsquentially it executes again until the searched value is on either end of the `array`.

### The code

Let's see how a Binary Search could be implemented in Typescript:

- `list`: the sorted `array`.
- `value`: the target value to be found.
- `start`: the `index` in which the current iteration shall commence.
- `stop`: the `index` in which the current iteration shall terminate.

- `@return`: the index of the found target

```ts
const binarySearch = (
  list: number[],
  value: number,
  start = 0,
  stop: number
):number {
  // `start` can be defined, but will default to `0`
  // as it is the first defined value of any array

  // if undefined, `stop` becomes the index of the last item
  stop = stop || list.length - 1
  // `middle` is the mean between `start` and `stop`
  const middle = Math.floor((start + stop) / 2)

  // if middle is not the target value
  if (list[middle] === value) return middle
  if (value < list[middle]) {

    // defines the `stop` value for the next iteration
    stop = middle - 1
  } else {

    // defines the `start` value for the next iteration
    start = middle + 1
  }

  // binarySearch calls itself again with the newly set values
  return binarySearch(list, value, start, stop)
}
```
_thanks Curtis Fenner for the improvement suggestions!_


## Shameless plug

I have a personal playground where I plan to implement some Computer Science basics in JavaScript. With good test coverage and some insights on when/why to use each concept. Check out my [binary search implementation at the FUNdamentals repository](https://github.com/atilafassina/fundamentals/blob/master/src/binarySearch/index.js).
SQL or NoSQL - How to choose one based on what they offer
Tags: database, showdev, nosql, sql
Published: 2019-08-10 08:12:53

---
title: SQL or NoSQL - How to choose one based on what they offer
published: true
tags: ['database', 'showdev', 'NoSQL', 'SQL']
series: Awesome talks curated by Param
canonical_url: https://learnwithparam.com/tech-talks/how-to-choose-sql-or-nosql-for-beginners/
description: Know how to choose which database for your next project by going through the differences between SQL and NoSQL. What are all the pros and cons for both.
---

In this video, you will know how to choose which database for your next project by going through the differences between SQL and NoSQL. What are all the pros and cons for both.

Very good video for beginners who don’t have clear understanding on what pros and cons we have in SQL and NoSQL. This video doesn’t talk about which is better without context, instead it talks about how both database can be used based on different product need.

{% youtube ZS_kXvOeQ5Y %}

You can check out [data modelling in NoSQL](https://learnwithparam.com/tech-talks/modelling-data-for-nosql-databases) to go deeper on how to model your NoSQL data.
Why you should always HTML encode your input
Tags: webdev, php
Published: 2019-08-07 23:52:37

The website you just built might be a beautiful, well-coded masterpiece but the time it may take to break/crash is not very long without this piece of code.

You probably already heard of the topic: website security.
I will show you a simple trick that will work as a defense against hackers that try to break in or exploit your website using 'xss' (cross-site scripting).

Of course this is just a basic countermeasure and if you want to know more, google will guide you by typing in xss ;) . Also, this is my first post here so any advice or suggestions regarding my post are always welcome.

Now onto the more interesting stuff:

Let's say for example you have a section on your website where you ask for the user's input and show that exact input back to them (think of comments on a blog, etc). If we didn't sanitize the input given by the user, we would have a lot of problems.

What if the user were to type in "<script>alert('oops')</script>" for example?
Well, the comment that the website will show back will contain that very string which in fact will show nothing (an empty comment), what it will however do is give every user on the page a pop-up saying "oops".
Now, this is all very fun and not too serious yet, because the hacker could also start loading in malicious scripts and start modifying the page.

Now, take a look at this little test website:

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

This website will take whatever the user types into the input box and show it into a div below that box.

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

To sanitize that input in PHP is very simple, in fact we only need to use 1 function: htmlspecialchars();
 Take a look at the following code snippet:

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

Now let's test it.

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

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

But what happened behind the scenes?

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

PHP changed '<' into '& lt;' and '>' into '& gt;'. Now HTML can properly show these characters without thinking it is an actual tag.

So there we go, we made our first step to a safer website!

Thank you for taking your time to read my post!