teleren/devto huggingface dataset:
AWS Elastic Beanstalk - Hands On
Tags: aws, cloud, devops, tutorial
Published: 2021-09-29 03:18:30

To create a stack on AWS bean stalk follow the steps below

* Search for beanstalk in the Search bar after logging in 
![alt text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kaam95jxtyo4nvrp8e1o.png)

* Click on create application on the homepage
![alt text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2xcuclrlfimfnopukxs8.png)

* Select an application name I selected `test-beanstalk-app` and tags you want to attach to this app
![alt text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r8yf42k7utp2qt4xhsyl.png)
 

* After that on platform select 

1. Platform- Language with which you want to deploy your app 
1. Select version of node.js I selected the automatically selected one
1. Platform version- Version of AWS platform that you want to select as different versions support deifferent node.js engines![alt text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fduethjv4k96nc0emif3.png)
 
* In application code select sample application for a test app. If you want to upload your own code select upload your code ![alt text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v8l6rtiihzdhsus8x9zv.png)
 

* Click on create application and wait for a few minutes after a few logs you will see the following screen
![alt text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/um317go8q6u4rpjt5nkm.png) 

* Click on the app link highlighted in the previous image to have a look at your demo app.
 ![alt text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p0pzek97i9dj9epo50qc.png)

* After that in configuration you can check all the things that were setup by AWS beanstalk
![alt text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fixajx8n2xaj38qjmuvt.png)

* You can create various environments in the environments like creating develop, production etc.
![alt text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a8dp0f36utk7sux6tum2.png)

* Finally delete your app using the applications tab and select application and after that click on actions and click delete application.
 

 ![alt text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xesnl92a4mi0adklhmqr.png)


We are done with creating a platform in Beanstalk next will study how to create your own pipelines in AWS
Week 2 - Part 2
Tags: spo600
Published: 2021-09-29 03:10:01

In Week two we learnt about the Binary representation of data.

I never really thought about how my integers, floating points, or anything for that matter was REALLY stored in memory (Obviously I knew they were stored in bits somehow)

It was fairly interesting to find out that Fixed-Point numbers are stored by separating the binary into two parts, one number, and one part fractional. 
**Here is an example - 000001.00 is decimal 1.0, and 000001.11 is decimal 1.75.**

Also watching the lecture, Chris explained something that caught my attention. Sometimes you can actually just make what seemingly has to be a double, an integer! How? Well think about it like this, when a bank needs to store how much money an account has in the system, they would typically need two parts, one for the dollars then one for the cents. Which would be stored like how I explained above. But what happens if they stored the entire thing denominated in cents? That way we can just store the entire number as an integer and make it easy on ourselves & only convert it back to dollars when we need to display it on the frontend.

Floating-point numbers actually have three parts, a sign bit (to determine positive or negative number) a mantissa, than an exponent. Here is how a floating point number is interpreted: 

**sign mantissa * 2^exponent**

The last thing I'd like to talk about is compression of images which I found particularly interesting. Specifically the idea of 'Pallettization' in which an image in stored as a sequence of multiple colours instead of storing each colour separate think of it like instead of saying

blue blue blue blue blue green green

you just said - blue 5 green 2

See how it would make it a lot better in terms of compression? I never thought about how it was stored and I found it pretty cool that that's how they do it. 

Overall I think Week 2 was pretty interesting, especially the lab!
Code Smell 88 - Lazy Initialization
Tags: oop, programming, codenewbie, webdev
Published: 2021-09-29 03:04:02

*Yet another premature optimization pattern*

> TL;DR: Do not use lazy initialization. Use an object provider instead.

# Problems

- Surprising Side Effects

- Premature Optimization

- Fail Fast Violation

- Implementative Coupling

- The Least Surprise Principle Violation

- Null Usage

- Mutability

- Transactional and Multi-threaded applications problems

