teleren/devto huggingface dataset:
Makers Pre-Course - Week 4
Tags: beginners, ruby, codenewbie
Published: 2019-12-08 19:25:47

So week 4 has come and gone. It was more relaxed that the Ruby challenges we had to complete for the last 2 weeks. 

This week focused on Test Driven Development (something makers seem to swear by)and meeting up with my classmates to pair program. it was great to meet some more of the class i will spending the next 3 months with. 

We quickly worked on a basic Fizzbuzz challenges, reverse coding it to write requirements for the code, then write the code to satisfy the requirements. Initially it felt like a strange way to work, but quickly we realised it left no room for error in the code, and got you thinking about the flow of the code in a more natural way. It was also great to team up and see different points of view, and the different ways my classmates solved the tasks we have been set. Explaining my code somehow left me with a far deeper understanding of the code/problem also, turns out rubber ducking is the way to go!

I am writing this post on Sunday evening instead of the normal Monday - this is because tomorrow is the first day on site! I am equal parts excited and nervous, but up for the challenge and up for the tasks ahead. Going through a couple of ups and downs over the last 4 weeks has me relishing the challenge even more, i cant wait to get into a routine and get stuck in head first.

I will keep a similar style of weekly updates going about my time on site at Makers Academy, fingers crossed it goes smoothly and kickstarts the new career and new way of life I have been hoping for!

As always with me luck!

David
Getting started with Terraform
Tags: terraform, devops, infrastructure
Published: 2019-12-08 18:54:45

