teleren/devto huggingface dataset:
Ask Dev: Full Stack app or JS Frontend powered by API backend? 
Tags: laravel, vue, nuxt, discuss
Published: 2018-09-17 00:02:15

---
title: Ask Dev: Full Stack app or JS Frontend powered by API backend? 
published: true
description: Discussion on benefits of Universal/Progress web apps vs full stack apps.
tags: Laravel, VueJS, NuxtJS, discuss
---

Hey devs!

I am looking to start a new side project, for which I now have a clear idea of what it needs to do, some nice designs and a fitting market I think. I am excited to get started, but I want to decide on the architecture.

In the past I have built many web apps using different technologies, and lately I've been using Laravel with VueJS and absolutely loving the speed and dev experience. Highly recommended.

However, I cannot ignore the awesomeness of universal/progressive web applications. Mainly, I am looking at NuxtJS powered by Laravel API. 

The reason why I am writing this is because I am looking for other good reasons to go with NuxtJS + API backend route. Has anyone done this before and seen benefits or is it just hype? Any other good reasons apart from having offline page and ability to install the app?
Why you should wrap your (JavaScript) dependencies
Tags: javascript, npm, webdev, patterns
Published: 2018-09-17 14:11:58

---
title: Why you should wrap your (JavaScript) dependencies
published: true
tags: javascript, npm, webdev, patterns
canonical_url: https://codewithhugo.com/why-you-should-wrap-your-javascript-dependencies/
---

> An email sending example.

