teleren/devto huggingface dataset:
This maybe all you need to know to use Google Keep efficenty!
Tags: productivity, beginners, cheatsheet
Published: 2022-07-31 06:17:28

1. use `?` to find the shortcut you want to use.

2. Remember that you can pin stuff to help you focus
> think about something you want to see every time you open the note)

3. When you are in the browser, you can always use `note.new` to go to the Keep and open the new todo for you to type in!
> Bonus: use `ctrl+l` to go to the address bar in chrome)


4. use hash `#` to manage your note by adding `#` at the bottom of the note
> You can just create the tag first.


5. If you have another dimension that wants to categorize your notes, use color! 
> You then can use the below link to go to notes of the color.
`https://keep.google.com/u/0/#search/color%3Dred`
 
see the pattern? if you want to go to the yellow page, change the last 3 characters to yellow, like this: `https://keep.google.com/u/0/#search/color%3Dyellow`

 


Finally, if you are a more video learning person, check the below vid and I learn all from it!
The Author also has some very good tricks on other topics, I think it's worth checking those out :)
https://www.youtube.com/watch?v=-jCyuBLLcvs
Unit testing frontend code is (probably) useless
Tags: discuss
Published: 2022-07-31 06:11:00

In [Aista](https://aista.com) we love unit tests. [Magic](https://github.com/polterguy/magic) and its satellite projects has 1,000+ unit tests, and some of the satellite projects even has 100% [unit test coverage](https://sonarcloud.io/organizations/polterguy/projects?sort=-coverage). Statically analysing code using automation is (duh!) kind of important to us. However, unit testing frontend code is quite frankly (probably) ridiculous.

Unit tests are for small units of logic, to automatically ensure that your code is (still) valid as you refactor it, and/or add features to it. If you put logic that requires unit testing into your frontend code, you are probably doing something wrong.

90% of all projects I have worked with in my professional life were enterprise administration tools, and/or customer facing websites, hubs, and registration forms, etc. If you put business logic into these frontend projects, you risk that some smart dude changes his JSON payloads, circumventing your business logic, accessing things that shouldn't be possible to access. You should therefor put your business logic, flows, and validators etc in your _backend code_. Duplicating some smaller parts of this in your frontend, such as having validators preventing a bogus payload being transmitted to conserve bandwidth is OK - But adding business logic in your frontend to the point where your frontend requires unit testing to verify its logic is still working is either redundant duplication of code to the point where you've effectively created your app _"twice"_, or if you only do it in the frontend quite frankly _madness_!

There are some exceptions to this such as frontend heavy applications that requires extreme amounts of complex frontend code. An example would be [Canva](https://www.canva.com/) from the real world, that has 95% of its _"value proposition"_ in the frontend, allowing people to create images, presentations, entirely from scratch, almost like a dumbed down version of Photo Shop. BTW, Canva is an awesome tool if you haven't tried it yet. However, most enterprise types of apps should _not_ have _any_ amount of business logic, and or other types of logic in their frontends, requiring unit testing to ensure validity. And if you've got unit tests in such projects, modifying them, and or maintaining them, only becomes harder as a result of your unit tests. And regardless of how many unit tests you have in your project, they will never replace integration testing, and/or QA testing done by human beings.

The first thing I do every time I create a new Angular component, is to delete the _"spec"_ file - Because if I needed it in the first place, somebody should probably slap me in my face ... ;)
Github Commandline - GH
Published: 2022-07-31 05:39:00

I was creating a personal project today and I felt the first thing that I needed to do was to create a repo to save all my work (I've lost my code in the past and it's not really a good feeling). 

In my everyday work as an engineer, I pay little attention to infrastructure that's already working including Git. So, it was obvious that I don't recall how to setup the authentication to the GH repo etc.

The usual way to set it up is to create GH SSH keys in the website, copy the pub file to the local desktop and add the SSH keys to my local agent. However, being a CLI person, I did not feel like clicking through the webpages to create one. I decided to explore a tool called GitHub CLI. 

At the first look of the CLI [here](https://cli.github.com/manual/gh) it was pretty unassuming website, but as I started exploring, there were quite some useful utilities hiding in plain sight.

In this post I'll describe a simple way to authorize my access to the GitHub repo.

I typed `gh auth login`, the command line asks for steps to create the type of login - In my case, I chose to use SSH, it walked through steps to create an SSH key. After it was done creating one, it launched the browser to authenticate using my GH credentials and I was done !

I then cloned the repo to my local directory using the command: `gh repo clone vishnu3014/RepoName . -u LocalDirectory` - I was all set to work in my local directory !

Also, it also helps to add SSH to the local SSH keychain. I did so by the command: `ssh-add ~/.ssh/id_rsa_key` where the id_rsa_key is the SSH key from GH.

Verify once again that the key is added to the keychain with the command: `ssh-add -l` 

And that's it ! I enjoyed the process of the using CLI to setup my GH authorization and looking forward to utilizing several GH functionality.
How much is too much?
Tags: programming, productivity, design, api
Published: 2022-07-31 05:39:00

Interview processes are killing productivity across the industry. The mental stress and unwanted financial problems in chasing "dream jobs" are literally killing people by thousand cuts. 

> Is there a way to tackle this silent killer process of interviews?
> Maybe.

The ads for interview preparation portals as getting closer to deodorant ads. People are still buying the product. That will not change. 

> The million dollar question is do you want to be one of them?

Syntax expertise can only support growth in at most first five years of a career. Beyond the first promotion, the territory is becoming harder to quantify and hence navigate.

To overcome the noisy interview heavy learning, I have created a short course to highlight tasks from daily engineering that can benefit you whenever you decide to start searching for a job.The course is currently available as free. 
[https://www.udemy.com/course/system-design-interview-upskill-career/?referralCode=0FAE9EB431F1D3726E71](https://www.udemy.com/course/system-design-interview-upskill-career/)

The last mile of job search is a lost cause. But salvaging the remaining time to build a robust skill set is possible, maybe even easy. 

> The answer is always planning.

Please do check it out. Looking forward to hear your feedback!
307. Leetcode Solution in Cpp
Published: 2022-07-31 05:02:17

```
class FenwickTree {
 public:
  FenwickTree(int n) : sums(n + 1) {}

  void update(int i, int delta) {
    while (i < sums.size()) {
      sums[i] += delta;
      i += lowbit(i);
    }
  }

  int get(int i) const {
    int sum = 0;
    while (i > 0) {
      sum += sums[i];
      i -= lowbit(i);
    }
    return sum;
  }

 private:
  vector<int> sums;

  static inline int lowbit(int i) {
    return i & -i;
  }
};

class NumArray {
 public:
  NumArray(vector<int>& nums) : nums(nums), tree(nums.size()) {
    for (int i = 0; i < nums.size(); ++i)
      tree.update(i + 1, nums[i]);
  }

  void update(int index, int val) {
    tree.update(index + 1, val - nums[index]);
    nums[index] = val;
  }

  int sumRange(int left, int right) {
    return tree.get(right + 1) - tree.get(left);
  }

 private:
  vector<int> nums;
  FenwickTree tree;
};

```
#leetcode
#challenge

Here is the link for the problem:
https://leetcode.com/problems/range-sum-query-mutable/
CSSBattle | #30 Horizon
Tags: css, challenge, cssbattle, horizon
Published: 2022-07-31 04:50:00

Welcome to CSSBattle Challenges!

In this short article, I go through my solution for [CSSBattle - #30 Horizon](https://cssbattle.dev/play/30) challenge. Please refer to the code snippet below to get a better insight into my thought processes and the implementation detail.

---

> #### Challenge:

![Horizon Challenge](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xx91xdh29gc49w5z7jkc.png)

---

> #### Solution:

```html
<div class="container">
  <div class="layer one"></div>
  <div class="layer two"></div>
  <div class="layer three"></div>
  <div class="layer four"></div>
</div>
<style>
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  .container {
    width: 100vw;
    height: 100vh;
    display: grid;
    grid-template-rows: repeat(1fr, 6);
  }
  .layer {
    width: 100%;
  }
  .one {
    background: #F7EC7D;
  }
  .two {
    background: #E38F66;
  }
  .three {
    background: #AA445F;
  }
  .four {
    background: #62306D;
  }
  .one, .two {
    grid-row: span 1;
  }
  .three, .four {
    grid-row: span 2;
  }
</style>
```

---

> #### Key Takeaway(s):
- using display grid to align children elements vertically
- using span property within display grid for children elements to take up spaces evenly 

As always, I welcome any feedback or questions regarding the implementation detail of the challenge. Otherwise, I hope this was useful!
A dummy train ticket project may be useful for schools/college projects
Published: 2022-07-31 04:07:57

```
print("\n\nTicket Booking System\n")
restart = ('Y')

while restart = ('N','NO','n','no'):
	print("1.Check PNR status")
	print("2.Ticket Reservation")
	option = int(input("\nEnter your option : "))

	if option == 1:
		print("Your PNR status is t3")
		exit(0)

	elif option == 2:
		people = int(input("\nEnter no. of Ticket you want : "))
		name_l = []
		age_l = []
		sex_l = []
		for p in range(people):
			name = str(input("\nName : "))
			name_l.append(name)
			age  = int(input("\nAge  : "))
			age_l.append(age)
			sex  = str(input("\nMale or Female : "))
			sex_l.append(sex)

		restart = str(input("\nDid you forgot someone? y/n: "))
		if restart in ('y','YES','yes','Yes'):
			restart = ('Y')
		else :
			x = 0
			print("\nTotal Ticket : ",people)
			for p in range(1,people+1):
				print("Ticket : ",p)
				print("Name : ", name_l[x])
				print("Age  : ", age_l[x])
				print("Sex : ",sex_l[x])
				x += 1
YOUTUBE VIDEO DOWNLOADER USING PYTHON
Tags: python, youtube, writing
Published: 2022-07-31 04:03:00

Here is the code to make your own YouTube video downloader.
We will use Pytube library for this purpose. Thats why Python is so popular just because of their libraries.
```
# pip install pytube

import pytube
link = input('URL please')
yt = pytube.Youtube(link)
yt.streams.first().download()
print('Downloading', link)
What's wrong Forem/DEV? #4
Published: 2022-07-31 03:16:00

## I didn't point that out earlier 😅...
But now I did. Issue:<br>
___When I load into my own profile, it would first show a follow button although it was just a split second. When I clicked on it, it would turn grey as if I had followed myself!___
<br>
### Screenshots:
![Follow](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tezibtuqegmghcpzqxoj.png)
### Affects on usage:
None.
Introductory to useState
Tags: javascript, beginners, react
Published: 2022-07-31 03:07:00


Finishing up my second phase of a boot camp, I thought I'd write a short post on React hooks. Specifically, `useState`.

The hook, `useState` is a function that React provides for us and it allows us to give our component some state. 

**What is state?**
State is data that changes over time as the user interacts with your app. 

**How do we update state?**
By using React's `useState` function of course!

`useState` will return an array that has two variables inside of it. 
 1. `State`. Name the variable as a reference to the value of the state.
 2. `setState`. This is a function returned by useState that re-renders the component caused by changes to the state.
```javascript
const [ state, setState ] = useState('initial State')
```
 
`useState` has a parameter that determines the initial value of that state. It takes a boolean, string, and number. 

**Warning! Learn from me...**

- Call hooks at the most top level of a React function component, before a return. 

- Call hooks from custom hooks like `useEffect`. 



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/13rhhazjxzerxcgtj9f4.jpg)


Let's make a count button. 

First, we need to import `useState` from React to use our function. 

```javascript
import React, { useState } from 'react'

const App = () => {

const [ count, setCount ] = useState(0)

    return(
       <div>
         <button>Click to show count</button>
       </div>
)
}
```

During the initial render, the returned state (count) is the same as the value passed as the first argument (0). The setCount function is used to update the state. It accepts new state value and re-renders the component.  

We will need to add an event listener and another function to help us update the value of `count` whenever the button is clicked.

```javascript
import React, { useState } from 'react'

const App = () => {

const [ count, setCount ] = useState(0)

const increaseCount = () => {
  setCount( count + 1 )
           /* 0 + 1 */
}

    return(
       <div>
         <button onClick= { increaseCount }>
             Click to show { count }
         </button>
       </div>
)
}
```
Above, you see that `onClick` function that will tell the button what to do when clicked. 

When clicked, it runs the function (increaseCount). 

Running the function, calls `setCount` and tells React that the state, `count`'s value has to update to 1. 

**Sources**:
“Home.” Flatiron School, 9 May 2022, https://flatironschool.com/. 

“React Interactivity: Events and State - Learn Web Development: MDN.” Learn Web Development | MDN, https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Client-side_JavaScript_frameworks/React_interactivity_events_state.
Kubernets
Tags: braziliandevs, todayilearned, kubernetes, beginners
Published: 2022-07-31 02:31:59

Kubernets é um orquestrado de containers, feito pela google ele veio do Borg que era uma ferramenta interna da empresa, um dos motivos da google criar o kubernets foi fazer a GCP (Google Cloud Provider) ficar mais competitiva com a AWS que na época dominava o mercado de cloud. Hoje em dia todas as grandes clouds dão suporte ao kubernets

O kubernets é disponibilizado por um conjunto de APIS mas normalmente utilizamos ele pela CLI com o kubectl, o k8s(abreviação para kubernets) funciona de uma forma parecida com o docker, definimos um arquivo yaml onde passamos todas as configurações para o nosso pod e aplicamos esse yaml no kubernets onde ele sobe essas configurações.

O k8s trabalha em formato de clusters (conjunto de maquinas), onde dentro desse cluster temos um node que é o master que quem vai controlar tudo o que os outros nodes vão fazer, esse node master tem os seguintes serviços rodando pra ele:

- control manager
- scheduler
- api server 

e os outros nodes tem:

- kubelet
- kubeproxy

## Dinâmica

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gqyoufypsuodyjho1p2a.png)
 
Temos um cluster que é conjunto de maquinas onde cada uma dessas maquinas chamamos de nodes, cada maquina dessas possui uma quantidade de vCPU e Memória. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3l54xmjelzed3rsvv3g8.png)

Dentro do nosso cluster temos também os pods, os pods são unidades que contem os containers provisionados, eles representam os processos rodando no cluster, cada pod pode ter mais de um container, mas na maioria das vezes e inclusive todas as vezes que eu utilizei foi sempre um pod por container 

Temos também o Deployment que é um outro tipo de objeto do k8s que seu objetivo é provisionar os pods, mas para isso ele precisa saber quantas replicas desse pod precisamos, e para isso temos um replicaSet onde podemos informar quantas replicas de cada pod queremos, geralmente informamos isso na mesma descrição do deployment.

O ReplicaSet funciona da seguinte forma, informamos quantos pods queremos de cada tipo, então por exemplo, quero 3 replicas para o meu serviço de pagamento, caso uma dessas replicas caia o replica set sobe outro pod igual no lugar imediatamente.


Caso queira saber mais sobre quando utilizei o k8s pela primeira vez e principalmente como aprender a usar ele sem precisar gastar dinheiro com cloud para isso eu fiz esse [post a um tempo atrás](https://dev.to/yanpiing/usando-o-kubernets-pela-primeira-vez-1eoj)
Kubernetes Networking (+ AWS Comparison Notes in Diagrams)
Published: 2022-07-31 02:13:00

A cool Internal Developer Platform builder - https://humanitec.com/

1. Kubernetes Networking - General Comparison to AWS
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iw1o1uuhucpc0mdf06ov.png)

2. A Drill Down on the Service and Pod Networking models
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y5f0cgfubrkudj0w2hut.png)