*Originally published at [pbhadani.com](https://pbhadani.com/posts/getting-started-with-terraform/)*
<br>
Learn to setup Terraform on your workstation in this step-by-step guide.
<br>
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/f9epjiuj3zaqqwxukzva.jpg)
<center><font size="1"> Photo by [Firdouss Ross](https://unsplash.com/@firdoussross) on [Unsplash](https://unsplash.com)</font></center>

<br>
# What is Terraform?
[Terraform](www.terraform.io) is an open-source tool allows to build, change and version our infrastructure in an easy and efficient way.
It uses declarative language [HCL](https://github.com/hashicorp/hcl) (Hashicorp Configuration Language) to define infrastructure as code.

# Terraform concepts
Let's quickly learn about some concepts in Terraform.

* **Providers**
Terraform Providers enables interaction with APIs and handle authentication of different *IaaS*(e.g. Google Cloud Platform, Amazon Web Service, Azure) or *SaaS*(e.g. Cloudflare). There are many Terraform supported providers already available and a full list can be seen [here](https://www.terraform.io/docs/providers/index.html).

* **Resource**
Terraform Resource is a very important component. Each resource block describes the infrastructure object(e.g. VM instance, Storage buckets, DNS records, Cloud NAT).

* **Modules**
Terraform modules are the collection of resources defined in a way that can be reused.

* **Data Sources**
Terraform Data Sources help to read infrastructure which is created using (or without using) Terraform.

* **State**
Terraform State stores information about the infrastructure created by Terraform code. It is used by Terraform to detect changes in the resources defined in the code.

Terraform state is stored on *local machine* by default in the name of *terraform.tfstate* but can be stored remotely on systems like Google Cloud Storage(GCS), AWS S3.

# Let's setup Terraform
> Below steps are for Linux based system. For MAC, download the relevant package and the rest of the steps should be the same.

1. Download the latest terraform package from [terraform.io/downloads](https://terraform.io/downloads.html).
    ```
export TF_VERSION=0.12.16
wget https://releases.hashicorp.com/terraform/${TF_VERSION}/terraform_${TF_VERSION}_linux_amd64.zip -O /tmp/terraform.zip
```

2. Unzip the terraform binary to a directory which is included in your system `PATH`.
    ```
sudo unzip /tmp/terraform.zip -d /usr/local/bin/
```

3. Reload your shell.
    ```
exec -l $SHELL
```

4. Verify installation.
    ```
terraform --help
```
<br>
Below is the terminal recording:
{% asciinema 284646 %}
*Hope this blog help you get started quickly with Terraform.*
HttpRider :: Using GitHub APIs
Tags: python, api, productivity, testing
Published: 2019-12-08 18:22:19

Here is a sneak preview of [HttpRider](https://github.com/namuan/http-rider), a Rest API client that I'm working on and using it as my primary Rest API client for a while.

In future, I'm planning to write more about the different feature set and what makes it unique across the different products in the same space.

[![GitHub API Demo](https://img.youtube.com/vi/jtoxr10SU6A/0.jpg)](https://www.youtube.com/watch?v=jtoxr10SU6A)

Interested? Have a look at the [README](https://github.com/namuan/http-rider/blob/master/README.md) file for feature list and give it a try. 

Let me know if you have any [issues](https://github.com/namuan/http-rider/issues) or any suggestions for improvement.

> [HttpRider](https://github.com/namuan/http-rider/) is open source and built using Python and PyQT5 so should work across platforms [^footnote].

[^footnote]: I'm mainly using it on Mac but there is nothing which should make it platform dependent.
Gatsby Lander, A Single Page Starter For Gatsby
Tags: react, gatsby, javascript, showdev
Published: 2019-12-08 18:16:52

---
title: Gatsby Lander, A Single Page Starter For Gatsby
published: true
description: Gatsby Lander is an experimental Gatsby Starter built using Tailwind CSS. This is a single page website designed to be used as a landing page.
tags: react, gatsby, javascript, showdev
cover_image: https://thepracticaldev.s3.amazonaws.com/i/idrsrljm6h6oxjhlr9qt.jpg
---

Hey Everyone!

I just finished up this new Gatsby Starter I've been working on called [Gatsby Lander](https://github.com/codebushi/gatsby-starter-lander).

👀 Preview: https://gatsby-lander.surge.sh/
GitHub: https://github.com/codebushi/gatsby-starter-lander

It's built using a Gatsby Theme called [gatsby-theme-codebushi](https://github.com/codebushi/gatsby-theme-codebushi), which includes Tailwind CSS and Emotion.

This is very much an experimental Gatsby site, I was playing with the idea of using Tailwind CSS in a theme, and then using that theme to quickly build out other websites.

If you're interested, please check it out and let me think if this is something you would find useful. Customization is quite easy, but it required knowledge of Tailwind CSS. I could have built more components out of the HTML, but wasn't sure how much that is needed.

As a result of this experiment, I can say that Tailwind CSS is quite awesome and the utility first approach to CSS is something I'll probably stick with for future projects. Thanks for taking a look!
Tk Assistant
Tags: python, beginners
Published: 2019-12-08 16:56:29

I originally wrote this for myself but it may be of use to fellow beginners so I'm sharing it. 
https://github.com/steveshambles/Tk-Assistant

What Is Tk Assistant?

Tk Assistant is a GUI currently containing 45 code modules that will help beginners learn about Tkinters widgets through self-contained examples, and the ability to execute the code quickly from the Tk Ass GUI itself.

Tk Assistant can also be useful for more advanced users not familiar with Tkinter. Looking at and editing the code examples will most surely be the fastest way to learn the basics of Tkinter for anyone, and in future could serve users as a mini Tkinter code database. I hope to add more "squirts" (code examples) in the near future.

Windows-Linux-Mac

This help page is for Tk Assistant V2.0w. The "w" means Windows only, for now. I shall be working on a Linux version soon. However Linux and MAC users can still use the folder of "squirts" independent of the GUI should they so wish.

Related urls:
https://stevepython.wordpress.com/2019/12/08/tkinter-assistant-v2

Tk Assistant help page
https://wp.me/Pa5TU8-24M
How To Start Learning Python *NOW*
Published: 2019-12-08 18:03:39

I see variations on the same question repeated hundreds of times. I want to point everyone to the excellent resources on [python.org](https://python.org) itself. Save yourself a lot of time scouring third-party resources and *start here*:

Step 0: The official Beginner's Guide:

[https://wiki.python.org/moin/BeginnersGuide](https://wiki.python.org/moin/BeginnersGuide)

If you've never programmed before:

[https://wiki.python.org/moin/BeginnersGuide/NonProgrammers](https://wiki.python.org/moin/BeginnersGuide/NonProgrammers)


If you have some programming experience:

[https://wiki.python.org/moin/BeginnersGuide/Programmers](https://wiki.python.org/moin/BeginnersGuide/Programmers)

I *especially* want to direct newbies to the list of ranked and rated learning resources:

[https://hackr.io/tutorials/learn-python](https://hackr.io/tutorials/learn-python)
How to make your first contribution to an Open Source Project
Tags: opensource, github, beginners
Published: 2019-12-08 17:33:56

<em>Yeah! I made my first pull request on GitHub. 😎
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/rkzljhyelsd67598qt6d.png)

Today, I was learning how to use Python Masonite Framework through the docs. Then I noticed something intriguing with the docs. 
There was a missing parameter leading to Error and freezing your application if you were following the doc
So I click on the GitHub button to edit the doc and then made a pull request. 

<h2>1 - You don't need a big issue to contribute</h2>

I thought that the first time I will contribute, I would have to deep inside the code like a terminator and then find a big issue to fix. 
But there a lot of people on GitHub contributing by simply correcting grammar or adjusting icons. 
Just do it even if it’s a simple thing. 

<h2>2 - Be sure to read the code of conduct before contributing</h2>
It’s very important to read the code of conduct ( Don’t worry. They are never that long.) to know how you can express yourself and make your first pull request. 
Also, be sure that the issue doesn’t exist yet or have been resolved before opening a new one.

<h2>3 - Be simple and concise about what you modified</h2>
When making the pull request, you will have to describe what you’ve done. 
Be simple and concise. 
If you need to add more details, there is a description field that you can use and tell more about the correction you are making.

<h2>4 - Now Merge your changes</h2>
I didn’t add that sometimes you must fork the project if you want to make deep modification and see what happens locally and if everything goes well.
For little edits like I made, you can go directly to the project. 
GitHub will automatically fork the project for you and you will able to merge to the master branch and wait core contributors to approve your edits.🤓

Now that’s all. You will just have to wait for confirmation. 
And if you followed the code of conduct, you will get a quick answer. 
That will be noticed on your activity tracker on GitHub. 🤓

<em>Thanks for reading 📖 ! If you have questions on how to contribute on GitHub, you are welcome in the comment section.
ReadFileSync return ENOENT
Tags: help
Published: 2019-12-08 10:49:06

# A bit of backstory #

I'm trying to run an https REST server with express and I'm using webpack to compile and bundle.
Now this is my structure:
```
-dist
-src
 -server
  server.js
 client
  index.html
  index.js
.babelrc
package.json
webpack.config.js
rootCA.key
rootCA.pem
```

I have imported in server.js rootCA.key and rootCA.pem like this:
```
7 import key from '../../rootCA.key';
8 import cert from '../../rootCA.pem';
```
so whenever I build in my dist folder I import those files through file-loader.

# Now to the problem #

When I run the server and those two lines are executed the result is an ENOENT like this:
```
fs.js:114
    throw err;
    ^

Error: ENOENT: no such file or directory, open '/406598dc63994ef30b45f867a314da17.key'
    at Object.openSync (fs.js:443:3)
    at Object.readFileSync (fs.js:343:35)
    at eval (webpack:///./src/server/server.js?:19:21)
    at Module../src/server/server.js (C:\Users\simon\Desktop\CodeProjects\dual-setup\dist\server.js:121:1)
    at __webpack_require__ (C:\Users\simon\Desktop\CodeProjects\dual-setup\dist\server.js:20:30)
    at C:\Users\simon\Desktop\CodeProjects\dual-setup\dist\server.js:84:18
    at Object.<anonymous> (C:\Users\simon\Desktop\CodeProjects\dual-setup\dist\server.js:87:10)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
```

I don't understand what the problem could be as both server.js and the key are in  the dist directory.

# Some configurations #
```
webpack.config.js


const path = require('path')
const fs = require('fs');
const nodeExternals = require('webpack-node-externals')
module.exports = {
  entry: {
    server: './src/server/server.js',
  },
  output: {
    path: path.join(__dirname, 'dist'),
    publicPath: '/',
    filename: '[name].js'
  },
  target: 'node',
  node: {
    // Need this when working with express, otherwise the build fails
    __dirname: false,   // if you don't put this is, __dirname
    __filename: false,  // and __filename return blank or /
  },
  externals: [nodeExternals()], // Need this to avoid error when working with Express
  module: {
    rules: [
      {
        // Transpiles ES6-8 into ES5
        test: /\.js$/,
        exclude: /node_modules/,
        use: {
          loader: "babel-loader"
        }
      },
      {
        test: /\.(pem|key)$/,
        use: {
          loader: 'file-loader'
        }
      }
    ]
  },
  devServer: {
    contentBase: path.join(__dirname, 'dist'),
    compress: true,
    port: 8080,
    https: {
      cert: fs.readFileSync('./rootCA.pem'),
      key: fs.readFileSync('./rootCA.key')
    }
  }
}
```
It should be noted that the command that I use to run the server is as simple as:
```
node ./dist/server.js
```
How to add/remove the ChoiceBox, TextField, and Label when clicking on the Add/Remove button in javaFx.
Tags: java
Published: 2019-12-08 17:19:49

{% stackoverflow 59126351 %}

Can you please tell me how to add the ChoiceBox, TextField, and Label when clicking on the Add button and how to remove it when clicking on the Remove button. Under ScrollPane, under GridPane I added the Add button. when I clicked that button ChoiceBox, TextField, and Label should add below the exiting Field. And Field should remove when clicking on the remove button. Refer this image for clarification

-------------Refer StackOverflow-------------

Thank in advance.
Day 5 - Function Declarations vs. Function Expressions - Learning Node JS In 30 Days [Mini series]
Tags: node, javascript, codenewbie
Published: 2019-12-08 17:11:40

Today's topic is Function Declarations vs. Function Expressions. You can find a graphical view on instagram - 

{% instagram B50YV0GgmDb %}


##Function Declarations
__Function Declarations are normal function we write!__

See an example--

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

##Function Expressions
__The function keyword can be used to define a function inside an expression.__

See an example--

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

##You must ask this in mind Why this is important ?
Because __this pattern__ is __used widely__ in JavaScript, this will help you to __understand and write__ small __functions__ easily inside of a expression.

Finally see both example at once –-

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

###Comment out if you have any question & are you enjoying this series ?


Originally it published on [nerdjfpbblog](https://blog.nerdjfpb.com/day5-nodejsin30days/). You can connect with me in [twitter](https://twitter.com/nerdjfpb) or [linkedin](https://www.linkedin.com/in/nerdjfpb/) !
A map for Machine Learning on AWS (December 2019 edition)
Tags: aws, deeplearning, machinelearning, datascience
Published: 2019-12-08 17:19:11

---
title: A map for Machine Learning on AWS (December 2019 edition)
published: true
date: 2019-12-08 17:11:00 UTC
tags: aws, deeplearning, machinelearning, datascience
canonical_url: https://medium.com/@julsimon/a-map-for-machine-learning-on-aws-december-2019-edition-74891917954b
---

About a year ago, I [published](https://towardsdatascience.com/a-map-for-machine-learning-on-aws-a285fcd8d932) maps for Machine Learning on AWS, which turned out to be extremely popular. Thanks for the vote of confidence!

[AWS re:Invent 2019](https://reinvent.awsevents.com/) is over, and as it brought us quite a few services and features, it was time for me to update them thoroughly.

As before, you’ll find the latest [XMind](https://www.xmind.net) and high-resolution PNG versions on Gitlab: [https://gitlab.com/juliensimon/awsmlmap](https://gitlab.com/juliensimon/awsmlmap).

Enjoy, and please let me know if I forgot anything.

![](https://cdn-images-1.medium.com/max/1024/1*TeyjJ63Llry27WS0-To5sA.png)

![](https://cdn-images-1.medium.com/max/1024/1*FDZ-hy8I8NdCYLF3cz1B2g.png)
Do you listen to music while coding?
Tags: discuss, productivity
Published: 2019-12-08 16:41:19

When you are coding, be that St home or work, do you listen to music?

**If you do**, does it change your productivity in any way?

**If you don't**, why? Do you think it's a distraction, or you simply don't like listening to music while working/coding?


I personally like doing so, whenever I'm coding. If I don't do, I can get bored with it much faster. But if I do, and if I listen to music I really like, I'm enjoying coding much more, **and it boosts my productivity a lot.** I have some playlist that I can't get bored with, and I keep listening to those ones.


Although sometimes I would stop the music, when a bug I can't solve for a longer period of time occurs for example, or when I simply need to solve something complicated, so I can concentrate on nothing but that.

How about you?
FUN with DOM
Tags: javascript, dom
Published: 2019-12-08 15:51:52

Last few days I have been learning JavaScript with the aim of becoming a full stack developer. As I go through this journey, I feel it would benefit me (and hopefully others) if I document my learnings. Thus comes the first installment - DOM (not to be confused with DOMinic Toretto - bad joke? Yeah, probably).


So what is DOM?


Dom is nothing but a model of a document where contents can be treated as objects thus every element of the HTML becomes an object. The model here represents how the objects form a tree-like structure. It represents the document as a node tree, where each node represents part of the document.
In simple words, a web page is a document that can be either displayed in the browser window or as the HTML source but it is the same document in both cases. Document Object Model (DOM) represents that same document so it can be manipulated and the content of the page is stored in DOM and can be accessed and manipulated using Javascript. In order to manipulate the element one has to first select that particular element.


Now, let us see how we can access the contents of a page using DOM(traversing the DOM):


Accessing the elements of the page can be done using various methods like 'querySelector', 'querySelectorAll',getElementsBy*, etc. For example,

var elem = document.querySelector('.check');

Here the document is a predefined object and it represents the entire page that is loaded into the browser. Using this document object we can access various predefined functions and objects. In the above code, we are using querySelector() which returns the first element within the document that matches the specified selector (in this case the class "check").


Manipulation of Content:

In the above example, the elem element is an object representing the targeted div having class "check". Now using this elem we can manipulate the contents of that div and even make this div perform a function. Now let us see what we can do with it.

elem.textContent ="Hello World";
 
In the above code, we have changed the text content which was earlier Lorem to Hello World.

Let us take another example.

let buttonObj = document.querySelector('.button');

Here we are selecting a button by its class and creating an object buttonObj.

buttonObj.addEventListener('click',displayHello);

Let me explain what the above code does. The addEventListener() is an inbuilt JavaScript function that takes the event and also a second argument, a function that gets called every time the event is fired. Thus in our case whenever we click on the button, the function displayHello gets called which is declared as follows:

function DisplayHello(){
   alert("Hello");
}

So every time we click on the button an alert window appears showing a message "Hello World". 

This is just the basic use of DOM, I hope I could provide an insight of what DOM is, how we can access the elements of a web page using DOM and how we can manipulate the contents. For more clarity the following resources can be used:

www.developer.mozilla.org

https://javascript.info
How do you incentivise developers to open small pull requests?
Tags: discuss, git, productivity
Published: 2019-12-08 15:50:16

I often see developers perceiving the curation of a pull request as mere overhead. In the worst case this leads them to open incredibly big (thousands of lines of code) pull requests. Do you care about the size of pull requests? Do you incentivise your teammates to open frequent and small pull requests?
Is dev.to entering eternal September?
Tags: discuss, watercooler, devto, signaltonoise
Published: 2019-12-08 15:42:25

---
title: Is dev.to entering eternal September?
published: true
description: How do we feel about the signal to noise ratio here?
tags: discuss, watercooler, devto, signaltonoise
---

In recent months I have felt that dev.to is becoming quite noisy and simultaneously less friendly to new members, it may be at risk of entering [Eternal September](https://en.wikipedia.org/wiki/Eternal_September), which tends to spell the end of a community.

What do other people feel, and should more moderation or other community management strategies be used?
Extract Custom Hooks
Tags: react
Published: 2019-12-08 15:17:13

First, what's a Hook?

Hooks are the `use`-prefixed functions that we've been using — `useState` and `useEffect`.

Components are the primary building block of React.
Hooks are what give Components interactivity.

## Hooks are composable

We've seen that hooks can be used together to accomplish discreet tasks.

```js
let [componentValue, setComponentValue] = useState(null);

React.useEffect(() = {
  fetchNetworkValue(query).then(networkValue => setComponentValue(networkValue));
})
```

## You can make your own Hooks

Hooks can be extracted into functions just like Components.

```js
function useRequest(query) {
  let [componentValue, setComponentValue] = useState(null);

  React.useEffect(() = {
    fetchNetworkValue(query).then(networkValue => setComponentValue(networkValue));
  })

  return componentValue;
}
```

When we extract custom Hooks, we need to add the inputs and the outputs.

Inputs we take as function arguments.

Outputs we `return` from the function.

In the example above, we take `query` as a function argument and return `componentValue`.

## The power is yours

You're not limited to one argument and return.
You can take many arguments and return any data type.

Explore! The world of Hooks is yours.

## Try it out!

Open this Code Sandbox in your browser and explore custom Hooks.

Assignment Sandbox:
{% codesandbox tixow %}

**Assignment**
1. Declare a new function named `usePokemon`
2. Take `index` as an argument
3. Move the pokemon `useState(null)` hook and `useEffect()` Hooks into the body of that function
4. Return `pokemon` from that function
5. In App, call the new Hook `usePokemon(index)` and assign it's return to the variable `pokemon`

You've just made a custom Hook!

---

Follow the 🧵 on Twitter:
{% twitter 1203690654632574977 %}

Subscribe on YouTube:
{% youtube 9Gmtjp2aEUE %}