- [Example using SendGrid](#example-using-sendgrid)
- [How do we consume this?](#how-do-we-consume-this)
- [Switching to another email provider](#switching-to-another-email-provider)

> This was sent out on the [Code with Hugo newsletter](https://buttondown.email/hugo).
> [Subscribe](https://buttondown.email/hugo) to get the latest posts right in your inbox (before anyone else).

## Example using SendGrid

On a very basic level, we want to be able to send emails.

In code terms, we want a `send` function. What’s nice to have is a way to abstract the message creation, that’s a `makeMailMessage` function.

See the following code:

```js
const sgMail = require('@sendgrid/mail');

const {
  SENDGRID_API_KEY,
  EMAIL_OVERRIDE_TO_ADDRESS,
  EMAIL_FROM_ADDRESS
} = process.env;

sgMail.setApiKey(SENDGRID_API_KEY);

function makeMailMessage ({
  to,
  from = EMAIL_FROM_ADDRESS,
  subject,
  text,
  html
}) {
  return {
    to: EMAIL_OVERRIDE_TO_ADDRESS || to,
    from,
    subject,
    ...(html ? { html } : { text })
  };
}
function send (message) {
  return sgMail.send(message);
}
module.exports = {
  makeMailMessage,
  send
};
```

## How do we consume this?

```js
function doSomeSending(name, email) {
  const message = makeMailMessage({
    from: 'hi@codewithhugo.com',
    to: email,
    subject: 'Welcome to Code with Hugo',
    text: `Hi ${name}, welcome to Code with Hugo.`
  });
  return send(message); 
}
```

## Switching to another email provider

Say we want to switch to another provider, namely Mailgun. Ideally, we don’t want to change any of the application code.

```js
const {
  MAILGUN_API_KEY,
  EMAIL_DOMAIN,
  EMAIL_OVERRIDE_TO_ADDRESS,
  EMAIL_FROM_ADDRESS
} = process.env;
const mailgun = require('mailgun-js')({
  apiKey: MAILGUN_API_KEY,
  domain: EMAIL_DOMAIN
});

function makeMailMessage ({
  to,
  from = EMAIL_FROM_ADDRESS,
  subject,
  text,
  html
}) {
  return {
    to: EMAIL_OVERRIDE_TO_ADDRESS || to,
    from,
    subject,
    ...(html ? { html } : { text })
  };
}

function send (message) {
  return new Promise((resolve, reject) => {
    mailgun.messages().send(message, (error, body) => {
      if (error) {
        return reject(error);
      }
      resolve(body);
    });
  });
}

module.exports = {
  makeMailMessage,
  send
};
```

The API for our `mail` module stays the same, but we’ve changed the provider under the hood 👍 .

[Samuel Zeller](https://unsplash.com/@samuelzeller?utm_medium=referral&utm_campaign=photographer-credit&utm_content=creditBadge "Download free do whatever you want high-resolution photos from Samuel Zeller")
MY Top 5 youtube channels (code version)
Tags: youtube, dev, beginners
Published: 2018-09-16 23:11:25

---
title: MY Top 5 youtube channels (code version)
published: true
description: youtube channels
tags: youtube, dev, beginners
---

As youtube replaced TV, for the most part, there are several channels that I follow that have great topics for developers in general, if you are starting or not.

5- [justforfunc] (https://www.youtube.com/channel/UC_BzFbxG2za3bp5NRRRXJS). Francesc Campoy is a really awesome Go developer that use to work at Google. His main focus is Go, but you can follow him even if you don't use Go, because he has a very straightforward approach and very good coding practices.
https://www.youtube.com/watch?v=XaMr--wAuSI

4- [sentdex](https://www.youtube.com/user/sentdex). If python is your thing, you definitely need to check out this channel. With a very solid way of teaching things, he can teach you from simple Python to Machine Learning using pure Tensorflow.
https://www.youtube.com/watch?v=ne-dpRdNReI

3- [Jabrils](https://www.youtube.com/channel/UCQALLeQPoZdZC4JNUboVEUg). Between code, fun, and a brilliant charisma, Jabrils is not learning channel but can give you ideas for a lot of fun projects.
https://www.youtube.com/watch?v=Y4cOmMDCUJc

2- [CodingGarden](https://www.youtube.com/watch?v=zUkrx1Vd1G4). This channel is pretty new to me, but the energy and knowledge of CJ is contagious. Worth checking.
https://www.youtube.com/watch?v=zUkrx1Vd1G4

Honorable Mention- [noopkat](https://twitch.tv/noopkat). Not youtube, but live this time. Sue is a very cute Australian that develops most in javascript. She is responsible for creating one of the best APIs for dealing with Arduinos in JS (which you can see her maintaining live) and a lot of other side projects. It's a great fun for all your Sunday morning.
https://www.youtube.com/watch?v=UwX0ntmJ61A

1- [The Coding Train](https://www.youtube.com/channel/UCvjgXvBlbQiydffZU7m1_aw). If I give Dan a quarter for each time I learn something new from him, he would be a millionaire by now. This NY ITP teacher has a focus on creative coding, but he covers a lot of different algorithms in both JS and Processing (Java API).
https://www.youtube.com/watch?v=0jjeOYMjmDU
Share EmberJS common code between apps
Tags: ember, monorepo, components
Published: 2018-09-16 21:47:00

---
title: Share EmberJS common code between apps
published: true
description: HowTo easily share common code between your own projects?
tags: ember, EmberJS, monorepo, components
---

## Deprecation warning

I consider *yarn workspaces* a better solution for this problem right now. I [wrote an article about yarn workspaces](https://dev.to/michalbryxi/share-common-code-with-yarn-workspaces-5g29) and the gotchas I encountered. Please check it out prior to reading this one.

## Little background story

Lately, I've been working on a user-facing EmberJS app. The scope has expanded and we needed to implement an administrator interface. For various reasons, I decided that *separate* EmberJS app would be a good solution. 

Bootstrapped new `ember-cli` project, started coding and right from the start, I noticed that I basically just copy-pasted authorization code from the original app. Later on the same with models. And finally, even some components seemed to be reusable. Seemed like there was room for improvement. So I tried to accomplish the following:

1. **Reuse** as much code between apps as possible.
1. Make sure that **live-reload** still works. I want to be able to edit *frontend*, *admin* or *common* code, save it and instantly see results.
1. Don't have to **publish** the common code anywhere.

## Implementation

Reading through the blog posts and [discussion forums](https://discuss.emberjs.com/t/sharing-models-via-ember-cli-addons/6311/2?u=michal_bryxi), I found that the way to go is an [addon](https://ember-cli.com/extending/#create-addon).

At the start, the file layout is as follows. Two folders with my two projects:

```sh
.
├── admin
└── frontend
```

Next, generate the addon that will have the common code:

```sh
ember addon bp-ember-components
```

So the folder structure will look like this:

```sh
.
├── admin
├── bp-ember-components
└── frontend
```

Now to install the addon in our apps, just add it to `package.json` files. Use relative file path so that `yarn` can grab it directly from your disk. Since I'm using a [monorepo](https://en.wikipedia.org/wiki/Monorepo) for this project, even *CI* takes advantage of the fact that it's just a "neighbour" folder.

```json
// admin/package.json and fronend/package.json
{
  "devDependencies": {
    "bp-ember-components": "../bp-ember-components/"
  }
}
```

To enable the magic of [live-reload](https://ember-cli.com/extending/#link-to-addon-while-developing) even when changing code in the common repo, add:

```js
// bp-ember-components/index.js

module.exports = {
  isDevelopingAddon: function() {
    return true;
  }
};
```

And finally, [link](https://yarnpkg.com/lang/en/docs/cli/link/) the addon in the `node_modules` in your apps:

```sh
cd ./bp-ember-components
yarn
yarn link

cd ../admin
yarn link bp-ember-components

cd ../frontend
yarn link bp-ember-components
```

And that's it. You can just start putting your models/components/etc. into the `bp-ember-components` and it will be available in **both** of your apps.
Are you more likely to be a crypto investor?
Tags: crypto, discuss
Published: 2018-09-16 18:21:11

---
title: Are you more likely to be a crypto investor?
published: true
description: Are developers more likely to be crypto investors?
tags: crypto, discuss
---

Hi guys,

What's your general knowledge about the crypto space? It's a bit surprising when I go to crypto related meetups and see that there are rarely any developers in the crowd -- mostly business folks trying to promote their own tokens and so on.

Are there any developers out there that hold cryptocurrencies, not from a speculative perspective -- but rather really believe in the project?
Add images to Word document using Apache POI
Tags: java, corejava, webdev, programming
Published: 2018-09-16 17:08:05

---
title: Add images to Word document using Apache POI
published: true
description: Add images to Word document using Apache POI
tags: #java #corejava #webdev #programming
---

Post Link : <a href="https://www.skptricks.com/2018/09/add-images-to-word-document-using-apache-poi-in-java.html"> Add images to Word document using Apache POI </a>

You may have been worked with Apache POI Library to read and write content in excel sheet. But in this article we are going to use Apache POI Library to add images and text content to word document using java. Using Apache POI Library you can perform any kind of read and write operation in word document easily.

Prerequisites :
1. Install JDK 1.8
2.  Download Apache POI 3.17 library and jars.
3.  Install eclipse.

<a href="https://www.skptricks.com/2018/09/add-images-to-word-document-using-apache-poi-in-java.html"> Add images to Word document using Apache POI </a>
<img src="https://1.bp.blogspot.com/-uKdr6i1zcGc/W56KcugBWFI/AAAAAAAAB5A/HrqiMQTyPWIIplVKSq09ZATEILw8kdQsgCLcBGAs/s400/pp.png" />


<a href="https://www.skptricks.com/2018/09/add-images-to-word-document-using-apache-poi-in-java.html" > Click to read more... </a>
If Operating Systems were cakes.
Tags: os, linux, windows, macos
Published: 2018-09-16 16:54:39

---
title: If Operating Systems were cakes.
published: true
description: A little conversation I had with a non techie friend, to be taken with a grain of salt 
tags: OS,Linux,Windows,MacOS
cover_image: https://thepracticaldev.s3.amazonaws.com/i/jc6k31g0tr59yc5kqnoi.jpg
---

A few days ago a close friend of mine from a finance background, but with a sound enough interest in tech asked me “But whats the best OS?”.  This conversation spawned a fun little analogy that I’m going to share with you, to be taken with a grain of salt.

– “There is not necessarily a best, but here’s a way to compare them. Think of operating systems like cakes:

**Windows** would be your typical cake, all ready-made and sold in your local grocery store. You don’t see it being prepared, though you get to know the ingredients. Most people buy it and are usually happy enough with it.

On the other hand, **Linux** would be like the recipe to a cake, handed out free. If somebody liked their cake with a little bit more sugar here, or a pinch of salt there, they could just tweak the recipe and bake their own cake. That’s what they call **Linux Distributions**.”

– “What about macOS?”

– “**macOS** would be a 100% Organic non GMO bio cake. It comes with a price tag bigger than the other cakes. People who eat it either really know the benefits of it, or are rich. Whether it tastes better is really subjective.”
plain_sight
Tags: cipher, masking, privacy
Published: 2018-09-16 16:22:27

---
title: plain_sight
published: true
description: A text masking tool
tags: #cipher #masking #privacy
---

plain_sight is a tool for the creation of simple ciphers and masks to conceal text data. Using customizable rule files a user can transform any text file (including html) into what appears to be some numerical data, a log file, or even a valid html file, or anything else they can come up with.

https://github.com/jwhart175/plain_sight
Single keyword expressions in JavaScript
Tags: javascript, single, expression, keyword
Published: 2018-09-16 16:14:17

---
title: Single keyword expressions in JavaScript
published: true
description: Immutable data structures and single keyword expressions in JavaScript.
tags: javascript, single, expression, keyword
cover_image: https://thepracticaldev.s3.amazonaws.com/i/c8tx98zs72dzgccmr427.png
---

Many of you are familiar with this. To those who are not this is a brief introduction to ummm _single keyword expressions_ in JavaScript for lack of a better term. I sometimes get questions. If this does in fact have a name then by all means correct me. 

The practice of defining (usually innumerable and read-only) global properties with a _getter_ to reference them later with a single keyword statement. Look:

```js
Object.defineProperty(global, 'exit', {
    enumerable: false, /* this means it will not show up when iterating the 'global' object keys */
    get: () => process.exit()
})
```

When we access _exit_ in our script, it calls the _getter_ function which will exit. Try it yourself! 

```js
/* i refuse to explain this part */
for(let i = 0; i < 10; i++) {
    if(i > 5) {
        exit;
    }
    console.log(i)
}
``` 

#### Output
```text
0
1
2
3
4
5
```

Observe the following code that defines two global innumerable identifiers with a getter to calculate the script execution time.

```js
Object.defineProperty(global, 'start', {
    enumerable: false, 
    get: () => { 
        this.startTime = new Date().getTime()
    }
}) /* when we reference 'start', store the current time in milliseconds in 'startTime' */

Object.defineProperty(global, 'end', {
    enumerable: false, 
    get: () => {
        let now = new Date().getTime()
        let difference = now - this.startTime 
        console.log(`process took ${difference} milliseconds.`)
        process.exit()
    }
}) /* when we reference 'end', log the difference between now and 'startTime' then exit */

start;

for(i = 0; i < 1000; i++) {
    console.log(i)
}

end;
``` 

#### Output
```text
0
1
2
3
...
...
...
997
998
999
process took 1848 milliseconds.
```

### Things

The _this.startTime_ property in the example above is not globally accessible. If you console log _this_ inside the getter function(s) you get an object with only 1 property _startTime_.

```js
/* startTime, this.startTime, global.startTime, start.startTime  do not exist */
start;
for(i = 0; i < 1000; i++) { /* ... */ }
end;
``` 

Because we are talking ECMAScript, the _start_ and _end_ references in the example do not require a semi-colon. Some developers prefer it, others go to war.

Understand that just referencing a property will already invoke the getter.

```js
start
setTimeout(end, 5000) /* this will exit immediately. */
``` 

```js
start 
setTimeout(() => end, 5000) /* this will exit in 5000 milliseconds. */
```

In stead of providing a few more complex examples I will stop here and would like you to think of some and share them with us in the comment section. Thank you for reading.
What standing desk should I buy?
Tags: gear
Published: 2018-09-16 15:54:54

---
title: What standing desk should I buy?
published: true    
description: Recommendations on a standing desk
tags: gear
---

I'm looking for a standing desk and I want to make sure I buy the right one :)

One of the biggest concerns I have is stability.  When I hookup a dual monitor arm on the desk, I don't want the desk to shake when it is in standing mode.

Does anyone have any experience with a standing desk that you can share taking the above concern into consideration?
How to handle with toxic programmer? 
Tags: discuss
Published: 2018-09-16 14:21:01

---
title: How to handle with toxic programmer? 
published: true
description: 
tags: discuss
---

I am a student who passionate technology and I love to code. Every day I spent my day to write some codes and always learn everything about this field. 

A couple months ago I applied for a job in a small company with my senior in collage, I got a team with my senior in collage. The problem is, this guy is a toxic I mean He is useless, talked to much like knows everything but did nothing, He just pulled my repo that I made myself and show it to the boss like the code was created by him. 

What do You think? And how You handle with this guy? 

N.B:sorry for my bad english.
Do tech companies care about your look? 
Tags: discuss, healthydebate, career
Published: 2018-09-16 13:32:59

---
title: Do tech companies care about your look? 
published: true
description: 
tags: #discuss #healthydebate #career
---

I'm at the beginning of my developer career and one question kinda haunts me: does the look of the developer matters in his or her chances to get the job?
I'm talking about tattoos and piercings, the most common, evident and "hated" body modifications the companies tend to not like at all. 

I personally care about my look and about what I'm wearing, but even if my tattoos aren't directly visible with a normal shirt on, my piercings (lip, ear and a nose *bridge*) are very evident. 

What's your opinion about this? Have you had any experiences either as a recruiter or as an employee?
Which cloud provider should I use to build Multi-tenant SAAS?
Tags: help, discuss
Published: 2018-09-16 12:20:26

---
title: Which cloud provider should I use to build Multi-tenant SAAS?
published: true
description: 
tags: help, discuss
---

I'm building a saas and I decided to use cloud, after some research I've done on my own I found out that there aren't tools that could help for example in creating new tenants and routing users to the right tenant automatically.

All what I found from AWS, Google and Azure was explaining how to architect your multi-tenant app.

As an example I want to develop an application like zoho.people
https://www.zoho.com/people/
Clueless developer, How to get back
Tags: dev, discuss
Published: 2018-09-16 11:04:57

---
title: Clueless developer, How to get back
published: true
description: 
tags: #dev #discussion
---
Started my development journey in 2015. The first try was with PHP -- No frameworks just bare PHP!. That ditched me in a big hole of omitting best-practises.

##2016

So basic PHP, HTML, and some sugary CSS and it was 2016 on the mark.
Learned Vanilla JS, Ajax, jQuery. The First thing I made (as I remember) was a popup-window using jQuery-draggable.

##2017

A bit of Android with Java. Only a basic understanding of it.
Winter, Experimenting blender to make some fancy fire-simulation (again built-in) etc... and more simple websites for my own(never been in the server)

##2018 

real acceleration; **the time where I lost**
Learned how to play with React using *create-react-app*. Extended *CRA*, ES6, real webpack, jest, npm, *localhost:3000*
Built Small web-apps using React.js With REST API Implementation and stuff.
A Big Dive into Desktop applications with **WPF** and **C#**. Stuck with MVVM concepts for a month and finally some success.
Finally, some hobby *python* scripting for my personal use.

#Real Confusion Here


- Machine Learning: With Zero knowledge currently (Maybe TensorFlow or scikit)
- Cloud containerization with Docker
- Android Kotlin or Java
- Ruby on Rails Or Node.js: Express Server

**How can I Choose a good tech stack which is an optimal software development practice in 2018?**
Liquid Error, help!
Tags: help
Published: 2018-09-16 09:42:40

---
title: Liquid Error, help!
published: true
description: Getting a "Liquid Error" upon editing certain posts
tags: help
---

Following advice in [Comment](https://dev.to/johncarroll/comment/5gic) from [John Carroll](https://dev.to/johncarroll) I was going back through old posts adding language annotations to my code blocks.  

This seemed to go pretty well, until I came across the following two posts:
* https://dev.to/kritner/angular-basics--pipes-180
* https://dev.to/kritner/angular-basics--binding-5dn8

On both of these posts, it seems that upon "Preview" of edits, I am presented with the following error:

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

It seems that this error for the two posts is immediate upon doing a preview (e.g. before edits) but I'm not sure if that's because I already had previously saved edits present that I'm not accounting for.

Anyone have any ideas?

EDIT:

found the issue in both cases was due to non-code snippet instances of `{{ ... }}` - I suppose it was thinking I was trying to bind data on the page since it wasn't enclosed in a code snippet?
BxJS Weekly Episode 28 - javascript news podcast
Tags: javascript, node, podcast, news
Published: 2018-09-16 09:33:31

---
title: BxJS Weekly Episode 28 - javascript news podcast
published: true
description: Listen to the best javascript news of the week in a podcast form
tags: javascript, node, podcast, news
---

Hey dev.to community!

BxJS Weekly Episode 28 is now out! 🚀
Listen to the best javascript news of the week in a podcast form right here.
You can find all the mentioned links [here on github](https://github.com/BuildingXwithJS/bxjs-weekly/blob/master/episodes/Episode-28-2018-09-15.md).

You can also watch or listen to this episode on:
- [YouTube](https://youtu.be/WLRfr92dIps)
- [Castbox](https://castbox.fm/episode/BxJS-Weekly-Ep.-28-Sept-15%2C-2018-(javascript-news-podcast)-id1378315-id92322494?country=us)

Any feedback is appreciated 😁

Additional stuff:
- [Twitch channel](https://www.twitch.tv/yamalight)
- [Discord server](https://discord.gg/hnKCXqQ)
- [BxJS Weekly github repo](https://github.com/BuildingXwithJS/bxjs-weekly)

Social media links:
- [Twitter](http://twitter.com/yamalight)
- [Medium](https://medium.com/@yamalight)
- [Github](http://github.com/yamalight)

If you enjoy my content, please consider [supporting me](https://codezen.net/support.html) 😉