teleren/devto huggingface dataset:
Leetspeak Generator
Tags: python, programming, computerscience, functional
Published: 2021-09-27 00:51:32

[GitHub Repo](https://github.com/sagordon-dev/leetspeak-generator.git)

![Console Output](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0088z4fsqizpczevzi6l.png)

```python
# leetspeak_generator.py
#   This program translates English messages into l33t5p34]<.
# by: Scott Gordon

import random

try:
    import pyperclip  #  check for util that copies text to clipboard.
except ImportError:
    pass


def main():
    print("***** L3375P34]k 63n3r470R *****")
    print("Enter your message:")
    english = input("> ")
    print()
    leetspeak = english_to_leetspeak(english)
    print(leetspeak)

    try:
        pyperclip.copy(leetspeak)
        print("(Copied leetspeak to clipboard.)")
    except NameError:
        pass


def english_to_leetspeak(message):
    """Convert english string to leetspeak"""
    char_map = {
        "a": ["4", "@", "/-\\", "^"],
        "b": ["I3", "8", "13", "|3"],
        "c": ["[", "{", "<", "("],
        "d": [")", "|)", "[)", "|>"],
        "e": ["3", "[-"],
        "f": ["|=", "ph", "|#", "/="],
        "g": ["&", "6", "(_+]", "9", "C-", "gee"],
        "h": ["#", "/-/", "[-]", "]-[", ")-(", "(-)", ":-:", "|-|", "}{"],
        "i": ["1", "[]", "!", "|", "eye", "3y3", "]["],
        "j": [",_|", "_|", "._|", "._]", ",_]", "]"],
        "k": [">|", "|<", "/<", "1<", "|c", "|(", "|{"],
        "l": ["1", "7", "|_", "|"],
        "m": ["/\\/\\", "/V\\", "JVI", "[V]", "[]V[]", "|\\/|", "^^"],
        "n": ["^/", "|\\|", "/\\/", "[\]", "<\\>", "{\\}", "|V", "/V"],
        "o": ["0", "Q", "()", "oh", "[]"],
        "p": ["|*", "|o", "?", "|^", "[]D"],
        "q": ["(_,)", "()_", "2", "O_"],
        "r": ["12", "|`", "|~", "|?", "/2", "|^", "Iz", "|9"],
        "s": ["$", "5", "z", "ehs", "es"],
        "t": ["7", "+", "-|-", "']['", '"|"', "~|~"],
        "u": ["|_|", "(_)", "V", "L|"],
        "v": ["\\/", "|/", "\\|"],
        "w": ["\\/\\/", "VV", "\\N", "'//", "\\\\'", "\\^/", "\\X/"],
        "x": ["><", ">|<", "}{", "ecks"],
        "y": ["j", "`/", "\\|/", "\\//"],
        "z": ["2", "7_", "-/_", "%", ">_", "~/_", "-\_", "-|_"],
    }
    leetspeak = ""
    for char in message:
        if char.lower() in char_map and random.random() <= 0.70:  # 70% convert
            possible_replacements = char_map[char.lower()]
            leet_replacement = random.choice(possible_replacements)
            leetspeak = leetspeak + leet_replacement
        else:
            leetspeak = leetspeak + char
    return leetspeak


if __name__ == "__main__":
    main()

