teleren/devto huggingface dataset:
Configuring Terraform Templates: Variables and Data Resources
Tags: terraform, cloud
Published: 2020-05-21 08:51:24

---
title: Configuring Terraform Templates: Variables and Data Resources
published: true
description: Learning Terraform: Part III
tags: terraform, cloud
cover_image: https://assets.mkdev.me/posts/covers/000/000/012/original/mkdev_article.png
---
In the third part of the Terraform Lightning Course we are going to learn 2 primary ways of providing configuration to Terraform templates.

{% youtube DVyFV8s7dTY %}

***

**Terraform Lightning Course**

* Part I: [Infrastructure as Code](https://dev.to/mkdev/infrastructure-as-code-and-how-terraform-fits-into-it-40bl)
* Part II: [Terraform Fundamentals](https://dev.to/mkdev/terraform-fundamentals-state-management-and-dependency-graph-creating-the-first-server-1756)
* Part III: [Configuring Terraform Templates](https://dev.to/mkdev/configuring-terraform-templates-variables-and-data-resources-5b99)
* Part IV: [Multi-cloud Terraform Environment](https://dev.to/mkdev_me/creating-multi-cloud-terraform-environment-with-the-help-of-remote-state-backends-and-aws-s3-1l0)
* Part V: [Refactor Terraform code with Modules](https://dev.to/mkdev_me/refactor-terraform-code-with-modules-1o21)
* Part VI: [Learning Provisioners](https://dev.to/mkdev_me/creating-kubernetes-clusters-with-terraform-learning-provisioners-2o6o)

*You can always hire [our mentors](https://mkdev.me/en/specializations) and learn directly from them!*
local constants vs comments
Tags: discuss
Published: 2020-05-21 09:01:43

Consider the following code (c#, but I hope readable for developers of other languages also):
```csharp
bool IsCorrectType(int inputType)
{
    // 2 is the only correct type.
    return inputType == 2; 
}
```

against the following code:
```csharp
bool IsCorrectType(int inputType)
{
    const int correctType = 2; 
    return inputType == correctType;
}
```

Which would you consider more readable, **and why?**

(of course, this is only a simplified example, actual code is more complicated)


For non c# readers: 
`//` is be beginning of a line comment,
and the `const int` in the second code snippet is a local constant - the compiler replaces each occurrence of it with it's value - so performance wise these codes are equal.
Semantic Code Search
Tags: octograd2020, python
Published: 2020-05-21 08:56:51

## My Final Project
A tool that can search over large code corpus directly and list ranked snippets can provide an invaluable resource to programmers looking for similar code snippets using natural language queries. It must have a deep understanding of the semantics of source code and queries to evaluate their intent correctly. Over the years, many tools that rely on the textual similarity between source code and query have proven to be ineffective as they fail to learn the high-level semantic understanding of source code and query. While the previous models for code search using deep neural networks do a good job but, most of them only evaluate their models on only a single programming language, mostly Java. In this project, we propose a novel deep neural network model called UnifiedCodeNet that can handle the intricacies of different programming languages. This model borrows several vital features from different previous models and building on top of those ideas to make a unified model that can generate document vector embeddings from source code, and using similarity search with the query vector embedding can return the most similar code snippets in any language. In the implementation of the model, we leveraged the power of Open Source tools like FAISS, fastText as well as Code Repositories like GitHub to collect code snippets from public repositories using tools/techniques and benchmarks provided by CodeSearchNet.

[Project Page](https://ashwin.dev/semantic-code-search)
Food Calorie Counter
Tags: octograd2020, firstpost
Published: 2020-05-21 08:54:41


**Note:** This is my first post on Dev, so any comments on how it can be improved are welcomed! :)

## Introduction:

Hello World! 
This is a post about one of my projects which I built during my college days. This is part of  `$ git remote <graduation> yearbook`.

## My Project:

<p>The project is an Android application that tracks your daily calorie consumption. To make it easy for the users to log the food items, it uses the smartphone camera to capture the image of the food item, or we can choose an existing image from the gallery. It then detects the food item that is present in the image and the approximate nutrition information in the food item. Once the user chooses that he has consumed the item, it gets added to the database and the calories consumed are updated accordingly. </p>
<p>The user can also set the daily goal for calorie consumption according to his convenience. The app also has charts for the user to easily track his calorie consumption across the week. As an add-on feature, it can also calculate the BMI of the person. </p>

## Link to Code:

All the code for my project is hosted on the following url:

{% github https://github.com/harshshinde07/Food-Calorie-Counter %}

## How I built it: 

<p> Android studio was used along with Java programming language to create the app as it was created some time back. For detecting the food items from captured images, a custom Tensorflow lite model was created and added into the application. To get the nutrition information like the calories, proteins etc. FatSecret API was used.</p>

## Additional Thoughts / Feelings / Stories: 

<p> Although the application lacks some features for it to be production ready, it was fun creating it as a part of the academic activities. I got to learn a lot about how to create custom ML models and incorporate it into the android application, how to use APIs to get data into the application, charting and lot more!</p>

Thanks!
What you need to know about logging in on Binomo
Tags: binomo, binaryoptions, broker, trader
Published: 2020-05-21 08:50:23

The trading platform of Binomo has become increasingly popular among traders almost all over the world. This platform is one of the first and most attractive for both beginners and experienced users who understand the essence of online trading. But let’s figure out how to quickly log in and use the functionality of the site.
https://perfectbinarymentor.com/en/binomo-registration-authorization
The Emergency Alarm System for Earthquakes(EASE) Project
Tags: octograd2020, devgrad2020
Published: 2020-05-21 08:49:08

https://github.com/The-EASE-Project

This is a research project during my education in Pre-Computer Studies at Ateneo de Davao University SHS (2020). Together with co-researchers Alexi Mhyle Aranton, James Bel Carumba, and Jasper Lawrence Caballero, we put up together an automatic alarm system for the purpose of mitigating the current manual activation of emergency alarms and reducing the response time of the school during an earthquake event.

https://github.com/The-EASE-Project/Arduino-Final-Calibration
This C++ file is our project base code for Arduino Uno calibration.

https://drive.google.com/file/d/1bJhjhLapqUAcBRVGIxSCF3-9XBtZkZfx/view?usp=sharing
This is the research paper that encompasses this project entitled, "ADXL-345 MEMS-Based Accelerometer as an Emergency Alarm System for Earthquakes".

It was definitely a fruitful experience. It has become a stepping stone for me to pursue a career in computer science.
HOVER GAMES
Tags: octograd2020, react, python, machinelearning
Published: 2020-05-21 08:45:56

[Comment]: # (All of this is placeholder text. Use this format or any other format of your choosing to best describe your project and experience.)

[Note]: # (If you used the GitHub Student Developer Pack on your project, add the "#githubsdp" tag above. We’d also love to know which services you used and how you used it!)

## My Final Project
HOVER GAMES

## Demo Link
It can be found on https://hover.now.sh

## Link to Code
{% github https://github.com/aedit/Hovergames %}
[Note]: # (Our markdown editor supports pretty embeds. If you're sharing a GitHub repo, try this syntax: `{% github link_to_your_repo %}`)

## How I built it (what's the stack? did I run into issues or discover something new along the way?)
I and a friend of mine, @vbhv98, built it for our Minor Project Submission in the college. The Tech Stack we used for this project is React for the front-end, Python and Flask for the backend, MongoDB for the database management, HTML, CSS and Javascript in the front-end. The frontend is hosted over Vercel and the backend is hosted over Heroku. Both are hosted under free plans.
We faced many issues while developing this project as we both were new to the framework and we're learning its essentials.

## Additional Thoughts / Feelings / Stories
Building the project collaboratively has been a good experience. We started building this project as a substitute for upcoming gaming technologies. Hover Games provide users with an interactive platform where they can play indie games with their hand gestures.

[Final Note]: # (CONGRATULATIONS!!! You are amazing!)
SVG background image workflow
Tags: css, graphics
Published: 2020-07-01 05:19:31

---
title: SVG background image workflow
published: true
date: 2020-05-21 08:45:00 UTC
tags: CSS,Graphics
canonical_url: https://drmsite.blogspot.com/2020/05/svg-background-image-workflow.html
---

I've done a fair bit of work recently using <abbr title="Scalable Vector Graphics">SVG</abbr>s as background images, so I thought I'd better document the sites I use (thanks again [Daniel](https://twitter.com/Wakkos)). I put the original SVG image through SVGOMG! I then paste the resulting, clean, markup into URL-encoder for SVG. Quite a nice and simple process:

1. [SVGOMG!](https://jakearchibald.github.io/svgomg/)
2. [URL-encoder for SVG](https://yoksel.github.io/url-encoder/)
My project for Github Graduation
Tags: octograd2020
Published: 2020-05-21 08:37:17

#**TV Script Generation using RNN**

During studying one of Udacity Nanodegree Program. I was asked to make a project that generates TV scripts using **Recurrent Neural Network**. In the project, [Seinfeld Dataset](https://www.kaggle.com/thec03u5/seinfeld-chronicles#scripts.csv) is used to train a model. The project generates a new "fake" TV script based on the pattern it recognizes in the training data. The project is well-documented so that you will not have any difficulty to understand the code. I hope you like it. 
## Link to the Project
{% github https://github.com/eldorabdukhamidov/TV-Script-Generation-using-RNN %}
🚀 Dynamic Imports (Code Splitting) | ES2020
Tags: javascript, webdev, tutorial, programming
Published: 2020-05-21 08:32:01

---
title: 🚀 Dynamic Imports (Code Splitting) | ES2020 
published: true
description: In this episode learn how to make your apps faster by dynamically loading required files as required rather than one big bundle.
tags: javascript, webdev, tutorial, programming
cover_image: https://imgur.com/TlB6e41.png
---

The  **ES2020**  features were just approved by the  [TC39](https://www.ecma-international.org/memento/tc39-m.htm)  committee, and in the proposal, you can import a file dynamically. What does that mean? Instead of having all your imports at the top of your file, you can import files as you need them and actually just load the data needed as it’s needed. 

We have been doing this for a while with the help of Webpack or other build tools. Having it as a native feature will mean you won’t have to worry about the build tools and you can just focus on creating great applications.

In this video, we will refactor code so you can start using it today.

For more details scroll down. 👇

{% youtube 93R57sLATM4 %}

The static form is preferable for loading initial dependencies and can benefit more readily from static analysis tools and [tree shaking](https://developer.mozilla.org/en-US/docs/Glossary/Tree_shaking).

## Why dynamically import?

Static imports will slow down your application, by dynamically importing you can drastically speed up your load times. By not having one single large bundle you can archive crazy fast applications. This is known as "code splitting" as the code is delivered in smaller bundles as required. 


Another reason you may want to dynamically import is if the module you are importing does not exist at load time.

## How?

To dynamically import a module, the import keyword may be called as a function. When used this way, it returns a promise.

```js
import('/modules/some-module.js')
  .then((module) => {
    // Now you can use the module here.
  });
```

But for a much cleaner `await` keyword.

```
let module = await import('/modules/some-module.js');
```

There are often times where you may never need to import a module (think of an unvisited page in a single page application). We can dynamically import based on user actions too which make dynamic importing super flexible. 

Here's a sample of how you would dynamically load a module when the user clicks an element. 

```js
document.getElementById("button")
.addEventListener("click", async () => {
    const { app } = await import("./app.js");
    app();
});
```

So it's that easy! This can drastically improve your user experience if you can build it into your workflow. 

If you are looking for more information check out the  MDN docs for Dynamic Importing.
🔗 [https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#Dynamic_Imports](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#Dynamic_Imports)

---

[Follow me on Twitter](https://twitter.com/nialljoemaher)

Subscribe on [Codú Community](https://www.youtube.com/c/Cod%C3%BACommunity)
My First Startup Company (E-commerce Website)
Tags: octograd2020, githubsdp, devgrad2020, showdev
Published: 2020-05-21 08:29:59

I recently created a website - 'www.snapitout.studio' where users can buy customized Polaroid images. I started it as a hobby, coded whenever i had time and finally completed it. Thanks to github education plan i got microsoft azure database and a domain for free.

## My Final Project Link

www.snapitout.studio
 
## Link to Code

{% github https://github.com/TheRaptor001/SnapItOut %}

## How I built it 

The website is hosted on a free hosting server as i could afford to pay for it. The details of the users and images to be printed are stored on the database using php and verified using javascript. The payment is done through Razorpay as they were the ones with the least charge.


## Additional Thoughts / Feelings / Stories

Not only was the website beneficial to me but was also able to present it as my college project.
First step towards web-scraping
Tags: octograd2020
Published: 2020-05-21 08:25:51

# Torrent Finder
This is a python program for searching torrent and finding mangnet links. It can copy that magnet link to clipboard for making our work more easy

[Note]: ### (I am used Heroku for deployment of my Telegram bot "@findTorrent_bot" which is the working model of my project,and thanks to Github Student developer pack I got free dynos on Heroku.(#githubsdp)


### Live Link
You can see my telegram bot named Torrent Finder which is the live working of this project. Simply search "findTorrent_bot" on telegram and you will find my bot.
 

### Link to Code
Check the repo on my github. Do not forget to star the repo and follow me for future updates.
 [Torrent Finder](https://github.com/rishab05/Torrent-Finder)

### How I built it
I used BeautifulSoup for scraping the best torrent sites, 1337x and solidtorrents. When you run the search.py it simply ask for you to enter a query and then it start searching for the torrents and with help of beautufulsoup it show you the results(upto 40) and ask to choose and when you choose one it will get you the magnet link. And with the help of python module "pyperclip" it can copy that magnet link to clipboard.

### Reason behind the idea
I love watching movies and season and with the help of Torrent Finder I can easily search for the magnet link of my favourite movie without going to any site or using VPN. It make my work easy and I hope it will helpful for you too.
This is the first version and more features coming soon. 


#### Thanks to read my blog. It is my first blog, please ignore the mistakes.
How to enable MongoDB authentication with docker-compose ?
Tags: mongodb, docker, devops, db
Published: 2020-05-21 08:23:53

By default there is no authentication in MongoDB. It means that it comes with empty authentication. So we should create users and roles manually. There are lots of ways to create MongoDB docker-compose with authentication. The most popular one of them is to write a bash script with user and roles then use it in docker-compose and another way is to create an init-mongodb.js file with users and roles and use it in docker-compose. But in this post, I will show you how you could create MongoDB docker-compose and then add users and roles manually. Lets start...

## **Run MongoDB docker-compose without authentication**

First of all we should run MongoDB `docker-compose` without auth. Using `docker-compose up -d` we could run it.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/uqd2xlbe7m5mmzlglebp.png)

## **Connect MongoDB without auth inside container**

For doing that firstly we should run `docker exec -it mongodb bash` and enter inside the container. Then simply run `mongo` command to connect to mongodb.


## **Create user and roles for our MongoDB**

Firstly we will create admin user with username root and password root in admin database.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/yvuxdragqm624yqrwj3n.png)

Then we need to create other user. Here I will create a demo user within demo database for our MongoDB:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/ac3bqz221coi4t74x1w3.png)

Now we are ready to run MongoDB with auth.

## **Enable MongoDB auth in docker-compose**

In order to enable auth in MongoDB we will use `--auth` flag in docker-compose. After that we could use `docker-compose up -d` command again, to run MongoDB container.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/u8e1j6l02m570wrsm4nw.png)

## **Connect MongoDB with defined authentication**

In this step we can connect our db with defined authentication. Firstly again we need to run `docker exec -it mongodb bash` command in order to enter inside the container. Now we are in so we can connect our db. Here I write 2 command one of them is to connect admin db and another one is to connect demo db.

`mongo -u root -p root --authenticationDatabase admin`
`mongo -u demo -p demo12345 --authenticationDatabase demo`
Open link in a new tab – JavaScript
Tags: javascript, angular, react, vue
Published: 2020-05-21 08:16:06

Opening a link in a new tab has to be a calculated decision as it partially breaks the flow thus impacting user experience. But, it is also important to use this when the information on the new page is either short-lived or something that the user want to see, but at the same time continue scrolling the current page.  

This method can be used in any JavaScript project or any JavaScript oriented libraries (React) or frameworks (Angular).

## Using `<a>` tag  
Using `target` attribute of the anchor tag can be used to open the link in new tab.  

```html
<a href="http://noteshub.co.in/" target="_blank">Open Link in New Tab</a> 
```

The "target" attribute specifies where to open the link. Possible values for the attribute are:  

1. `_blank` : Opens in new tab  
2. `_self` : Opens in the current tab (default)  

There are other possible values for "target" attribute. Please see [here](https://www.freecodecamp.org/news/the-a-target-html-attribute-explained/) or [here](https://www.w3schools.com/tags/att_a_target.asp).  

***  

## THROUGH A FUNCTION  
We will be using the `window` object of JavaScript.  

```javascript
/**
  * Opens the link in new tab
  * @param {string} link - Link to open in new tab
  */
openInANewTab(link) {
  window.open(link, "_blank");
}
```

The catch here is that if the user has blocked pop-ups in his/her browser, then this might not work. The browser does show a warning. If the user allows to show pop-up windows for your domain, it will start working again.  

***  

Originally published on [adityatyagi.com](https://adityatyagi.com)
[CarBlock (A Vehicle History Report System)]
Tags: graduation2020
Published: 2020-05-21 08:19:03

## My Final Project
CAR-BLOCK is a software that provides trusted, genuine and veriﬁable vehicle history reports that will eradicate insecurities within prevailing solutions such as tampered reports and the use of non-OEM spare parts through its secure blockchain network.


## Link to Code
`{% https://github.com/murtrax/CarBlock.git %}`


## How I built it (what's the stack? did I run into issues or discover something new along the way?)
This is a MERN stack decentralized web application with ethereum/solidity smart-contracts. Inorder to run this application:
- Navigate to the root directory
- `npm install`
- `cd client`
- `npm install`
- `cd ..`
- `npm run runApp`
RecoilJS - State Management Library For React - Let's Build An Example App
Tags: react, recoil
Published: 2020-05-21 08:18:35

---
title: RecoilJS - State Management Library For React - Let's Build An Example App
published: true
description: RecoilJS is a new state management library for react made by facebook. In this video we'll build an example application to see how does this library work.
tags: react, recoil
series: React
---

{% youtube hEJdVUwAHPQ %}

RecoilJS is a new state management library for react made by facebook. In this video we'll build an example application to see how does this library work.

Code: https://github.com/satansdeer/recoil-demo

Subscribe to the channel: http://bit.ly/2QZ2UY3
Challenge: Find the least positive missing number
Tags: challenge
Published: 2020-05-21 08:17:20

Find the least positive number missing from a list in linear time with constant extra space 

ex:  
`[1,2,3,4] -> 5`  
`[-1,0,1] -> 2`  
`[-20,3,10,1] -> 2` 

One solution uses linear time and linear extra space. Then there's an extra spicy solution that uses linear time and constant space.  

{% codepen https://codepen.io/swkidd/pen/BaoMapb %}
Dynamic Feedback Management System
Tags: octograd2020, githubsdp
Published: 2020-05-21 08:13:13


[Comment]: # (All of this is placeholder text. Use this format or any other format of your choosing to best describe your project and experience.)

[Note]: # (If you used the GitHub Student Developer Pack on your project, add the "#githubsdp" tag above. We’d also love to know which services you used and how you used it!)

## My Final Project
Our final College Project was to build a Dynamic Feedback Management System.
It was built on MERN Stack, it is used for creating surveys and feedbacks by users and then mail it to recipients email IDs, from there, the recipients can submit their feedbacks straight from the email without tiresome redirections of multiple URLs that everyone hates. It also provided a good way to analyse Customer Responses which can be used to make better decisions for users in the future.

## Demo Link
 [FeedBuzz Project URL](https://feedbuzz-project.herokuapp.com/)

## Link to Code
 {% github SanchitB23/FeedBuzz %}
[Note]: # (Our markdown editor supports pretty embeds. If you're sharing a GitHub repo, try this syntax: `{% github link_to_your_repo %}`)

## How I built it 
I used quite a lot of services from github education like Jetbrains Webstorm, Stripe, SendGrid,Heroku.