teleren/devto huggingface dataset:
Giving Thanks for Diversity in Tech: Tae’lur Alexis
Published: 2020-01-15 20:44:34

---
title: Giving Thanks for Diversity in Tech: Tae’lur Alexis
published: true
date: 2019-12-04 19:06:36 UTC
tags: 
canonical_url: https://www.thisdot.co/giving-thanks-for-diversity-in-tech-taelur-alexis
---

![20190425 185724](//images.ctfassets.net/zojzzdop0fzx/4NLgXrPYp8cmQUaN8VydOn/c65fa2ce9caa76ef25bce44c05254e3c/20190425_185724.jpg)

Tae’lur Alexis is an independent U/I engineer, focused on building progressive web apps and accessible user interfaces with React.  But not only a strong developer, she is also a content creator, who loves to share her passion for learning with the developer community!

Tae’lur has a ton to celebrate this year.  In August, she delivered her first keynote at Write Speak Code 2019 in San Francisco, where she discussed her journey from learning how to code to founding her own startup, CodeEveryday.io.

According to its website, Code Everyday “is an online platform with a purpose to provide developers with access to learning resources, mentorship opportunities and job opportunities.”  Having come from a non-traditional tech background, Tae'lur created the app, in part, to make the tech space more inclusive, and dispel the myth that there is only one path into tech!

When asked about what inclusion means to her, Tae’lur shared that, “Inclusion means building products, creating spaces, and having discussions that have the feelings, perspectives, and well-being of marginalized folks as a priority, and not an afterthought.”

She encourages other women interested in pursuing tech to “not be afraid to take on opportunities and build your own path to success...Embrace learning- it's a long lasting commitment, and with it comes the realization that no one is ever truly an expert.”

In the coming year, you can expect to see more of Tae’lur on the conference circuit with at least one speaking engagement already booked with React Finland in May.  She is also excited to be launching Code Everyday’s platform very soon, so be on the lookout!

To learn more about Code Everyday, you can visit its [website](https://codeeveryday.io/), and to keep up with Tae’lur, you can follow her on Twitter at [@TaelurAlexis](https://twitter.com/TaelurAlexis).
React Hooks Snippet: Snake Game
Tags: react, typescript, javascript, gamedev
Published: 2019-12-04 18:54:50

---
title: React Hooks Snippet: Snake Game
published: true
description: Snake game built with React Hooks! 🐍
tags: react, typescript, javascript, gamedev
series: React Hooks Snippets
cover_image: https://thepracticaldev.s3.amazonaws.com/i/pd9hb6mbluvj39khwcp6.gif
---

Hey all! How would you model a [snake game](https://en.wikipedia.org/wiki/Snake_(video_game_genre)) with React Hooks? Here's how I would do it! ([You can play here!](https://343rh.csb.app/) and [Edit here!](https://codesandbox.io/s/snake-hooks-343rh))

The main things to look at:

* This is written in Typescript, to assist the gist also contains the same code in [JavaScript](https://gist.github.com/shiftyp/aeeb806b79902276b4fc35c525896cd9#file-snake-js).
* The types!
   * Snake takes place on a two dimensional grid, so we represent locations on that grid with a `Coordinate` type, which is a tuple of two numbers representing the x and y positions
   * The Snake itself is represented in two ways:
      * `Snake`: An array of coordinate arrays
      * `SnakeMap`: A sort of [Trie](https://en.wikipedia.org/wiki/Trie) built from the coordinates
      * Why both? Do you want to know where the snake is, or if the snake is in a specific place? You'll probably need to know both things at different times, so we create two structures that efficiently answer each question.
   * The `Game` is a combination of all the data about the snake, plus:
      * a coordinate for the `food`
      * the `score`
      * and an `alive` boolean
   * Finally, we need a direction to move in, so we have a union type of single characters for each cardinal `Direction`
* There are three important hooks our `useSnake` hook calls:
   * First: It calls `useReducer`, reducing a `Game` from a `Direction`. This is an action packed reducer, which is the logic behind the `moveSnake` function.
   * Second: It calls `useRef` to create a persistent object to store our direction. Why `useRef` instead of `useState`? Because we don't want to re-render every time you hit a direction key, which updating a stateful value would do. We also use `useCallback` here to create a persistent callback to update the ref.
   * Third: It calls `useEffect`, which (assuming the snake is alive) sets up the interval which forms our [game loop](https://gameprogrammingpatterns.com/game-loop.html). What do we do in the loop? Move the snake in the current direction!

If snakes or games aren't your thing, but you like this style, leave a comment with what hooks snippet I should write next!

{%gist https://gist.github.com/shiftyp/aeeb806b79902276b4fc35c525896cd9 file=snake.ts %}
The Importance of Kindness
Tags: career, advice
Published: 2019-12-04 18:54:29

Today I would like to have a conversation about "the most important skill." In reality, what that is is purely subjective. 

I'm going to get right to the point. The most important skill you can have in any job or profession is **kindness**.

## What is Kindness?

Kindness is being considerate and engaged. It is being concerned and invested in the well being and growth of yourself and others. It has no elements of selfishness and is something I find to be a core feature of human nature. We all embrace our kindness in different ways and to varying levels, but that doesn't make any one person better than or worse than someone else.

## Practice Kindness

Pay attention to when your colleagues are struggling or asking questions. Check in with the teammates you work closely with. These actions build a sense of trust and will help you form a more cohesive and collaborative team.

Commend your teammates when they achieve something, no matter the scale of their success. Kind words and affirmation are the building blocks of continued success. The next time your teammate finishes a feature, congratulate them!

Be there for the failures as well. We learn valuable lessons from failures, and they should be seen as learning opportunities, not weapons to tear others down. In any case, failure is tough to deal with, and having the willingness to talk through those failures inspires courage and helps us become more well-rounded individuals.

(This one takes courage and is not easy) Point out when someone has done something that hurt someone else in some way. Share your feedback on how that made you, and how it could have possibly made someone else feel. Explain how you think the situation could be rectified.

Finally, never forget to be kind to **yourself**. Don't take on that side project if you don't feel like you have the bandwidth to do so, unless you need to do it for financial reasons. Don't force yourself to work extra hours because you think you owe it someone, again, unless your finances dictate it is necessary. If you can, don't deny yourself breaks and vacations from your work. Be honest with yourself at every turn.

## In Closing...

Be kind.
The Daily Dose: Tools you can use!
Tags: productivity, beginners, codenewbie
Published: 2019-12-04 17:37:30

Today's tool is handy for learning, and grabbing commonly used code snippets to help in your workflow! I like it because it has tutorials and exercises along with the snippets. Solutions are available on [Codepen](https://www.codepen.io/w3resource/ "Codepen"), too.

This is an awesome site to grab some code for Frontend, backend, database, linux, API and much more. [W3resource snippets and tutorials](https://www.w3resource.com/ "").

You can find the full site here: [W3resource](https://www.w3resource.com/ "W3resource").
[JS bits] Value vs Reference variable assignment
Tags: javascript, jsbits, tutorial, beginners
Published: 2019-12-04 17:34:57

**Assignment** is one of the first things we are introduced to while learning JavaScript and it's of paramount importance to understand how Javascript does this to ensure that you write bug free code that doesn't changes values unintentionally.

## Let's get down to business

When assignment is performed between two variables and the value that gets assigned is one of the five primitive types (Number, String, Boolean, Null and undefined) then a copy of the actual value is assigned. On the other hand, when the value getting assigned is one of the special types (Array, Function, Object), a reference to the value gets assigned.

So what does this mean for you?

## Example Time!

### Assignment of primitive type

```js
const num1 = 1;
let num2 = num1;

console.log(num1, num2); // output: 1 1 

num2 = 2;

console.log(num1, num2); // output: 1 2
```

`num1` is assigned a value of type Number and then `num2` is assigned `num1`, since `num1` is a primitive type, `num2` is set as equal to the value in `num1` and is an entirely separate from `num1` and so reassigning `num2` to 2 has no effect on `num1`.

### Assignment of special type

```js
const person1 = { name: 'John Doe' };
let person2 = person1;

console.log(person1, person2); 
// output: {name: "John Doe"} {name: "John Doe"}

person2.name = "Sam Smith"; // Reassigning person2

console.log(person1, person2); 
// output: {name: "Sam Smith"} {name: "Sam Smith"}
```

The difference between both types of assignment can be seen clearly, as the reassignment of `person2` affects `person1` since only the **reference** of the value in `person1` is assigned to `person2` as `person1` is a special type and not a primitive type. 

If left unchecked this could result in unintentional bugs that'll be tricky to debug.

### Liked the post? Show some ❤️

## Resources
1. [MDN Web Docs — Assignment operators](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Assignment_Operators)
Mes premiers tests avec Quarkus
Tags: java, quarkus, codelab
Published: 2019-12-04 17:31:43


Lors du Devoxx Paris 2019, j'ai assisté à l'université Quarkus faite par [**Emmanuel Bernard**](https://twitter.com/emmanuelbernard) et [**Clément Escoffier**](https://twitter.com/clementplop). J'avais déjà suivi de loin l'actualité de ce nouveau framework Java mais l'université m'a bluffé. Cela m'a redonné envie de remettre mon nez dans du développement Java ! 

![Quarkus](http://jeanphi-baconnais.gitlab.io/img/quarkus.png "Quarkus")

🚀 **Quarkus** c'est quoi ? D'après Red Hat c'est quelque chose de **Supersonic Subatomic Java**. Les temps annoncés sur leur site le montrent bien :

![Temps de réponse](http://jeanphi-baconnais.gitlab.io/img/quarkus_metrics_graphic_bootmem_wide.png)

Le temps d'appréhension du framework est vraiment rapide, et il est simple de réaliser des développements fonctionnels. Après avoir manipulé rapidement différentes librairies sur des projets de test, il m'est venu l'idée de monter un atelier pour partager mon expérience et faire profiter des personnes pour qu'elles aient un vernis théorique et un temps de manipulation.

Le 25 novembre, la version finale 1.0.0 est disponible ! [Quarkus 1.0.0 Final](https://quarkus.io/blog/quarkus-1-0-0-Final-bits-are-here/)

💻  Sur le repo Gitlab suivant : [Atelier quarkus](https://gitlab.com/jeanphi-baconnais/atelier_quarkus/tree/dev), vous trouverez une liste de commandes et d'informations sur les opérations de chaque exemple. Plusieurs exercices sont disponibles : 

1. création d'une API simple
2. ajout et manipulation des extensions, afin de créer une API reliée sur une base de données *MongoDB*.
3. une API d'envoi de mail (KO à l'heure actuelle)
4. deux API communiquant via du Kafka
5. création d'un scheduler
6. mise en place de cache
7. mise en place de ressource GraphQL
8. intégration avec Kubernetes

Chaque exercice contient une liste de commandes et d'informations sur les opérations à réaliser.

Je suis preneur de toute remarque ! 😜
What's the best or nerdiest prank you have ever pulled?
Tags: fun, jokes, watercooler, discuss
Published: 2019-12-04 17:15:18

---
title: What's the best or nerdiest prank you have ever pulled?
published: true
description: What's the best or nerdiest prank you have ever pulled?
tags: fun, jokes, watercooler, discuss
cover_image: https://thepracticaldev.s3.amazonaws.com/i/lyrz1o24wf8zqsa0rd36.jpg
---

I may or may not be looking for ideas to get my husband back for some annoying software he installed on our network...
Why I Write
Tags: writing
Published: 2019-12-04 17:12:00

Lately I've decided to write a lot more. Here are some of the reasons that convinced me to pick it up.

## 1. I Want To Practice Writing

Writing is like riding a bicycle. The most important trick to get better is to do it every day.

If you try to find out what good writers do to improve their writing, it's one thing that they all have in common: They write a lot. Forcing myself to create lots of written content is a way of teaching myself how to write better.

And in the end writing a post is a lot like building a product. If you're only making it public when you're fully happy with it, you've waited too long. So I tend to put an effort into starting to write and publishing a post within 2 days.

## 2. I Can Share My Posts With My Friends And Colleagues Easily

I'm regularly discussing different aspects of my work that I've formed opinions on. This can be [my hiring process,](https://dev.to/johannes_scha/a-hiring-process-that-works-1djf) [custom tooling,](https://dev.to/johannes_scha/bespoke-tooling-building-your-own-hammer-2j06) or [on-boarding a new developer to the team](https://dev.to/johannes_scha/4-tips-for-onboarding-a-new-developer-to-the-team-1d1h). I would like to give everyone the most well-structured version of that info possible. Sharing a blog post that I've crafted allows to share that content more easily.

## 3. Writing Helps Me Grow

Since writing requires me to reflect on my thoughts and actions, it allows me to learn something new from my experiences and structure my thoughts on a topic. It's an important way to grow and become better at what I do.

The content I write can capture my thoughts in that moment, while the reflection that's happening during writing is what helps me grow and mature my thoughts.

What other reasons are there to write?
Flattening a Javascript Object
Tags: javascript, beginners, webdev, tutorial
Published: 2019-12-04 16:45:49

Flattening a javascript object is a very common question asked in UI Interviews.

Flattening deeply nested object can be easily achieved by using recursive technique.

The code depends on how a flattened object should look like...

```js
// input
var user = {
  name: "Vishal",
  address: {
    primary: {
      house: "109",
      street: {             
        main: "21",
        cross: "32"
      }
    }
  }
};

//output
{
  user_name: "Vishal",
  user_address_primary_house: "109",
  user_address_primary_street_main: "21",
  user_address_primary_street_cross: "32",
}
```

### Algo:

1. Iterate over keys of the object
2. Append child key name into the parent key name
3. If the child key's value is an object again call the same function
4. Else assign key to the new value

### Code:

```js
var flattendObj = {};
const flattenObject = (obj, keyName) => {
  Object.keys(obj).forEach(key => {
    var newKey = `${keyName}_${key}` 
    if (typeof obj[key] === "object") {
      // calling the function again
      flattenObject(obj[key], newKey);
    } else {
      flattendObj[newKey] = obj[key];
    }
  });
};
console.log(flattendObj);
```

*Recursion is magical, if you know where to stop.* :cyclone:

**Follow me** for more such content.

Aiming to post the solution of such problems daily. :fire:

Challenge me with more problems. :muscle:
Sneak peek of the new npm docs website
Tags: npm, node, javascript, cli
Published: 2019-12-04 16:44:37

---
title: Sneak peek of the new npm docs website
published: true
description: Take a look at the preview of the new npm docs website
tags: npm, node, javascript, cli
---

Hi y’all, you probably don’t know yet but there’s a refresh of the npm docs website coming to you 😊

A preview is available here: https://preview-docs.npmjs.com/cli-commands/npm

Feel free to provide feedback in the comments and I’ll do my best to forward it to the rest of the team 😄
Julia: Should arrays start with 0 or 1?
Tags: julia, arrays
Published: 2019-12-04 16:43:09

Arrays in the Julia programming language are somewhat different from arrays in other programming languages. Not because of different behavior, but because they are start at 1 instead of 0. It's because Julia is used for mathematics , machine learning and scientific etc. Where calculation as mentioned, maybe a bit of confusion when interfacing to the external (non Fortran/Matlab) world but this interfacing doesn't have to be done with arrays if this should be a problem.

If you try to access the array by using zero then it will result an error like the above code:

```julia
> [2,3,4,5][0]
ERROR: BoundsError: attempt to access 4-element Array{Int64,1} at index [0]
Stacktrace:
 [1] getindex(::Array{Int64,1}, ::Int64) at ./array.jl:729
 [2] top-level scope at none:0
``` 

But using one works fine
```julia
> [2,3,4,5][0]
   1
```

Arrays should start at `1` because as people count starting from one. The thing with 0-based indexing is that you always then have to write code of the type `for i=0:len(a)-1` when iterating. Either ways, there is always some indexing arithmetic.

Most of people would hate Julia arrays because they do not start with `0` like other languages. Most languages are inspired from C so they have array index from `0`. There's a special reason especially for C i.e. the name of an array is a pointer, which is a reference to a memory location. Therefore, an expression *(arr + n) or arr[n] locates an element n-locations away from the starting location because the index is used as an offset. 

But all languages do not have start with index `0` such as MATLAB, Lua, R etc because most of the tasks that Matlab is used for, e.g. physics and engineering, use the convention of indices starting at `1` in most of the literature, so people working in these fields do not need to convert their algorithms by subtracting 1 from everything. 

Hence, I believe that Julia arrays *should* start from one because it's made for these reasons. But I think array index with `0` are needed because of representation of memory offset as they are stored in continuous addresses especially languages like C, C++ and Java.

Discussions:
https://discourse.julialang.org/t/whats-the-big-deal-0-vs-1-based-indexing/1102
https://github.com/julialang/julia/issues/558
https://groups.google.com/forum/?hl=en#!topic/julia-dev/tNN72FnYbYQ
https://en.wikipedia.org/wiki/Comparison_of_programming_languages_(array)#Array_system_cross-reference_list
http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html

Learn more about Julia Arrays:
https://docs.julialang.org/en/v1/base/arrays/
https://en.wikibooks.org/wiki/Introducing_Julia/Arrays_and_tuples
How to detect memory leaks in iOS apps
Tags: memoryleak, swift, objectivec, ios
Published: 2019-12-04 16:26:54

Tools like XCode Leaks Instrument for iOS help developers identify such leaks n the development time itself. But what is the guarantee that all such leaks are identified and all possible use-cases are tested properly? 

What if the developer and the tester missed some use cases and there are memory leaks happening in production? Here is where Finotes help the developer to get notified about the issue in real-time and that too with as much relevant data as possible so that (s)he can reproduce the bug.

Read more: https://www.blog.finotes.com/post/detect-memory-leaks-in-ios-objective-c-swift
Why devs like GraphQL; common architecture do's; & Rust performance pitfalls
Tags: todayilearned, graphql, architecture, rust
Published: 2019-12-04 16:24:34

*TL;DR style notes from articles I read today.*

### [Why developers like GraphQL?](http://bit.ly/35vOOl1)

- Superior developer experience in comparison to alternatives.
- Multiple teams can work independently and in parallel, giving developers a pleasant experience without stalling their development work.
- There is no versioning of APIs. Adding new fields has no effect on the current client’s call to the APIs.- no pain of maintaining multiple versions of the API.
- Declarative data fetching lets you ask for exactly what you need and get it.
- GraphQL schema has several advantages including predictable code, schema acting as a contract between client and server, independent teams and early detection of errors.

*[Full post here](http://bit.ly/35vOOl1), 6 mins read*

---

### [How to sleep at night having a cloud service: common architecture do's](http://bit.ly/2XEpl65)

- Have a way of deploying your entire infrastructure as you deploy code. 
- Build a CI/CD pipeline. 
- Configure a load balancer. 
- Use unique identifiers that allow you to trace a request through its lifecycle, and allows someone to see the entire path of the request in the logs. This is highly useful when things go down. 
- Have a log collection and build searchability in it. This comes in handy when searching for one unexpected log.
- Have monitoring agents to check if your service is up. 
- Automatic autoscaling based on load is great for being elastic under load.
- Create a way to test out things with 1% of your users for an hour. It is a good way to deploy changes safely. 

*[Full post here](http://bit.ly/2XEpl65), 7 mins read*

---

### [Rust performance pitfalls](http://bit.ly/2rgDbzq)

- Rust compiles in debug mode by default. It results in faster compilations, but does next to no optimizations, and slows down the code.
- It uses unbuffered File IO. So, when you write files, wrap them in a BufWriter/BufReader.
- Read::lines() iterator is easy to use, but it allocates a String for each line. Manually allocate and reuse a String to reduce memory churn to gain a bit of performance.
- In simple cases, use an iterator instead of an index loop. 
- Avoid needles collect() and allocations.

*[Full post here](http://bit.ly/2rgDbzq), 7 mins read*

---

*[Get these TL;DR style notes directly to your inbox every weekday by signing up for my newsletter, in.snippets(), here.](https://mailchi.mp/appsmith/insnippets?utm_source=devto&utm_medium=post08&utm_campaign=is)*