```
[Verify my Python](https://www.ziprecruiter.com/verify-skill/4503e8d7/v1:U2FsdGVkX18fFxPKGHcXEiz2sH8gfiRke3OcG2MvxE-54eg3MS5RbS7qi-hTZeGxVAS-YYi2fQw/#UHl0aG9u)

Photo by <a href="https://unsplash.com/@ikukevk?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Kevin Ku</a> on <a href="https://unsplash.com/s/photos/hacker?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
CTA Button
Published: 2021-09-27 00:30:14

#Intro
For IST 402, our group has been working to create a CTA button similar to the "Shop" button on the Nike website. 

#Difficulties
For our group, neither of us have much experience working with Github and it has been a main pain point for us as we work to ensure that our commits, pushes, and pulls are working as intended. Additionally, we have no prior experience with CTA buttons or web components in general and working to get a general understanding of this has been a bit of a struggle as well.

#Successes
Overall, we have the basics of our CTA button working although it is not very advanced in any way. This includes the the button working as a link and opening in a separate tab, different states, etc. In class, we learned how to implement an icon onto the button from a library. I am quite happy with the progress we have made with the little knowledge we began with and look forward to progressing our button!

#Repo Link
[Link](https://github.com/IST402-Group-F/CTA-Button)
📊 Calculating DORA Metrics - Deployment Frequency
Tags: node, devops, dora, showdev
Published: 2021-09-27 00:23:25

The easiest metric to calculate - get a list of project deployments by environment and then group by date format(s) i.e. by day, by month and by year; and finally to calculate the throughput % score which is essentially:

throughput % = (count of deployments by environment * count of all deployments) * 100

I've parsed the data into a specific format for my charts in the frontend. Check out my [repo here](https://github.com/lornasw93/dora-metrics).

Result:

```
{
    "score": 4.16,
    "result": [
        {
            "title": "By Day", 
            "content": [
                {
                    "name": "29 Aug 21",
                    "value": 2
                },
                {
                    "name": "10 Sep 21",
                    "value": 2
                }
            ],
            "average": 2
        },
        {
            "title": "By Month", 
            "content": [
                {
                    "name": "Aug 21",
                    "value": 2
                },
                {
                    "name": "Sep 21",
                    "value": 2
                }
            ],
            "average": 2
        },
        {
            "title": "By Year", 
            "content": [
                {
                    "name": "21",
                    "value": 4
                }
            ],
            "average": null
        }
    ]
}
```

Thanks for reading!
📊 Intro: DORA Metrics
Tags: node, devops, dora, showdev
Published: 2021-09-27 00:14:17

I've created a small Node.js project to calculate DORA Metrics, it's ongoing so is not finished but you can find the [repo here](https://github.com/lornasw93/dora-metrics). 

References/useful links: [Accelerate: State of DevOps 2021](https://services.google.com/fh/files/misc/state-of-devops-2021.pdf), [DORA metrics explained](https://www.sleuth.io/post/dora-metrics-explained)

## What is DORA?
DORA (DevOps Research and Assessment) represents 7 years of research by a team at Google to identify the most effective and efficient ways to develop and deliver software. They surveyed more than 32,000 industry professionals to find out and understand what makes a high performing team different than a low performing team. As a now industry standard, DORA's research has identified four key metrics (depending on where you look will have slightly different names):

### Deployment Frequency
Measure <u>throughput</u> by how often an organisation successfully releases to production.

For elite performers: on demand, multiple deploys per day
For high performers: once per week - once per week
For medium performers: once per month - once per 6 months
For low performers: < once per 6 months

### Lead Time for Changes
Measure <u>throughput</u> by the amount of time it takes a commit to get into production.

For elite performers: < one hour
For high performers: 1 day - 1 week
For medium performers: 1 month - 6 months
For low performers: > 6 months

### Time to Restore Service
Measure <u>stability</u> by how long it takes an organisation to recover from a failure in production.

For elite performers: < 1 hour
For high performers: < 1 day
For medium performers: 1 day - 1 week
For low performers: > 6 months
 
### Change Failure Rate
Measure <u>stability</u> by percentage of deployments causing a failure in production. 

For elite performers: 0% - 15%
For high performers: 16% - 30%
For medium performers: 16% - 30%
For low performers: 16% - 30%

## ✨ Thank you ✨
This is a first post in a series #AllAboutDora, hope this post was useful and interesting!
What is the difference between deploy and release?
Tags: featureflags, softwaredeployment, sdlc, softwarerlease
Published: 2021-09-30 09:31:04

---
title: What is the difference between deploy and release?
published: true
date: 2021-09-27 00:00:00 UTC
tags: featureflags,softwaredeployment,sdlc,softwarerlease
canonical_url: https://jhall.io/archive/2021/09/27/what-is-the-difference-between-deploy-and-release/
---

Outside of an educational setting, all software is built to be used by people (or perhaps in rare cases, non-human animals). The final stage in this process of getting software in front of its users has many names. Two common ones: Deploy & Release.

Are these terms synonyms?

This is actually a complicated question, because both terms have multiple meanings, which in some cases overlap, and in other cases have practically nothing to do with each other.

For example, as a noun, a “software release” is usually thought of as a specific set, or build of software, often identified by a version number. By extension, creating this “release” can be thought of as “releasing the software.”

Similarly, a “software deployment” is often thought of as version (or “release”) of software, as installed in a specific environment.

But I want to focus on a slightly different aspect of these two words, one which is often overlooked, particularly as it relates to _features_ of software, as opposed to an entire software system. I’ll start by making a claim that may seem counter-intuitive to many, then try to justify it.

> It is possible to deploy a feature without releasing it.

As a sort of logical extension to the idea that [delivery comes before, and is disinct from deployment](https://jhall.io/archive/2021/04/02/whats-the-difference-between-continuous-delivery-and-continuous-deployment/), deployment may come before, and can be distinct from a release. In particular, this happens any time you deploy a feature that is disabled by a feature flag.

**So what?**

This can have profound implications in certain situations. Two of the [common complaints I hear against continuous deployment](https://jhall.io/nocd/) are directly addressed by this observation:

> Reason 3: Our end users need to be informed of all changes Reason 4: We’re working on a big feature that’s not ready to deploy yet

By decoupling _release_ from _deployment_, it’s possible to address both of these concerns, while still doing continuous deployment.

Are you worried about the complexity of feature flags? Don’t be. Getting started is [easy](https://jhall.io/archive/2021/04/10/the-poor-mans-feature-flag/), and requires no new frameworks or technology.

* * *
_If you enjoyed this message, [subscribe](https://jhall.io/daily) to <u>The Daily Commit</u> to get future messages to your inbox._
Using PNPM on Netlify
Tags: netlify, javascript, webdev, programming
Published: 2021-09-27 11:19:10

---
title: Using PNPM on Netlify
published: true
date: 27/09/2021
tags: Netlify, JavaScript, Webdevelopment, Programming
canonical_url: https://www.elian.codes/blog/09-27-21-using-pnpm-on-netlify/
---

# Using PNPM on Netlify

When I first switched my website over to [PNPM](<https://pnpm.io/>) instead of [Yarn](<https://yarnpkg.com/>), I noticed that my [Netlify](<https://www.netlify.com/>) build were failing, although I set the build command to `pnpm build`. Here's a solution for everyone having the same issue, since I couldn't find any relevant information out there.

## Switching to PNPM

Switching to PNPM locally is almost instant. it's as easy as removing the older `package-lock.json` or `yarn.lock` file and then installing PNPM. (you can install it using a number of different ways, [more information here](<https://pnpm.io/installation>))

```bash
(Invoke-WebRequest 'https://get.pnpm.io/v6.14.js' -UseBasicParsing).Content | node - add --global pnpm
```

PNPM uses a very familiar syntax, so I won't explain further. You just have to track the `package.json` and newly generated `pnpm-lock.yaml` file to install dependencies on Netlify

## Telling Netlify to build using PNPM

Netlify offers a few different ways to interact with the build-environment. The easiest (and the one I use), is using the Netlify UI on their website. I will explain further how to use PNPM via the UI, but if you use a [`netlify.toml`](<https://docs.netlify.com/configure-builds/file-based-configuration/>) file, the approach should be roughly the same.

Actually, the approach is easy. Netlify doesn't have PNPM installed on their buildenvironment, but they do have NPM & Yarn installed. So we can mis-use them to install PNPM and go on from there. Just add the following as a buildcommand:

```bash
pnpm build || ( npm install pnpm && pnpm build )
```

The script will try to run `pnpm build` at first. If it fails, because PNPM is not installed, it will install PNPM using NPM and then proceed to run `pnpm build`.

Clever right.
Git - Deal with rejected changes over protected branches
Tags: notes, git, branching
Published: 2022-11-01 22:29:55

---
title: Git - Deal with rejected changes over protected branches
published: true
date: 2021-09-27 00:00:00 UTC
tags: notes,git,branching
canonical_url: https://qjuanp.dev/post/git-deal-with-rejected-changes-over-protected-branches
---

![This could be your state, having a commit out of sync because is rejected by git remote](https://qjuanp.dev/assets/2021-09-27-git-deal-with-rejected-changes-over-protected-branches/state.png)

**Scenario:** main([\*](https://github.com/github/renaming%20(Renaming%20the%20default%20branch%20from%20master%20-%20extended%20expkanation%20by%20Github%20about%20why%20rename%20master%20as%20main%20in%20all%20repos))) integration branch rejects changes when try to pushing into remote repository. This is a common practice to follow Gitflow (or other branching strategies) to enforce merge reviews into the into the main branch.

So, how to push correctly your changes into main integration branch?

Summary:

1. [Create a feature branch](#create-a-feature-branch)
2. [Reset your local main integration branch and sync up with remote main branch](#reset-main)
3. [Push your feature branch and create a Pull Request](#push-your-feature-branch-and-create-a-pr)

## Create a feature branch

![create a feature branch](https://qjuanp.dev/assets/2021-09-27-git-deal-with-rejected-changes-over-protected-branches/step-1-create-branch.png)

Create a feature branch from your main integration branch, remember that branches are just named pointers to actual commits, so, new branch will be pointing out to your latest changes, which are the ones you’re trying to push correctly into the integration branch.

`git checkout -b [feature-branch-name]`

> Remember to follow your defined naming conventions to name the new feature branch.

## Reset main

![Reset main branch](https://qjuanp.dev/assets/2021-09-27-git-deal-with-rejected-changes-over-protected-branches/step-2-reset-main.png)

Let’s move the local main branch pointer to the same commit that remote branch is referencing.

> In this example we assume that is just one commit behind the last commit, in that case we just need to run:

`git reset --hard HEAD~1`

Where:

- Reset will move the pointer
- `--hard` just move the pointer, discard all the changes
- `HEAD~1` one commit before current HEAD pointer

The result is something like this:

![Result of resetting main branch](https://qjuanp.dev/assets/2021-09-27-git-deal-with-rejected-changes-over-protected-branches/step-2-result.png)

## Push your feature branch and create a PR

Now you can push your changes under the new branch:

`git push origin [feature-branch]`

And after that you will be able to create a PR to merge your changes with the main integration branch.
RustLings I
Tags: rust, learning
Published: 2021-09-26 23:08:09

Hello again! I had a nice sleep :))

Today we'll learn how to use variables in Rust :D

Oh yeah! Something you need to know is that all exercises of variables have been done by my little sister of 10 years xd

Just for you to know SJSJJSSJJSJSJ

In the first file of [rustlings](https://github.com/rust-lang/rustlings) we get an error that simply means, `x does not exist` and that's because we haven't defined the variable.

So... the way to define a variable is using the keyword `let`
```rs
let x = 5;
```

Something you need to know is that when you create a variable it has to be defined, otherwise you will get an error from the Compile.

OH YES!!! Another important thing is that every variable you create is `inmutable`. What does it mean? That you cannot change the value of the variable. To make a variable `mutable` you have to use the keyword `mut` before the name of the variable.

```rs
let mut y = 0;
y = 2;
```

Something you can do is telling a variable what type it is. (You have to do this in the second variable file)

So if you go to the docs -> https://doc.rust-lang.org/book/ch03-02-data-types.html

Go and read :)

```rs
let x: i8 = 1;
```

That is an example :D

Now an interesting "tool" is that you can change the type of a variable, is what they call "shadowed".

I think you will understand if I give you an example ->

```rs
let random = "OH YEAH I AM A STRING";
let random = 5;
```

Yeah is... strange??? I mean, you change the type of the variable just using the `let` keyword and the same name of the variable. And is super weird (for me at least) but I think is useful, but IDK, we'll see.

Also it is called _shadowed_ because is like the first initialization of the variable gets "shadowed" by the last one.

The *constants* in Rust... you have to specify the type, otherwise it won't work.

```rs
const PI: i8 = 3.14;
```

And the best for the end... Why the f* I have to use `mut` if I have constants???

Well... let me read the docs...

![Reading](https://media.giphy.com/media/8dYmJ6Buo3lYY/giphy.gif)

- You cannot use `mut` with `const` I think is something obvious.
- `const` needs to have a type, `let` no
- `const` can be used in any scope, including `global`
- `let` can get the result of a function or something like that, but `const` can't, it has to be a value.

Something like this, I think it convinced me, I mean, having variables that are immutable is "top" you can do a lot of things with it, some times we have variables that never change their value, and this is like a "plus" for rust, I cannot think about any example now, sry.

So this is all for today, I wish you a nice sleep or end of reading, or whatever you want.

Bye.

![Sleeping](https://media.giphy.com/media/xT8qBvH1pAhtfSx52U/giphy.gif)

---

## Follow me!
(I liked more the red bird :_()
🐦 [Twitter](https://twitter.com/blit12_)
🐙 [GitHub](https://github.com/blitty-codes)
👥 [LinkdIn](https://www.linkedin.com/in/blitty/)

---
Big O Basics  
Tags: computerscience, algorithms, codenewbie
Published: 2021-09-26 23:04:51

The code we choose to use can impact the speed and the performance of our program. How would we know which algorithm is most efficient? Big O Notation is used in Computer Science and measures how quickly the runtime of an algorithm based on the number of input in a function. 

Big O looks at the worst case scenario or the max number of steps to take in a problem. On the other hand, Big Omega looks at the best case scenario or the least number of steps to take in a problem. 

### Common Runtimes from least to greatest effectiveness: 

- **O(n^2)**: Quadratic time - as (n) grows, runtime squares. 
- **O(n)**: Linear - as (n) scales, runtime scales. 
- **O(log n)**: Logarithmic time - halves dataset until it finds (n). 
- **O(1)**: Constant - as (n) grows, there is no impact. 

### Big O Complexity chart 

![Big ) Chart](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h4c3l6pys5u3v1a6s9g8.png)

This chart shows the runtime with green shaded area being the most effective to the red shaded areas being the least effective.
CTA Button Progress
Tags: webdev, css, button
Published: 2021-09-26 23:02:51

Currently, my partner Adam and I have have been working on creating a CTA button that when clicked, will take you to a link. Along the development cycle there has been some good and some bad.

## Good
The button at its core is functional, is the shape we want it, has an imported icon from a library, and has a hover state for it. The code for these functionalities is cleaned up and is properly developed.

## Bad
We have been struggling a bit to correctly add some other required functionalities to the button, but are working on getting them completed. One in particular that we are working harder on is progressive enhancements.

##Git repo
https://github.com/runtimeErrorsMadeEasy/ctaButton_2.git
🖐 5 Things Every Developer Must Know about Software Architecture
Tags: webdev, javascript, tutorial, python
Published: 2021-09-26 23:02:03

## 1. Software Architecture Isn’t About Big Design Upfront ☝️
Big designs upfront are usually done in waterfall models of software development.
- The waterfall model is predicted to be bad by its own inventor :)

The upfront design should be a basic, good one done with an iterative and incremental process.

### When Do We Stop The Architecture Planning? ⛔️ 
When we have a solid understanding of the following aspects:
- The significant architectural drivers
	- Cost, Response Time, etc...
- Requirements.
- Constraints.
- The context and scope of the product.
- The significant design choices.
- Technology used.
- Is our application a Monolith or is a set of Microservices?
- The risks associated with the product.

---

## 2. Every Software Team/Product Needs To Consider Architecture And Needs To Have A Technical Leader ✌️
This is crucial to have consistent patterns in the product.

---

## 3. What's The Software Architect Role About 👨‍🔧

- Coding.
- Keeping an eye on what’s going on with the code base.
- Coaching.
- Collaboration with others to incrementally draw the architecture of the application.

It’s a continuous role that spans the life of the project.

---

## 4. An Architect Doesn’t Need To Use UML 📐

There are several other tools that  enable us to create architecture diagrams using GUIs or even using code.
- [C4-PlantUML](https://github.com/plantuml-stdlib/C4-PlantUML) (code based)
- [Diagrams.net](https://www.diagrams.net/) (GUI based)
- [Structurizr](https://structurizr.com/) (both code and GUI based)

---

## 5. A Good Software Architecture Enables Agility ❤️

---

## Credits 🙌
This post has been prepared using the lecture of Simon Brown Five [Things Every Developer Should Know about Software Architecture](https://www.youtube.com/watch?v=9Az0q2XHtH8&t=543s)
Combining CSS & HTML in the same file...
Published: 2021-09-26 22:40:56

CSS can be used by itself or with HTML. This post is going to go over how to use the two to make beautiful web pages.

Typically CSS is written in its own file but I'm going to show you how to use it in the HTML file.  CSS is defined in the <head> section of an HTML page, within a `<style>` element.
For example:

`<head>`
`<title>Our Summer Vacation</title>`
`<style type="text/css">`
`body {
font-family: Tahoma;
background-color: blue;
}`
`h1 {
color: black;
}`
`</style>`
`</head>`
`<body>`
`<h1>Daytona Beach, Florida</h1>`
`<p>We haven't been to Daytona in such a long time. Its beautiful here. Daytona reminds me of being a teenager.  That was the first time I went on a vacation.</p>`
`</body>`

This way you can have both your CSS and HTML together in a simple file! There is A LOT more styling out there for you to use. CSS also uses borders. When using borders you can define the height and width for the border itself. More on that in future posts!

Happy Coding!