3. ClusterIP vs NodePort Services (blurry zoomed out)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kpvdur5ixfiy8fwlukdm.png)

4. NodePort Service (clearer zoom in)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ns1101m5nyjsnhujrfnu.png)
I just Found Notion
Published: 2022-07-31 01:59:38

Finally I found a way out of clustered work and lack of proper management when it comes to managing projects, I have tried some few app for task and project management but i think Notion crowns everything for me. I would make my personal opinion on the features i think that makes Notion beautiful and I believe every developer should use Notion.


   Nice, Simple and Easy registration to begin with, the slick way of signing up on Notion is kinda very cool with this very warm interface that kinda have this warm effects on the eyes which I love.


   Team management is like the second thing that i notice on Notion. One of the start Ups I work for kinda made my life easier by making use of Notion, with properly arranged scrum board and Workspace panel.


  Easy To Use, This to me is the most priced feature to me. You seriously do not that any teaches you how to make use Notion, anyone can know how to use notion by just looking at it, You just have to be a regular user.


  I guess i have come to the end this post i know it was not that detailed but hope it helped someone out there. Do not worry guys i promise to get better in content writing skills.
JS Tidbit: A neat trick to compose arrays with conditional items using filter(Boolean)
Tags: javascript, webdev
Published: 2022-07-31 00:19:00

