teleren/devto huggingface dataset:
Dec. 20, 2019: What did you learn this week?
Tags: weeklylearn, discuss, weeklyretro
Published: 2019-12-20 05:00:04

It's that time of the week again. So wonderful devs, what did you learn this week? It could be programming tips, career advice etc.

![Deadpool and his cohorts chatting](https://media.giphy.com/media/w7fJO4TOqiaSQ/giphy-downsized-large.gif)

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

{%tag todayilearned %}

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

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

![Big win. Danny Devito walking away from a huge explosion](https://media.giphy.com/media/U6pavBhRsbNbPzrwWg/giphy-downsized-large.gif)
Ionic React Hooks with Custom Firebase FileUpload Hook [Video Series]
Tags: tutorial, javascript, react, ionic
Published: 2019-12-20 03:48:39


![in3dc coding react-hooks](https://media.giphy.com/media/dlMIwDQAxXn1K/giphy.gif)

## Overview
People learn different ways so I decided to try something new, take two blog posts one from the [Ionic Team](https://buff.ly/35FKMXL),
<img  src="https://thepracticaldev.s3.amazonaws.com/i/6zz1bdgufvy8tucatcyp.png" width="500"/>


and [one that I wrote](https://buff.ly/2OVqB23)  

<img  src="https://thepracticaldev.s3.amazonaws.com/i/aqjn8qp8eb5cm7lrk40h.png" width="550"/>


to show how do the following


- Build [React App Using Ionic Framework](https://ionicframework.com/docs/react/your-first-app)
- Use Ionic React Hooks
- Build Your Own Custom Firebase Hook
- Build the app for your mobile device using [Capacitor](https://capacitor.ionicframework.com/), The Native Bridge for Cross-Platform Web Apps


### The Blog Posts


- Part One: [Announcing Ionic React Hooks] (https://buff.ly/35FKMXL)
- Part Two: [Ionic Framework App using React Firebase Hooks - File Upload Hook](https://buff.ly/2OVqB23)

### The First Video
{% youtube f9pq4Yizrg4 %}
Thanks for coming by, please [subscribe to the YouTube Channel](https://www.youtube.com/channel/UCMCcqbJpyL3LAv3PJeYz2bg?view_as=subscriber?sub_confirmation=1) to get an update when the next part of the video series is published.
{% github aaronksaunders/MyAppReactApp %}
Introduction
Tags: intro, devlive, career, future
Published: 2019-12-20 03:15:02

Helow, this is my first post and I'm gonna share my life story here from now on perhaps.

I'm **Andre**, from Indonesia, currently aged 22, Bachelor graduate in Informatics, Master student in Information System,  working as IT support in an 'IT College'. Sounds great, never enjoy it :smile:.

Why do I put that line? Stay tuned, because it's gonna be a long thread I will ever write in social platform like DEV. Life is tough, but I'm grateful with that :triumph:.

Good day! :grin:
NodeJS http homepage 30: create custom module and export
Tags: node, http, module, export
Published: 2019-12-20 01:36:38

<hr />

<center>Happy Coding</center>

<hr />

{% codesandbox nodejs-http-homepage-30-create-custom-module-u7eft initialpath=/ %}

previous post {% post antelove19/nodejs-http-homepage-20-request-url-1fpf %}

<hr />

DRY is Don't Repeat Yourself, which will be used in link menu.

We will create custom module and export it.

create a file: **_public/partials/menu.js_** and write code such as:

```javascript
var link =  `
                <ul>
                    <li><a href="/" >Home</a></li>
                    <li><a href="/about" >About</a></li>
                </ul>
            `;

module.exports = link
```

In **_index.js_**, add require menu file

```javascript
const menu  = require('../public/partials/menu');
```

for each 

```javascript
res.write( `<ul>
                <li><a href="/" >Home</a></li>
                <li><a href="/about" >About</a></li>
            </ul>` 
          );
```

replace with

```javascript
res.write( menu );
```

<hr/>

<center>Thank for reading :)</center>

<hr/>
Year In Review 2019
Tags: 2019, community, discuss
Published: 2019-12-20 01:19:10

---
title: Year In Review 2019
published: true
description: 
tags: #2019 #community #discuss
---

Howdy, everyone, it has been a while since I last wrote an article to share my experiences with this wonderful community.
This year marked a remarkable memory in my life and I am so much excited to have made it through to this day.

As the title of this article implies I am going to be asking this awesome community a few questions but mainly I will like for us to follow this format below and answer each question accordingly.

1. What was your resolution for this year 2019?
2. Did you reach or exceed your goals
3. What are those things you were able to complete?
4. What are those things you weren't able to complete?
5. Did you actually follow all of these goals you've written down from the start of the year 2019?
6. What lesson did you learn from this year?
7. How can you prepare for the next year 2020?
8. What held you back from no achieving all of your goals?
9. Do you think you can do better next year?
10. I know is a bit soon but can you briefly explain your resolution for the year 2020?

Well, these questions above are all important and I've used them to plan for the next year 2020.
I hope you guys will share your answers below and who knows if this might inspire others to plan well and learned from someone's mistakes and that person might just be you.
Merry Xmass in advance devs.
IPFS Storage Adapter for Ghost Blog with Heroku Deploy
Tags: ipfs, ghost, heroku
Published: 2019-12-27 08:32:56

---
title: IPFS Storage Adapter for Ghost Blog with Heroku Deploy
published: true
date: 2019-12-20 00:51:05 UTC
tags: IPFS,Ghost,Heroku
canonical_url: https://blog.fission.codes/ipfs-storage-adapter-for-ghost-blog-heroku-deploy/
cover_image: https://s3.fission.codes/2019/12/typewriter-ghost-ipfs-heroku-sidebyside.jpg
---

Back in May, as part of putting the Fission blog on Ghost, I [packaged it up to be a one-click deploy on Heroku](https://blog.fission.codes/ghost2-blog-on-heroku/). We've gone one step further and gotten an IPFS Storage Adapter completed, and upgraded to Ghost v3.x.

This one-click deploy is possible because our [IPFS Heroku Add-on is in beta](https://elements.heroku.com/addons/interplanetary-fission)! 🙌 🎉

<!--kg-card-begin: image-->

![IPFS Storage Adapter for Ghost Blog with Heroku Deploy](https://s3.fission.codes/2019/12/heroku-add-on.png)<figcaption>Our <a href="https://elements.heroku.com/addons/interplanetary-fission">IPFS Heroku Add-on</a> is in beta with a free "test" plan.</figcaption>

<!--kg-card-end: image-->

This means you can package up apps to be deployed on Heroku that automatically add our add-on. This provisions you a username and API key and your app can use our Web API to read and write to IPFS, manage DNS, and anything else accessible through our API.

Check the [Github repo for more details](https://github.com/fission-suite/heroku-ipfs-ghost), or go ahead and deploy a new Ghost 3 blog here:


[![IPFS Storage Adapter for Ghost Blog with Heroku Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/fission-suite/heroku-ipfs-ghost)

To complete the Ghost deploy, the only configuration you'll need to do is to set the public URL for your blog – e.g. `https://boris-ghost-test1.herokuapp.com`.

We've set the IPFS gateway to use ours by default, but you can put in any gateway you like. Images are included from this gateway, but of course using the [IPFS Companion extension](https://github.com/ipfs-shipyard/ipfs-companion) means you can serve the images from your local machine.

Go ahead and setup your first user, create a new post, and add an image – voila! Interplanetary Ghost Blogging! [Here's my sample post](https://boris-ghost-test1.herokuapp.com/i-am-testing-ipfs/).

---

We're working on adding IPFS support for basic file uploads to a number of other platforms. This is a first step in getting more content natively available in IPFS. Imagine managing your blog's media assets or a gallery page from your desktop, being able to login to any system and have all your photos and files available for you there.

[Join our App Ideas forum](https://talk.fission.codes/c/app-ideas) to suggest other things you'd like to see. Thanks to [Mike Taylor](https://mktlr.com) [@mktlrwho](https://twitter.com/MKTLRwho) for working on this with us!
[Junior Dev] My experiences during my first job as a developer. 
Tags: webdev, javascript, beginners
Published: 2019-12-20 00:27:10

# Introduction 

I am very lucky to get my first job as a software developer when just graduated from my University. Being in a company and the most importantly, first professional experience as a developer was very exciting for me. There are several difficulties that I encountered and also many things that I've learned from them as well. 
I really want to share my first experiences with everyone who is going to start their first job, and wish everyone who is looking for a job will receive good news in a near future. :blush: 

# Experiences

- First of all, as a junior developer without any professional experiences, when I first looked at the code base that I will need to work on, I was a little bit panic as it was so so massive with thousands and thousands line of codes, and I bet it may had been taken me a few sleepless nights to finish reading through everything, and maybe a couple of months to understand all of them. Surprisingly, when I started doing my tasks, I realised that the more and more I interacted with the code, the more it got familiar to me. Luckily, I worked with a very nice team leader, he would help me with all of mine stupid questions and my problems without any complains. 

=> So that when you just started your first job, you may afraid of asking questions or bringing out your opinions about something. Please do not hesitate to ask and tell people what you are thinking, it can help you to go through your problem which take you so much time and you realise that it may just took a minute to solve it. Senior developers or your team leader had a time being a junior dev like us as well, so I think they will understand what we are going through and struggling with. Moreover, the way the solve the problem is also a thing that we could learn as well.

It may sound very easy to ask questions or speak out loud our opinions about something or what you want to change or even ask for what you need in order to work better, but it actually hard sometimes to ask people because we may think that we would interrupt them or they would be annoyed by our stupid questions (it happened to me many times :sweat_smile:!!). It may have some negative effects on your mood and motivation to go to work so just speak to people in your team or whoever that can help you, I am sure you will be very happy to see your ideas or opinion got accepted and turned to something helpful for everyone. 

# Conclusion 
The article is going be a bit long so I just stop here even-though I really want to share much more than that. If anyone has any experiences and things to share please comment below, I would love to know what you think about doing the first dev job and difficulties that you are facing. 
Finally, I wish everyone has a lovely Christmas with your loved one and family, and a wonderful new year 2020!!! :heart:
How to Dynamically Create Many Similar CSS Classes with Sass
Tags: sass, scss, css, webdev
Published: 2019-12-20 00:26:25

---
title: How to Dynamically Create Many Similar CSS Classes with Sass
published: true
description: Repeated code takes up a lot of space. Sass can help you reduce repetitive and similar CSS code.
tags: sass, scss, css, webdev
cover_image: https://firebasestorage.googleapis.com/v0/b/ashleemboyer-2018.appspot.com/o/images%2Fsass.png?alt=media&token=4035f9c6-3055-4d51-a608-1eb229dfeb05
canonical_url: https://ashleemboyer.com/how-to-dynamically-create-many-similar-css-classes-with-sass
---

*Originally posted on [my blog](https://ashleemboyer.com/how-to-dynamically-create-many-similar-css-classes-with-sass).*

Let's say you allow 5 sizes of icons in your web application and they're in 6-pixel increments: 12, 18, 24, 30, and 36. Your Sass file might have something like the following to handle this:

```scss
.Icon {
  &--size-12 {
    width: 12px;
    height: 12px;
    font-size: 12px;
  }

  &--size-18 {
    width: 18px;
    height: 18px;
    font-size: 18px;
  }

  &--size-24 {
    width: 24px;
    height: 24px;
    font-size: 24px;
  }

  &--size-30 {
    width: 30px;
    height: 30px;
    font-size: 30px;
  }

  &--size-36 {
    width: 36px;
    height: 36px;
    font-size: 36px;
  }
}
```

These all look really similar, right? The class names all have the same format, and each one sets a `width`, `height`, and `font-size` to be the same thing. Would you believe me if I told you that it's possible to dynamically create blocks of CSS for class names in Sass?

Well, believe me! It's true!

Here's one way you can introduce a `@for` to do this:

```scss
.Icon {
  @for $i from 1 through 5 {
    $base-size: 12;
    $increment: 6;
    $calculated-size: $base-size + ($i * $increment);

    &--size-#{$calculated-size} {
      width: #{$calculated-size}px;
      height: #{$calculated-size}px;
      font-size: #{$calculated-size}px;
    }
  }
}
```

What if you don't have even increments, though? You can also loop through an array of values like this:

```scss
$icon-sizes: 12, 16, 32, 48;

.Icon {
  @each $size in $icon-sizes {
    &--size-#{$size} {
      width: #{size}px;
      height: #{size}px;
      font-size: #{size}px;
    }
  }
}
```

---

Did you know I have a newsletter? 📬

If you want to get notified when I publish new blog posts or make major project announcements, head over to [https://ashleemboyer.com/newsletter](https://ashleemboyer.com/newsletter).
NOTE: get labels from Pod
Tags: note, kubernetes
Published: 2019-12-20 16:11:24

---
title: NOTE: get labels from Pod
published: true
date: 2019-12-20 00:00:00 UTC
tags: note,kubernetes
canonical_url: https://dannypsnl.github.io/docs/note-get-labels-from-pod/
---

This week our company wants to improve one of our projects which is based on Istio, exchanging weight in different checker instances, make the traffic distribution fairer. My co-worker provides a nice idea: We watching Pods by the [label selector](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) to discover others instance. Code looks like:

```go
watcher, err := client.CoreV1().Pods("istio-system").Watch(meta.ListOptions{
	Watch:         true,
	LabelSelector: "xxx=yyy",
})
```

But this causes a problem, you can see that string `"xxx=yyy"`, we have no graceful way to avoid the repeating of label selector in Kubernetes config(for Kubernetes) and environment variable(for our program). And one day they would outdated.

In the beginning, we have a discussion and thought that it would unlikely to have the access to label selector value in Pod. Then start searching in the document. You know what? Surprisingly we can! Even have a few ways can choose! Let's take a look at them:

1. Use `env` variables

   ```yaml
   apiVersion: apps/v1
   kind: Deployment
   metadata:
   name: get-labels
   spec:
   selector:
       matchLabels:
       name: get-labels-container
   template:
       metadata:
       labels:
           name: get-labels-container
       spec:
       containers:
           - name: a-container
           image: ubuntu:18.04
           env:
               - name: SELECTOR_VALUE
               valueFrom:
                   fieldRef:
                   fieldPath: metadata.labels['name']
   ```

   In this case, we can get one value from a label selector pair.

2. Load them into a file

   This requires a new API called: `downwardAPI`

   ```yaml
   apiVersion: apps/v1
   kind: Deployment
   metadata:
   name: get-labels
   spec:
   selector:
       matchLabels:
       name: get-labels-container
   template:
       metadata:
       labels:
           name: get-labels-container
       spec:
       containers:
           - name: a-container
           image: ubuntu:18.04
           volumeMounts:
               - name: podinfo
               mountPath: /etc/podinfo
           command:
               - sleep
               - inf
       volumes:
           - name: podinfo
           downwardAPI:
               items:
               - path: "labels"
                   fieldRef:
                   fieldPath: metadata.labels
   ```

   In this container, we can use `cat /etc/podinfo/labels` to get all label selectors. So if we want to get all of them then we can use this solution.

Now, hope this can save your time since it's in a weird place of Kubernetes document. And thanks for your read.

#### References

- [k8s Doc: Expose Pod Information to Containers Through Files](https://kubernetes.io/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information/)
Homebrew Mono Breaks Omnisharp
Tags: homebrew, mono, vscode, omnisharp
Published: 2020-01-25 22:43:11

---
title: Homebrew Mono Breaks Omnisharp
published: true
date: 2019-12-20 00:00:00 UTC
tags: homebrew,mono,vscode,omnisharp 
canonical_url: 
---

So today, I raised a [GitHub issue](https://github.com/OmniSharp/omnisharp-vscode/issues/3477) because after I had opened the result of `dotnet new mvc` in VSCode the problems window would have approximately 120 issues and the code editor window would be full of red squiggles.

![](https://pbs.twimg.com/media/EMJhNcRXkAEgE_-.jpg)

* * *

I was running the very [latest version of dotnetcore](https://dotnet.microsoft.com/download/dotnet-core/3.0)

![](https://pbs.twimg.com/media/EMJhyLSWwAIxryE.png)

* * *

And the very latest version of [VSCode](https://code.visualstudio.com/)

![](https://pbs.twimg.com/media/EMJiAp1WoAA5Y6-.png)

* * *

I had not changed anything in the .csproj file. It was fresh from running `dotnet new mvc` from the terminal.

![](https://pbs.twimg.com/media/EMOFqFlX0AA2KFt.jpg)

* * *

So, I raised an issue over on [GitHub](https://github.com/OmniSharp/omnisharp-vscode/issues/3477).

![github-issue-3477.png](https://solrevdev.com//media/github-issue-3477.png)

* * *

Big thanks to the rapid response and answer from [@filipw](https://github.com/filipw), who discovered that it was the [homebrew](https://brew.sh/) [cellar](https://docs.brew.sh/Formula-Cookbook) version of mono that was the issue and that intstalling the [stable version of mono](https://www.mono-project.com/download/stable/) was the fix.

![](https://pbs.twimg.com/media/EMOMjtmXkAA6BG7.png)

![](https://pbs.twimg.com/media/EMOMjtiW4AAKpZ2.png)

* * *

Success 🎉
Question: How to make a personal blog that looks good?
Tags: discuss, webdev, writing
Published: 2019-12-19 23:23:08

I just started using Jekyll and GitHub pages to host my website. While I'm mainly interested in writing posts about math and documenting any interesting programming projects I do, I want to make my website look appealing and interesting. Right now it's a [little bit bland](https://m4rtyr.github.io).

If anyone more experienced in this area can help, that would be awesome.

Thanks!
Why Using A Mouse On A Laptop Makes You More Productive
Tags: mouse, productivity, peripherals
Published: 2019-12-19 23:01:47

Let's face it, laptops are a great tool for developers and on the go productivity. Their compact size and ability to last hours on end on a single charge makes them a wonderful tool to work anywhere. To my knowledge every laptop on the market (besides maybe some high-end gaming ones) comes standard with a trackpad. The trackpad is great and embodies the whole concept of having a fully functioning computer in your lap, but it can slow you down a whole lot if you work on a desk. In my opinion investing in even just a $20 mouse can increase your productivity by ten times.

If you ask just about anyone who has gone from using one monitor to two, or just a laptop to laptop with a monitor they will tell you that they cannot go back. I have the same opinion about using a mouse with a laptop. 

Firstly I have to admit that I don't use my mouse 100% of the time. For instance if I am typing and have to move my cursor just a bit to edit a misspelled word I will sometimes use the trackpad because it is there and using the mouse for the action wouldn't save much time if at all. The trackpad is also faster for some things like scrolling the page down a little. The mouse really comes into play when doing multiple actions. This is especially noticeable while coding.

Working with tons of lines of code you will most likely be jumping between lines and words constantly. Sometimes using IDE features to use multiple cursors at once. It becomes very slow and tedious to jump between lots of precision points anywhere on your computer screen with a trackpad. Things become even tricker when you take left and right clicks into consideration.

With a mouse it is really easy to switch between left and right clicks and have a lot more speed and control over your cursor. With a trackpad I find myself constantly running out of "pad" and needing to readjust my fingers which takes a lot of time. This really adds up when you are trying to click multiple targets in a row that are on opposite ends on whatever you are working on. With a mouse you can hit all the targets so much more quickly and accurately once you find the right sensitivity and DPI. A mouse is also way easier to adjust if you over or under shoot your target.

Obviously trackpads are a great tool and these days can have their sensitivity adjusted as well, but the mouse is just far superior in my eyes. Even with a comfortable sensitivity on my trackpad, I find I am much more accurate and have to readjust my finger/hand position way less and way less often than when using the trackpad. The trackpad can be great for scrolling down a tiny bit, like when I have been writing this blog as Dev.to doesn't automatically scroll for you when you run out of typing space. It's also good for small movements like going back in the sentence you are currently typing to add a letter you might have missed. For doing anything else though the mouse will make life so much easier for you and you wont be able to go back.
Day 56 : Writer's Block
Tags: hiphop, code, coding, lifelongdev
Published: 2019-12-19 22:56:08

_liner notes_:
- Professional : Today was focused on getting the blog post buttoned up. I think I have writer's block or something. haha I had no problem making a presentation based on my research, but trying to put the info in long form is a struggle for some reason. Maybe it's because this is my first blog post since joining the team. I have no real problem knocking out these blogs. haha Maybe because these are only really for me. I forget that I post these on a public site for others to possibly come across.

- Personal : Still working on the blog post for work. I've got the intro and some of the body worked out. I've got a framework of how I want to approach each example I'll be presenting. I think that was what I was missing. It seems to be flowing better and shouldn't be much longer before I'm done. Looking forward to getting this completed and submitted.  

![An aerial view of the Grand Canyon](https://thepracticaldev.s3.amazonaws.com/i/8gox9ynndhdlkuoy5duu.png)

Decided to try the Benjamin Franklin daily schedule today. Mostly stuck to it. I didn't really know how much my writer's block would kick my butt. I think I'm just going to finish up the blog post and head to bed Going to use tomorrow (FRIDAY, whoop whoop!) to get a head start on my weekend tasks.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube okyl-3yBP00 %}