teleren/devto huggingface dataset:
Moved my Development Blog to Jekyll
Published: 2020-04-19 00:37:38

---
title: Moved my Development Blog to Jekyll
description: In this post, I explain why and how I moved my blog to a Jekyll and Git based versus being triggered by Dev.to
published: true
canonical_url: https://appsbymw.com/blog/2020/04/19/moving-blog-jekyll
---

# Why

Last week, I decided that the source of my blog posts should be my own blog and not [Dev.to](https://dev.to). This is not because Dev.to is doing anything wrong. I think it's time for me to have a central location for all my posts for people to read. I was somewhat doing this using the Dev.to and Stackbit integration, but I didn't have the raw post itself this way, unless I stored it somewhere else. Since, I was using GitHub to host my working posts, I decided it was time for me to host my own blog using [Jekyll](https://jekyllrb.com/) and [Netlify](https://www.netlify.com/).

I chose Netlify to host my website/blog instead of [GitHub pages](https://pages.github.com) so that I can use a private repo and still utilize the free account on GitHub. I'm not doing anything shady, but Patrons and Buy Me a Coffee subscribers get early access to my blog, so by having a private repo, I'm able to have control of who can see the blog post.

# Migration Process

I'm doing everything manually. It's a slow process of porting my posts from blog.appsbymw.com to appsbymw.com, but this will allow me to make sure it looks exactly right. Mainly, this means that I'll need to change any clode blocks from being raw Markdown to using a Gist. This allows for formatting and styling to be a bit better.

# Next steps

The next step I want to take is implementing comments on a post. I currently can't do that in my setup, but I'm sure there is a way. If you'd like to make me aware of an issue, please email me at appsbymw@gmail.com!

The URL for the new website is [AppsByMW.com](https://appsbymw.com)!

---

If you enjoy my posts, streams, and apps, consider encouraging my efforts.
- <a href="https://www.patreon.com/appsbymw" target="_blank"><button type="button" class="crayons-btn">Become a Patron</button></a>
- <a href="https://www.buymeacoffee.com/appsbymw" target="_blank"><button type="button" class="crayons-btn">Buy Me a Coffee</button></a>
- <a href="https://buttondown.email/appsByMW"><button type="button" class="crayons-btn">Subscribe to my Newsletter!</button></a>
Day 00: 30 Days of Codewars.js
Tags: challenge, javascript, 100daysofcode, codewars
Published: 2020-04-19 00:33:36

So I want to increase my javascript problem solving skills by "duh" solving problems or in this case "kata" on [codewars](https://www.codewars.com) for the next month.

I will post my progress everyday or week (didn't decided yet) on this series called 30 Days of Codewars.js with the problem(s) I solved and how I solved it, what was hard about these problems etc...

And if anyone has a better way to solve the "kata" please let me know in the comments.
Gatsby Error - Do not use quotes and apostrophe in frontmatter properties
Tags: gatsby
Published: 2020-04-21 17:31:45

---
title: Gatsby Error - Do not use quotes and apostrophe in frontmatter properties
published: true
date: 2020-04-19 00:00:00 UTC
tags: GatsbyJs
canonical_url: https://www.jskap.com/notes/gatsby-error-cannot-read-block-mapping-entry/
---

  

![](https://friendly-heyrovsky-86d9f9.netlify.app/opengraph?&author=kapilgorve&title=Gatsby%20Error%20-%20Do%20not%20use%20quotes%20and%20apostrophe%20in%20frontmatter%20properties&tags=GatsbyJs)

  

Error Message - `can not read a block mapping entry; a multiline key may not be an implicit key at line`

I was using Apostrophe in the title. This is a parsing error. Remove quotes or apostrophe from your markdown frontmatter properties.

  

This post was originally published at https://www.jskap.com/notes/gatsby-error-cannot-read-block-mapping-entry/

  

👋 Hi! I’m Kapil. I am always chatty about building things, sharing my learnings, freelancing. Come say hi to me at [https://twitter.com/kapilgorve](https://twitter.com/kapilgorve)
What are your favorite python tips you don't see others use?
Tags: python, discuss
Published: 2020-04-18 23:40:55

Python is a wonderful language. It is easy to learn but like many other languages it still takes time to master. There are many small things in python, whether builtin or as a package, that make our lives easier.

What tricks or features in python do you love to use that help you write more concise code, that you don't see others use often. 

For me, one thing I love making use of is `functools.partial` which can help you write code in a functional way, but also help make things simpler.

Namely, you can make common calls to other functions shorter if you will always call them with the same arguments.

```python
>>> from functools import partial
>>> def multiply(x, y):
...     return x * y
>>> # partial lets us make a new function, by calling the old function with set parameters.
>>> double = partial(multiply, 2)
>>> print(double(4))
8
```
You can also call the method with named arguments
```python
>>> triple = partial(multiply, y=3)
>>> triple(3)
9
```
But be careful cause arguments are passed in order
```python
>>> quad = partial(multiply, x=4)
>>> quad(4)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: multiply() got multiple values for argument 'x'

multiply() got multiple values for argument 'x'
```
Pretty much anything in `functools` is great. you can find functool partial docs [here](https://docs.python.org/2/library/functools.html#functools.partial)

What are your favorite?
React Hooks & Why They Make (Coding) Life So Much Easier
Tags: frontenddev, javascript, react, programming
Published: 2020-04-30 04:59:57

---
title: React Hooks & Why They Make (Coding) Life So Much Easier
published: true
date: 2020-04-18 23:29:55 UTC
tags: front-end-developmen,javascript,react,programming
canonical_url: https://medium.com/javascript-in-plain-english/react-hooks-why-they-make-coding-life-so-much-easier-fe72f75b8e37
---

[![](https://cdn-images-1.medium.com/max/2600/1*4j-HxJN9DQLkHyuqCqEaGg.jpeg)](https://medium.com/javascript-in-plain-english/react-hooks-why-they-make-coding-life-so-much-easier-fe72f75b8e37?source=rss-5676ca6163ee------2)

The best thing about React is that it does a great job of, well, reacting to events in your application. It comes complete with tools to…

[Continue reading on JavaScript in Plain English »](https://medium.com/javascript-in-plain-english/react-hooks-why-they-make-coding-life-so-much-easier-fe72f75b8e37?source=rss-5676ca6163ee------2)
CX Style did'nt work for css in react js
Tags: react, javascript, webdev
Published: 2020-04-18 23:23:49

Exuseme, I want to ask guys, I used cx for css, but it didn't work .. why?, for importing css it's correct, please help..

https://dev-to-uploads.s3.amazonaws.com/i/ifjwcgahzb8zpjr1ntqk.png

https://dev-to-uploads.s3.amazonaws.com/i/ifjwcgahzb8zpjr1ntqk.png
How I Got An Interview With My Dream Place
Published: 2020-04-18 23:19:59

I have been powering through this lockdown and COVID-19 trying to keep learning and expanding my knowledge. One thing I have also been trying to obtain is an interview with someone to hopefully grab my first dev role, and get real world experience. I never thought I'd get a call about doing it with my dream company, Major League Baseball. 

I worked with MLB last year on their pitchcast team. The team that puts up the little strike zone box above home plate to show where pitches land. Cool huh? While in the office I was lucky enough to be around broadcast developers that work on stuff for teams broadcast as well as stuff for the site as well. I would pick their brains or even just slightly look over their shoulders to try and get some insight into how it was run. 

Well towards the end of the bootcamp, I was asked to show the lead developer a project I had been working on in JavaScript. He was impressed. End of discussion basically. I was excited to show, but a little left in the dark as to if he liked it or not? 

Well, I recently reached out to him expressing any help if needed. I didn't know if it was going to lead anywhere. Well I got a message asking to submit some more work and he'll get back to me. 

Being nervous I sent over my work. I sent more than was asked. I sent the stuff I'm most proud of and stuff that I thought was decent, just to show that I continue to create. 

After a few conversations we set up a time to have an initial interview and see where I can be with their requirements! 

It's better than I ever thought it could be and I'm excited for the opportunity to get here and hopefully I can hit one out of the park! (little baseball fun there? No? Not funny? shucks)

I may not be able to play in the big leagues, but to me, this is the big leagues.
Quick Python: Cached Property
Tags: python
Published: 2023-01-06 01:27:08

---
title: Quick Python: Cached Property
published: true
date: 2020-04-18 22:29:21 UTC
tags: Python
canonical_url: https://brandonrozek.com/blog/pycacheprop/
---

If you have a property in an object that only needs to be computed once, consider using `cached_property` to store the result and serve for future function calls.

```
import functools
class Number:
    def __init__ (self, n):
        self.n = n
    @functools.cached_property
    def is_prime(self):
    	return all(self.n % i for i in range(2, self.n))

```

Let’s test it with the Mersenne prime `524287`.

```
n = Number(524287)
n.is_prime

```

After maybe 1-2 seconds of thinking you should get `True.`

Run it again and the result will be instantaneous!
Calculating User's Session Count
Tags: javascript, session
Published: 2020-04-18 22:13:00

---
title: Calculating User's Session Count
published: true
description: Basic function for calculating user's sesion count
tags: javascript, session
---

I wanted to calculate the user's session count through session storage and local storage. 

1. Get the last session value from local storage.
2.  
    *  If there is no stored value create new storage items. Session storage prevents increase value in the same session.
    *  If the last session value is not null, the user was closed browser and opened it again. Increase the last storage value and save the last values. 
3.  Finally it returns session count.

```javascript
var updateStorages = (storageValue) => {
    localStorage.setItem('last-session-value', storageValue);
    sessionStorage.setItem('current-session', storageValue);
};

var getSessionCount = () => {
    var lastSessionValue = localStorage.getItem('last-session-value');

    if (lastSessionValue === null) {
        updateStorages(1);
    } else if (lastSessionValue && sessionStorage.getItem('current-session') === null) {
        lastSessionValue++;

        updateStorages(lastSessionValue);
    }

    return parseInt(lastSessionValue);
};


getSessionCount();
```

It's my first technical post. It's just basic solution and I wanted to share it. I would like write more complicated things too. Cheers.
Flux - Markets on any asset or event via SDK
Tags: blockchain
Published: 2020-04-18 21:57:31

I'm the co-founder of Flux, a highly scalable open market protocol for markets on any asset or event. We recently launched our SDK which allows any developer to interact with our market mechanics and oracle and all of this in just three lines of code. 

The goal of Flux is to provide all the backend resources necessary for developers to enable markets without the hassle of traditional infrastructure. If you want to learn more about Flux check out our SDK here: https://github.com/fluxprotocol/flux-sdk or join our discord here: https://discordapp.com/invite/eg23nNx or try trading on our open source app here: https://app.flux.market
Dev setup for Terraform for Linux on Windows
Tags: Terraform, windows, wsl
Published: 2020-04-18 21:30:30

My project use Terraform a lot. 
But we use a Linux machine to deploy Terraform, and i use a Windows environment to develop and test new terraform files.

Terraform is compatible with both Windows and Linux, but we have to use Powershell script, and therefore specify in terraform which interpreter will receive the script. 
It's Powershell.exe on Windows and pwsh on Linux.

We could have used Docker for providing a normalized environment (with a set Terraform version or a OS patch), to the cost of 
- a more complex tool to interact with, through the docker container
- the Docker knowledge less spread among the team

The solution comes quite easily: use Windows Subsystem for Linux (WSL).

With WSL, we can
- use an Ubuntu directly from Windows ([Ubuntu 18.04](https://ubuntu.com/wsl))
- have direct access to the same sources (no sync needed, the C:\ drive is mounted as /mnt/c/)
- install Terraform, and Powershell Core without altering the Windows environment

Hope this helps!
All projects & tools in Cosmos Ecosystem now inter-compatible
Tags: blockchain, npm, javascript, microservices
Published: 2020-04-18 21:00:58

A recently-released tool from MESG effectively makes all projects built on the Cosmos network of blockchains easily compatible with each other. 

### How does it work? 
Events and tasks on any Cosmos/Tendermint blockchain can be leveraged as triggers within applications, to trigger tasks on other apps, or even external blockchains. This is done through discrete services, which tasks and events are directed by processes. 

This way, components are not interdependent on one another, making building, updates and scaling really lightweight & simple. 

### Quality dev sandbox
MESG is really a development sandbox for not only the Cosmos Ecosystem, but for any developers who want to launch and scale high-end apps really quickly and cheaply. 

Check out the [video from the MESG Foundation](https://blog.mesg.com/community-update-late-february-20/?utm_source=devto&utm_medium=blog_post&utm_campaign=cosmos) which describes the new Cosmos Ecosystem inter-compatibility.
half glass full / half empty
Tags: showerthoughts, javascript, csharp
Published: 2020-04-18 20:44:31

Earlier today I heard this classic statement about a glass half full and I figured, can it be programmatically defined to represent the statement(s)?

```c#
Glass glassFilledWithLiquid = new Glass(new Liquid[250]);
```

In C# you can initialize, at best, the size of the container to begin with before you can fill it. Meaning it has initial state of 0 and a desired state to be filled to the defined size of the array. So the directional and nominal state is to be *filled*. So it would be a glass half filled/full.

###JS

```js
var glass = [];

var secondGlass = [1,2,3,4,5,6];
```

Now this looks, at first glance as if you can have an initial state of both empty and full BUT.... since it uses C++ in the actual V8 engine running the javascript stuff, it still requires initialization of an empty array before filling it. Sooo....

###Conclusion

Any container's initial state is empty, and to be useful, it's desired state is to be filled meaning it's half-filled at the time it's at 50%.
Versionamento semântico com NPM
Tags: npm, javascript, semversion, beginners
Published: 2020-04-18 20:12:45

---
title: Versionamento semântico com NPM
cover_image: https://i.imgur.com/fRoQZi2.png
published: true
description: Conceitos básicos sobre versionamento semântico
tags: npm, javascript, semversion, beginners
---

Vou tentar explicar os conceitos sobre versionamento semântico que considero mais úteis para o usuário. Para informações detalhadas, acesse as fontes no final do artigo.

Versionamento semântico é um padrão de versionamento de APIs que permite a separação entre mudanças que quebram a compatibilidade com versões anteriores (`major`), mudanças que adicionam funcionalidades sem quebrar a retrocompatibilidade (`minor`) e mudanças que não afetam a funcionalidade (`patch`). Consiste basicamente de 3 números separados por ponto.

## Patch

É o 3° número. Qualquer atualização que não adicione, remova, ou modifique alguma funcionalidade deve incrementar esse dígito. Ex.: correções de bugs.
Se você quiser manter a versão `major` e `minor` de sua dependência e atualizar apenas o `patch`, inclua um `~` antes da versão no arquivo `package.json`. Ex.: ~3.4.1 - instala ou atualiza a versão 3.4 que contenha o `patch` mais alto a partir de 1.

## Minor

É o 2° número. Qualquer atualização que adicione funcionalidades sem quebrar o código que usa versões anteriores deve incrementar esse dígito. Ex.: adição de métodos em uma classe.
Se você quiser manter a versão `major` e atualizar a `minor` e `patch` de sua dependência, inclua um `^` antes da versão no arquivo `package.json`. Ex.: ^3.4.1 - instala ou atualiza a versão 3 que contenha o `minor` e `patch` mais alto a partir de 4.1.

## Major

É o 1° número. Qualquer atualização que quebre a retrocompatibilidade deve incrementar esse dígito. Ex.: Remoção de uma função ou a remoção/renomeação de um método de classe.
Se você quiser manter a sua dependência sempre atualizada com a última versão, use um `*` como versão no arquivo `package.json`.


__Fontes:__

- Documentação oficial: https://semver.org
- Documentação do NPM: https://docs.npmjs.com/about-semantic-versioning

__Ferramenta para testar a sintaxe:__ https://semver.npmjs.com/
Advice of HE President Paul Kagame to Entrepreneurs
Tags: rwanda, entrepreneurship, youth
Published: 2020-04-18 20:09:27

I had had this question for a long time. In the Youth Entrepreneurship Town Hall with H.E President Paul Kagame and Strive Masiyiwa.

I had a chance to ask it and got not only the answer but also advice from The President of Rwanda. Watch the video of the question and answer here 👇
https://youtu.be/exhlHt-tXg8?t=5440
Conditional Ternary Operators for Beginners
Tags: beginners, webdev, javascript, programming
Published: 2020-04-18 19:29:30

---
title: Conditional Ternary Operators for Beginners
published: true
description: ternary operators, beginners, javascript, conditions, conditional
tags: #beginners #webdev #javascript #programming 
cover_image: https://pluralsight2.imgix.net/paths/images/javascript-542e10ea6e.png
---

I’ve been hard at work exploring React.  I’ve been following a React tutorial on [FCC’s Youtube channel] (https://youtu.be/DLX62G4lc44).  While following along with the tutorial, the instructor used conditional ternary operators and that’s when I realized I have never really used them.  I’ve seen the conditional ternary operator in use on several tutorials, but I’ve never really used them in my own code.  So far I’ve learned the following.

According to [MDN] (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator) the Conditional Ternary Operator is a shortcut of an if statement and should be written using this syntax:

**Condition? If true do this : If false do that**


Here are some examples to clarify...

###Example 1
```javascript
function getAge(age){
return (age >=18? 'You are old enough': 'you are too young')
}
getAge(19)
//output: "You are old enough"
 
getAge(9)
//output: "you are too young"
```


The function **getAge** has a parameter of *age*.  If the *age* is equal to or less than 18, the string 'You are old enough' is returned. If the *age* is under 18, the string 'you are too young' is returned. 


###Example 2

```javascript
function isHungry(ateDinner){
 return (ateDinner ? 'Eat dinner': 'Drink some water')
}
 
isHungry(true)
//output: "Eat dinner"
 
isHungry(false)
//output: "Drink some water"
 
isHungry()
//output: "Drink some water"  null and undefined are considered falsy
```


The function **isHungry** has a parameter called *ateDinner*.  When using *ateDinner* as a condition, if it is truthy ‘Eat Dinner’ will be returned.  If *ateDinner* is falsy, ‘Drink some water’ will be returned instead. Take note of the last line.  If the **isHungry** function is called without an argument it is falsy.

###Example 3

```javascript
let account = 1000;
let carPrice = (account >= 300) ? "You can buy the car" : "This car is too expensive";
console.log(carPrice)
//output: 'You can buy the car'
```
In this example, I am using the variable *account* as the condition for my conditional ternary operator.


**Keep working...Keep striving...Keep coding!**
Animated Charts & Graphs
Tags: css, webdev, career, beginners
Published: 2020-04-16 09:56:18

---
title: Animated Charts & Graphs
published: true
description: 
tags: #css #webdev #career #beginners
---
[<h1><b>check out More Example gscode.in</b></h1>](https://gscode.in/)

<p><b>1. </b>Mobile friendly Preamp widget. 100daysui day 90 partial implementation. To make custom styled input range work well on all modern browsers, tablet devices and phone devices seems difficult. Probably not going that path again. I would prefer custom build vertical sliders for better control of styling results and less CSS vendor prefix code clutter. Reference: 100daysui.com/#cbp=ajax/shot-90. Tested with Chrome, Firefox, Edge, IE11, Safari, Android</p>

{% codepen https://codepen.io/kunukn/pen/obJEJE %}


<p><b>2. </b>A series of animated chart cards using the least amount of css and information as possible</p>

{% codepen https://codepen.io/chrysokitty/pen/QbVPzK %}


<p><b>3. </b>Animated chart<p>
{% codepen https://codepen.io/enxaneta/pen/KVGWQL %}

CodePen Home
Animated chart

<p><b>4. </b>This is a combination of JavaScript maps engine made with amCharts and box2D physics engine. The physics engine is used to solve overlapping bubbles and for fancy gravity effects. </p>

{% codepen https://codepen.io/amcharts/pen/XJexyR %}


<p><b>5. </b>-an updated example of morris.js charts</p>

{% codepen https://codepen.io/andreic/pen/CJoze %}

<p><b>6. </b>DailyCSSImages 30 - Bar graph</p>

{% codepen https://codepen.io/Chaaampy/pen/mwvpGE %}

<p><b>7. </b>Animated Bar Graphs<p>

{% codepen https://codepen.io/alex_rodrigues/pen/ogYZdr %}

<p><b>7. </b>Needed a simple but pretty line chart for a presentation and ended up creating this.</p>

{% codepen https://codepen.io/hakimel/pen/nLFDv %}

[<h1><b>check out More Example gscode.in</b></h1>](https://gscode.in/)