Just a quick tip that you might find useful with JavaScript...

When composing an array, we sometimes need to deal with items that are either:
- potentially null or undefined, in which case we don't want to include it; or
- should only be included if a certain condition is satisfied

Here's a neat trick to do that cleanly:

```javascript
const list = [
  'A',
  somethingThatCanBeNullOrUndefined,
  condition && 'B'
].filter(Boolean);
```

In the above example, `.filter(Boolean)` will pass each array item to the `Boolean()` constructor, which converts it to a boolean value (using JavaScript's truthy/falsy coercion). 

Therefore, if `somethingThatCanBeNullOrUndefined` is null or undefined it becomes `false` and hence excluded by the filter. Similarly, if `condition && 'B'` short-circuits to `false` the item `'B'` is excluded.
#JulyOT 31: That's a wrap on #JulyOT
Tags: julyot, iot, embedded, azure
Published: 2022-08-01 16:08:20

---
title: #JulyOT 31: That's a wrap on #JulyOT
published: true
date: 2022-07-31 00:00:00 UTC
tags: julyot,iot,embedded,azure
canonical_url: https://JulyOT.dev/blog/julyot-wrap
series: JulyOT 2022
cover_image: https://JulyOT.dev/assets/images/julyot-wrap-banner-95ddf3dcd7028254039fe37013631bb6.png
---

Like all good things, #JulyOT has to come to an end. Thank you for joining us for 31 days of IoT!

In the past 31 days we've shared how to get started with IoT with IoT for Beginners, with written lessons and 4 livestreams. We've covered .NET nanoFramework for embedded development, along with some great Azure Sphere goodness, including how to emulate a classic Altair 8800 on it! We've provided guides for makers on what devices to use and how to use CircuitPython with Azure. We've learned more about PnPFlow and M5 stack. We've looked at autonomous systems with 4 livestreams on Project Bonsai. We've covered AI at the Edge with Azure Percept, smart dairy farming and TinyML. We've looked at using a Seeed Studio reTerminal with Azure IoT. We've given you a cloud skills challenge to grow your Azure IoT skills, and provided a study guide for the AZ-2220 Azure IoT Developer Specialty certification.

We've also celebrated #JulIoT this year with arduino powered rockets and learning about the reTerminal in Spanish.

Thank you for joining us, and please keep IoT in your hearts by building out your projects, learning more, getting certified, and sharing what you achieve on social media with the hashtag #JulyOT or #JulIoT. We'd love to celebrate your successes in a future post.

Despite #JulyOT being over, this site will remain! See you back here next year for JulyOT 2023.
About my own website
Tags: webdev, django, programming, python
Published: 2022-07-30 23:55:00

Hello , I programmed my website in Arabic language and it provides useful technical content and I write everything myself
And I was thinking, will I support the English language with it, and will it be useful to others?
And I was thinking, will it achieve success in the future if I keep working on it?

I also think of something
Can someone who knows English only benefit from the site while it is in Arabic (I mean without adding an English language) and I also want to ask is this site useful in publishing the site’s content

Share your idea with me 
Note : this is my website [techpediaa.com](techpediaa.com)