- [Debugging Problems](https://martinfowler.com/bliki/LazyInitialization.html)

# Solutions

1. Inject Responsibilities with First Class Objects

# Sample Code

## Wrong

[Gist Url]: # (https://gist.github.com/mcsee/0d762f54e37352ed72eee7e77d0ae5e0)
```ruby
class Employee
  def emails
    @emails ||= []
  end
  
  def voice_mails
    @voice_mails ||= []
  end
end
```

## Right

[Gist Url]: # (https://gist.github.com/mcsee/dbd08513d5005325e63954515052555d)
```ruby
class Employee
  attr_reader :emails, :voice_mails

  def initialize
    @emails = []
    @voice_mails = []
  end
end
#We can also inject a design pattern to externally deal
#with voice_mails so we can mock it in our tests
```

# Detection

- Lazy initialization is a common pattern when used checking for a non-initialized variable. 
It should be straightforward to detect them.

# Tags

- Premature Optimization

# Conclusion

[Singletons](https://dev.to/mcsee/singleton-the-root-of-all-evil-50bh) are another antipattern often combined with lazy initialization.

We must avoid premature optimizations. If we have *real* performance problems we should use a Proxy, Facade or more independent solution.

# Relations

{% post https://dev.to/mcsee/code-smell-32-singletons-1ka %}

# More Info

- [Wikipedia](https://en.wikipedia.org/wiki/Lazy_initialization)

-[Martin Fowler](https://martinfowler.com/bliki/LazyInitialization.html)

# Credits

Photo by <a href="https://unsplash.com/@samsolomon">Sam Solomon</a> on <a href="https://unsplash.com/s/photos/lazy">Unsplash</a>  

* * *

> We have to stop optimizing for programmers and start optimizing for users.

_Jeff Atwood_
 
{% post https://dev.to/mcsee/software-engineering-great-quotes-26ci %}

* * *

This article is part of the CodeSmell Series.

{% post https://dev.to/mcsee/how-to-find-the-stinky-parts-of-your-code-1dbc %}
CodeLand
Tags: codenewbie, codeland2021
Published: 2021-09-29 01:26:57

CodeLand was last week here are some of my favorite bits from the conference.

## Musical Lessons for Engineering teams
The opening Keynote was "Musical Lessons for Engineering teams" Helen Hou-Sandi described how music teachers give feedback to students of various experience levels. She equated this to software feedback and how different skill levels needed different types of feedback to produce better code. 
She played piano to beautifully illustrate her points. This was a great talk.
[slide from musical feedback}(https://www.slideshare.net/slideshow/embed_code/key/CsxLOYaEXBavqW)


## You're not an Imposter, You're a Life-Long Learner
PJ Metz's talk focused on fighting imposter syndrome. in his humorous talk he said imposter syndrome is when you believe that you can't code well or don't know what you are doing. He explains that well you do know what you are doing. you may not know the solution to your current problem. That doesn't mean you can't code. It means you are learning how to code for the current problem. 
As a developer you will always be learning. 
[On demand version of talk](https://community.codenewbie.org/metzinaround/on-demand-talk-you-re-not-an-imposter-you-re-a-life-long-learner-4ne9)

The talks were prerecorded and streamed. So you could watch at anytime or watch the live streamed version and chat with the presenter and other attendees as the talk aired. After the talked aired there live panels with groups of presenters.

These talks are from day one of CodeLand. On day two, I woke up sick. I did the things I had to do for the day then watched for a while but I couldn't focus. I'm feeling better now and will catch up later this week. There were some I really wanted to see.
Creating a Cloud Resume (or How to Not Rely on Certs Alone)
Tags: aws, cloud, webdev, cloudresumechallenge
Published: 2021-09-29 01:10:58

Hi! Last time I talked about getting my AWS CCP cert, and I was so happy to finally have my foot in the door (or cloud I guess). So what was next?

Well, I bit the bullet and subscribed to A Cloud Guru. I'm currently studying for the Solutions Architect exam. We'll see how that goes! I've also been checking out how to get a career in the Cloud by watching a few videos. Well everyone has said that you just can't rely on certs to get hired, which makes sense. You can't just say you know AWS services, you also have to *know* them.

So let's pick a project, maybe ask what to do. ACGs challenges are a bit much. I'd love to create a recommendation engine using SageMaker and machine learning, but I don't know either of those! I checked out the ACG Discord for guidance, where I was turned onto the [Cloud Resume Challenge](https://cloudresumechallenge.dev/). This seems reasonable, a few steps, not a ton of handholding, and results I can use immediately! Great! I bought the book immediately.

And thus, my challenge began. Its been about a week now and I'm making some great progress.

* Let me be clear, I'm *not* a web developer. I learned html and css during my first degree curriculum (remember DreamWeaver?) but I'm not seasoned enough to be able to make a page from memory any more. For now, I'll use and build from a template to work the cobwebs out and add some React for some bells and whistles once I get the main content satisfied.

* I put together a simple index.html and style sheet and put them into an S3 bucket. Amazon's documentation is really great and leading you down the path, and while studying S3 for my cert, I was able to get both buckets for my domain and subdomain running really fast.

* I registered my domain with Route 53. This way I have my own personal website to use any time I want once I'm done without the user having to know that its being hosted on AWS.

* The book recommended using HTTPS for the domain, which is not provided by S3. I would need to serve the website through CloudFront to do this. First I would need to create a custom SSL certificate though AWS Certificate Manager and apply it to my CloudFront Distribution. Thankfully I'm doing all of this through AWS, so I don't have to copy and paste and troubleshoot issues through a third-party DNS.

Once those steps were created, I was able to type in my address on my browser (and on my phone) to access my basic, black-on-white resume page! This must be how they felt in the 90's! Whew, well I think that's enough for now.

Next:
* Flesh out the website. I've set up VSCode with the necessary plugins to do this.
* Learn basic React to get a counter for my site.

Until next time!
HSL-based color name
Tags: css, hsl, cssvariables
Published: 2021-09-29 01:06:36

just add the lightiness parameter of hsl color to the end of color name
```css
:root {
    
    --white : hsl(0, 0%, 100%);
    
    --gray-95: hsl(0, 0%, 95%);
    --gray-65: hsl(0, 0%, 65%);
    --gray-45: hsl(0, 0%, 45%);
    --gray-30: hsl(0, 0%, 30%);
    
    --blue-95 : hsl(195, 100%, 95%);
    --blue-45 : hsl(195, 100%, 45%);
    --blue-20 : hsl(220, 50%, 20%);

    --black : hsl(0, 0%, 10%);

}
```
First post! $Whoami
Tags: cloud, aws, webdev
Published: 2021-09-29 00:36:18

Here we go, my first post! Let's get caught up, shall we?

* I have two Bachelor's degrees, one in graphic design and another in Computer Science.

* I've been at my current job as a software engineer for a year and a half.

* I want more from my career!

Be sure to look out for more from me on this page! Thanks!
ngrok: Expose a local web server to the internet
Tags: codenewbie, webdev, codepen, beginners
Published: 2021-09-29 00:26:01

Hello devs, I got introduced to a tool that allows you to expose a web server running on your local machine to the internet. Its <mark>ngrok</mark>
![exposed secret](https://media.giphy.com/media/wDGCA2dv9VJxC/giphy.gif?cid=ecf05e47p6d7ak5bsa9bvswppv0yweaggihnvbvx7dai0yco&rid=giphy.gif&ct=g)

## Setup
Go to [Ngrok Link](https://ngrok.com/download) to signup and download the ngrok for your operating system
![ngrok1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8pmv5rvhlwuqdyasg0dl.PNG)

![ngrok 5](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0pkdlungu324v3vdsv27.PNG)
 

Let's say for example you are working on a node app running on `http://localhost:3000` and you want to expose/share your server to a colleague without using ipconfig.

🎯 Launch the ngrok
![ngrok2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u6xnpxp18tuooo2f2hyh.PNG)
 
Then type the following command
```JavaScript
ngrok http <your port number>
```
In my case `ngrok http 3000`

You should get something like this
![ngrok4](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j7xnh4bas5gfrrmii0qy.PNG)

🎯 Copy the forwarding link highlighted in red and test on any browser. (Okay, the moment of truth, what did you get? 😁)
![ngrok 4](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gpkkpsoa3qk1rzqakeer.PNG)

---
## Password protect your tunnel
```JavaScript
ngrok http -auth="username:password" 8080
```
In my case, it will be 
`ngrok http -auth="drsimple:ngrokpassword" 3000`
![ngrok 6](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c9bwt30zpfnwcp3azcnm.PNG)
Open the ngrok terminal and paste the above command.
copy the forwarding link and paste it into your browser.

This time you get:
![ngrok 7](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fxd4s1widbubad2fn04x.PNG)

 
🎯 Lastly, let us look at how we can run ngrok in our command prompt in few steps
Copy the path where you downloaded ngrok

![ngrok 8](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hklgoe5anc2f9e4gasvh.PNG)
🎯 Go to the environment variable
![ngrok 9](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n83n2uffnoidkkbfiejc.PNG)
 Click on the path, Click Edit, New, and Paste the path copied earlier.
![ngrok 11](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jmas7vnply8v3j1l8vea.PNG)
Repeat the above step for the system variable.


🎯 Your command prompt should be able to run ngrok successfully. 
![ngrok 13](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7ijg6qnibbf329zck9qe.PNG)
 

👨🏽‍🏫 For further customization check the recommended video and the <mark>ngrok</mark> docs.

I hope this was helpful. Thanks 🙌🏽  for reading.

 {% github drsimplegraffiti/drsimplegraffiti %}


## Reference
[ngrok docs](https://ngrok.com/docs)
[Reference Video](https://youtu.be/XhRmn9Y8Agk) by CyberRyker
aka.ms/mgps
Tags: tip, powershell, graph, azuread
Published: 2021-09-29 13:59:05

---
title: aka.ms/mgps
published: true
date: 2021-09-29 00:00:00 UTC
tags: tip,powershell,graph,azuread
canonical_url: https://merill.net/2021/09/aka.ms-mgps/
---

Having trouble finding the Graph PowerShell commandlet reference? I created an easy to remember shortcut at [aka.ms/mgps](https://aka.ms/mgps).

Now you can find the reference for commands like Connect-MgGraph, Get-MgUser quickly.

**BTW Are you migrating your old Azure AD PowerShell scripts to the new Graph PowerShell?**

| Did you know that we also have a handy map of the commands at [Find Azure AD and MSOnline cmdlets in Microsoft Graph PowerShell | Microsoft Docs](https://docs.microsoft.com/en-au/powershell/microsoftgraph/azuread-msoline-cmdlet-map?view=graph-powershell-beta) |
Save "Check" for chess
Tags: namingthings, softwaredevelopment
Published: 2021-10-04 11:32:27

---
title: Save "Check" for chess
published: true
date: 2021-09-29 00:00:00 UTC
tags: namingthings,softwaredevelopment
canonical_url: https://jhall.io/archive/2021/09/29/save-check-for-chess/
---

Whenever I do my Code Review workshop, I spend a few minutes going over some minor code smells that I believe are more or less universally aplicable. One of these is to avoid functions named “Check”.

Why?

Because the intention is rarely clear.

For example, suppose you see a function named `CheckFoo()`. What does this function do? I don’t know.

- Does it throw an error if a passed `foo` value is invalid?
- Does it return a boolean indicating the validity of `foo`?
- Does it check some other resource against the passed `foo` object?
- Does it return some status object about `foo`?
- Does it kick off some sort of status check in the background? How would I get the results?

Depending on your language, some of these questions may be answered by the function signature. I.e. if you know it returns a boolean, we can guess that it’s the second or third option, but that’s still not very specific.

So what’s the alternative?

Simply use a more descriptive name.

If it’s validating data, maybe `FooIsValid()`, returning a boolean, is a good choice. There’s no ambiguity there.

If you want to return more than a boolean from your validation function (such as a description of the validation failure), perhaps consider `ValidateFoo()` which throws an error or returns a descriptive text/object on failure.

Maybe you’re checking whether an external resource described by `foo` is accessible? `IsFooAccessible()` might work.

All this to say, there’s no single _correct_ way to name your functions. But `Check` is usually a _wrong_ way, for the simple reason that it’s so ambiguous.

* * *
_If you enjoyed this message, [subscribe](https://jhall.io/daily) to <u>The Daily Commit</u> to get future messages to your inbox._
Hello World
Tags: carreira
Published: 2021-09-28 22:40:00

---
title: Hello World
canonical_url: https://pedroleao.dev/posts/hello-world/
published: true
description: 
tags: carreira
//cover_image: https://direct_url_to_image.jpg
---

Hoje é um dia bastante especial pra mim. Além do meu aniversário, finalmente estou lançando o meu blog. Já tinha um bom tempo que eu queria fazer isso e foi legal finalmente tirar isso do papel! :D

Decidi utilizar o framwork [Hugo](https://gohugo.io/) para ter uma maior velocidade no desenvolvimento e me preocupar mais com a criação de conteúdo do que o desenvolvimento do próprio blog. A experiência foi maravilhosa e, para quem desejar criar o seu próprio blog, recomendo demais já que o deploy no [Netlify](https://www.netlify.com/) é muito facilitado. ;)

É possível que eu faça um tutorial de como foi esse processo de criação aqui mesmo no próprio blog. Fiquem de olho! :D

## A proposta do blog

Como eu disse antes, já fazia um bom tempo que eu queria criar um site pessoal/blog, e o motivo pra isso foi para que eu pudesse compartilhar com as pessoas o meu aprendizado e também ajudá-las de alguma forma. E no mundo dev eu acredito que nada seja melhor que um blog para se comunicar com outras pessoas que programam. É uma forma de poder contribuir com todo mundo que, direta ou indiretamente, me ajudou também.

Eu sempre fui uma pessoa muito curiosa, e não digo só com relação à desenvolvimento de software. Tenho curiosidade sobre diversos assuntos e aqui acaba sendo um cantinho meu que posso compartilhar isso com quem quiser ler. Acredito que isso vai ser o que mais vai rolar por aqui.

Outro motivo é que eu tenho certeza de que vou aprender muito fazendo isso tudo, e que vou evoluir muito no processo!

## Quer ajudar?

[Aqui](https://docs.google.com/forms/d/e/1FAIpQLSdT3UT4gCv0AYOdl6f6wzxfMfIJ2Nrgi9gIExU3puUSDxqDyw/viewform) eu criei um formulário do google onde vocês podem sugerir conteúdos para o blog. Vou pegar esses dados e sempre tentar criar algum conteúdo baseado nas respostas que receber.

Muito obrigado por ter lido até aqui, espero que a leitura do blog te traga inspiração para você também realizar os seus projetos.

Nos vemos por aí! :)
Understanding functions
Tags: javascript
Published: 2021-09-28 22:32:09

function () {
  return 1;
}

// The above is the same as...

() => {
  return 1;
}

// All the code above create a un-reusable function. All of the code below creates a reusable function.

function a() {
  return 1;
}

// The above code is the same as...

var a = function () {
  return 1;
}

// The above code is the same as...

var a = () => {
  return 1;
}
Day 461 : Don't Play Around
Tags: hiphop, code, coding, lifelongdev
Published: 2021-09-28 22:12:59

_liner notes_:
- Professional : Pretty productive day. Had a couple meetings, updated my next blog post with some new info and also the demo application that goes with it. Also went through a couple pull requests for an update to the Client SDK.

- Personal : So I started working on coding my new side project. I wanted to try a new framework I've been looking at, but I ran into some issues trying to get the functionality of my app working. I'll play with it a little more to see if I can get it working, but from what I'm reading, the framework may not be the best solution. We'll see it. I need to make sure I don't play around too long, I want to get this project done.

![A pond in Krka Nat'l Park, Croatia surrounded by a forest and waterfalls](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/muvgiceqlbhfs41abjuc.jpg)

Going to work on my side project some more and make a decision on whether or not I'll continue with the new framework. Also want to watch an episode of Boruto and go through tracks for the radio show.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube jTR7P7gyZkk %}
All deployments regardless of retention period?
Tags: discuss, octopusdeploy, api, node
Published: 2021-09-28 21:42:05

I've asked in various places including Stackoverflow and at work this question but not getting anything back: how to get a list of all project deployments regardless of retention period (specifically using Octopus Deploy REST API)?

What I'm currently getting: a list of all project deployments as per retention period set.

I believe (might be wrong) it's retention period is set per environment as, for example, for project X I'm getting 2 Live deployments back and in the same project all (by default) of Branch Tests.

I'm wanting to get a list of all project deployments but, to me at least, seems odd I can't get just a list regardless of retention period.

This gets me a list of all deployments but still only get 2 for Live for instance.

`HTTP GET: https://<base-url>/api/deployments`

Does anyone have idea how to get around this? Or have I missed something? There is documentation online in general but not enough tbh and not this specific.