teleren/devto huggingface dataset:
An emulator of enigma machine
Tags: showdev, go
Published: 2021-04-18 18:39:26

Hi, it's Mirko here.

During the last weeks I've worked on another funny project to improve my go knowledge.


## What is it ?

[Enigma](https://github.com/mirkoperillo/enigma) is a emulator of the [enigma](https://en.wikipedia.org/wiki/Enigma_machine) M3 machine, become famous during the II world war and used by nazist army to crypt
their communications.

The project is published on Github and it is released under the Creative Commons Zero license.

Every feedback about the code or project features is very welcome 🙏🏻
New Video: Structural Typing in TypeScript
Tags: video, typescript, webdev
Published: 2021-09-19 20:07:16

---
title: New Video: Structural Typing in TypeScript
published: true
date: 2021-04-18 17:18:48 UTC
tags: Video,TypeScript,WebDevelopment
canonical_url: http://wildermuth.com/2021/04/18/New-Video-Structural-Typing-in-TypeScript
---

I've got a new video that I released a couple of weeks ago. I wanted to share this out. It's about how structural typing works in TypeScript. Typing in TypeScript is a different animal than C# (or most typed languages) so I want to introduce it in one of my "Coding Shorts". I hope you like it:

https://www.youtube.com/zfQgsGXTpOg

Let me know what you think, and of course, subscribe to the channel if you want to get notifications of new videos! I'm doing about 1/week right now.

[![Creative Commons License](http://i.creativecommons.org/l/by-nc-nd/3.0/88x31.png)](http://creativecommons.org/licenses/by-nc-nd/3.0/)

 This work by [Shawn Wildermuth](http://wildermuth.com) is licensed under a [Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License](http://creativecommons.org/licenses/by-nc-nd/3.0/).  
 Based on a work at [wildermuth.com](http://wildermuth.com).

* * *

If you liked this article, see Shawn's courses on [Pluralsight](http://shawnw.me/pscourses).
 ![](http://feeds.feedburner.com/~r/ShawnWildermuth/~4/dvIrVco-Y78)
Choosing colors for websites
Tags: css, code, colors, design
Published: 2021-04-18 18:31:29

I usually visit these 3 websites when i have to choose the colors i need to use when building a website.

Colormind
http://colormind.io/bootstrap/
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e7cu6ytv5umlflxezkjo.png)

Colorsinspo
https://colorsinspo.com/
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wt9jel9jjhj8lmebh6m1.png)

Coolors
https://coolors.co/
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n1k1c990p7eeo0whemfk.png)

In case you have more useful websites for colors to propose, I am open to suggestions. It's always good to learn new things!
Cost of Exit is a Cost of Entry.
Tags: agile, scrum, project
Published: 2021-06-03 15:50:37

---
title: Cost of Exit is a Cost of Entry.
published: true
date: 2021-04-18 18:25:06 UTC
tags: agile, scrum, project
canonical_url: https://theagilecouch.com/2021/04/18/important-but-rarely-considered/
---

FBI SWAT teams are one of the most highly trained infiltration / exfiltration units in the world. Highly skilled, highly trained. Practice frequently. They are armed with the best gear in the world, bristling with guns, ammo, handcuffs, flash-bang grenades. In their center pocket, easiest and fastest to reach, is their most important tool.

A rubber doorstop. It’s worth thinking about.

I heard this listening to Penn Jillette relate his experience talking to the leader of an FBI SWAT team. He asked why the rubber doorstop was so important that it deserved front and center pocket placement.

“We go into a lot of rooms with risk and uncertainty. We want to make sure we can get back out.”

**Question** : What are the implications of this principle in software development?
Manage your coding projects for free!
Published: 2021-04-18 18:22:48

Have you ever wanted to manage your project for free?

Check this out - the signup page is on the home page ;) 
https://devlist.rf.gd


## Features
* Todo list
* Bug tracker
* Changelog
* Releases
* Project settings
* Lo-fi music!
* Dark theme
* Multiple projects
* Feedback
* Avatars!
* Dashboard
* Delete account, projects, etc.



Preview: 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mbj4o6brdp1cu8funbcx.png)

Create an account - it's free!
My First Open Source Contribution
Tags: hashnodebootcamp, opensource, facebook
Published: 2023-04-23 11:23:05

---
title: My First Open Source Contribution
published: true
date: 2021-04-18 18:13:29 UTC
tags: hashnodebootcamp,OpenSource,Facebook
canonical_url: https://chrisdevcode.hashnode.dev/my-first-open-source-contribution
---

> For the self-taught developer and (or) pretty much all developers, we use open source projects in our daily code, with or without knowing.

For real though, **Open Source (OS)** projects have made our work easier and surprisingly fun.

## TL;DR

# My First Open Source Contribution

It is always hard to find what open source projects you'd love to contribute to, especially when you are a beginner, well that's why we mostly end up fixing the typos and eventually, making impressive contributions with time.

It's about time I shared my first experience. (A very short story).

I had been a member of the Facebook Developer Circles Nairobi for some time when the **[Open Source Immersion](https://developers.facebook.com/developercircles/open-source-immersion)** was announced.

[https://www.facebook.com/groups/DevCNairobi/permalink/3374954279235348/](https://www.facebook.com/groups/DevCNairobi/permalink/3374954279235348/)

I googled on how to make contributions to the open-source, for the community. This was a simple case, what was needed was for community members to contribute to the [Facebook Developers Circle Content repository](https://github.com/fbdevelopercircles/FbDevcCommunityContent) . It was a cool one.

A summary of what I did:

- 

[Added a dev podcast link to the podcast list](https://github.com/fbdevelopercircles/FbDevcCommunityContent/commit/d0ba39522a1438619ac3dd19e7d6da4da162a666)

- 

[Fix Merge conflicts](https://github.com/fbdevelopercircles/FbDevcCommunityContent/commit/1549ebfb32530616d5a122f65cac4eca40ec5654) (LOL)

- 

[Added blogs to the blogs list](https://github.com/fbdevelopercircles/FbDevcCommunityContent/commit/ad15a80f3b6ba6819c6542ccd55683584bf7f5ae)

## Lessons learned:

The main thing I gained was how to contribute to an already existing project using git and GitHub. Fixing a merge conflict was the best one.
3-2-1 Newsletter: 2 must-have tools for content creation
Tags: javascript, node, programming, tutorial
Published: 2021-04-18 18:11:56

### Hi There!👋🏾

🙏🏾 Welcome to my blog newsletter where every week, I share a 3-2-1 **curated list** consisting of my content and also what resonated with me over the last week.

👉🏾 In this week's post, we have **3 tweets**, **2 awesome tools** for content creation, and **1 video editor** that will help you better understand asynchronous JavaScript!

### 3️⃣ tweets

1] A single page **#sketchnote** created to help understand the concept of **IIFE** in JavaScript.

{% twitter 1383839829281021955 %}

2] A single-line code solution to find the **smallest element** in a JavaScript array.

{% twitter 1383112466989686787 %}

3] The array **utility method** to `fill` an entire array with a value. Helps in pre-filling with default value.

{% twitter 1382345063645155333 %}

### 2️⃣ tools for content creation
These are the 2 tools that I find myself using regularly.

1] The first one is [carbon](https://carbon.now.sh/)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qba4evqdt79t860gpe64.png)
This tool helps you generate **beautiful code snippets** and download a rendered image. It also allows for various levels of customization like *borders, shadows, fonts*, etc. 

2] The second one is [excalidraw](https://excalidraw.com/)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2s7h955a6e02ptm3scwq.png)
This tool lets us create **flow charts** or rather any sort of drawings with a **hand-drawn** feel to them. If you are into creating complex charts and want to make them different, give this tool a try.

### 1️⃣ video 
If you want to truly understand **asynchronous JavaScript**, I highly recommend this video that I came across recently. It's from the **Google Chrome Developers** YouTube channel where two Google devs discuss the different caveats associated with async JavaScript:

{% youtube 8eHInw9_U8k %}

If you liked that curated list, make sure you **follow me** on [Twitter](https://twitter.com/Kokaneka) so that you get the resources in your feed the day I post it, instead of later down the week as a part of this newsletter.

[![My twitter profile](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3p4a72xpzv710bg6hfax.png)](https://twitter.com/Kokaneka)

Hope that helped! As always, keep rocking.
Cheers 👐🏽 :)
Material-ui
Published: 2021-04-18 18:09:49

While doing a coding challenge I discovered a framework that you can use to help with the layout of your React application. I needed to find a resource that would assist with a responsive layout and Material-ui is the frame work for that.

Material-ui is a library of components that are already built. You can choose the particular component that you need for your project. For example, if you need a component for a button, Material-ui has a section for button components. All you have to do is select the particular button that you want, copy the code and add it to the component in your application. If you have not heard of Material-ui I suggest that you check it out.

Happy coding!
Global/Local Scope and Functions.
Tags: beginners, tutorial, javascript
Published: 2021-04-18 15:25:31

#### Global Scope and Functions
Variables that are defined outside of a function block have Global scope. This means, they can be seen everywhere in your JavaScript code.

Variables that are used without the var keyword are created in the global scope. This can create consequences somewhere in your code or when running a function again. You should always declare your variables with var.
* Example:
```
var myGlobal = 10; // this is a Global Scope

function some1() {
otherGlobal = 5; // this is also a Global Scope since it's not defined within the function.
}

function some2() {
  var output = "";
  if (typeof myGlobal != "undefined") {
    output += "myGlobal: " + myGlobal;
  }
  if (typeof otherGlobal != "undefined") {
    output += " otherGlobal: " + otherGlobal;
  }
  console.log(output);
}
// don't worry about the rest of the code for now, you'll learn it as you go and I'll be here to see it through.
```
So here we are using var declaring a global variable named myGlobal outside of any function. we initialized it with a value of 10.

Inside function some1, we assigned 5 to otherGlobal without using the var keyword.


#### Local Scope and Functions
Variables which are declared within a function, as well as the function parameters, have local scope. That means they are only visible within that function.

* Here is a function myTutorial with a local variable called myVar.
```
function myTutorial() {
  var myVar = "food";
  console.log(myVar);
}
myTutorial(); // will display food
console.log(myVar); // will display ReferenceError: myVar is not defined
```
The myTutorial() function call will display the string food in the console. The console.log(myVar) line will throw an error, as myVar is not defined outside of the function.


#### Global vs. Local Scope in Functions
It is possible to have both local and global variables with the same name. When you do this, the local variable takes precedence over the global variable.

* For example:
```
var consoleSystem = "Xbox";

function mySystem() {
  var consoleSystem = "PS5";
  return consoleSystem;
}

mySystem(); // will display PS5
console.log(consoleSystem); // will display Xbox because it is a variable that is defined outside of a function block (Global Scope)
```
The function mySystem will return the string PS5 because the local version of the variable is present.
Why being a Codeslinger makes you worse than you think
Tags: codenewbie, codequality, experience, learnings
Published: 2021-04-18 17:50:04

We all know that getting good at one thing is difficult. Today I want to share something with you, something that has improved my thinking and made me a better programmer.

First to first, the title said something about a Codeslinger? What that is? Simple... the definition of a Codeslinger is someone who is literally like shooting(coding) from the hip.

![clint_hipfire](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8ptu704ywoy6vahigzmc.gif) 
  
Because they are two kind of people out there in our business.
The one who really wants to know why, with something like:
*"WTF? why is this working?"*,
and the one who is like:
*"Oh.. ok it works, fine."*

We all came to points where we're over asked, where we are ready to complain and give up to understand something because otherwise it would break us out of our comfort zone.

You know, it's quite easy to shoot a Revolver from the hip and fire out all 6 shoots and maybe you hit the target. Maybe you completed the task like that and pat yourself on the shoulder. **But** doing this for the most of your time makes you a **Codeslinger**.

A Codeslinger will always just **try** to accomplish a challenge, most of the time he will only have luck and succeed or fail hard.

I'm telling you it's okay to **try**, but it's not okay to do it over and over again. You have to decide for yourself if I am the one who is afraid of learning new things and cheating my way through my career or if I am the one who takes the challenge of getting better and better until you get the salary, that you deserve, or the job position that fits to your skill level.

What i mean is, when you Code something, no matter what it is, if it is a simple Todo-App or a big scale Company software, it's highly important that you should keep in mind, you don't know everything from the hip.

If your not sure about how to use this Tool you are using. Not confident about a line of Code you just copy pasted from Stack Overflow or somewhere else, then i can tell you one simple trick that will maybe change the way how you approach the stuff day by day.

**Force yourself to understand, till you understand...
Become a Sniper, one bullet one target, one hit.**

![sniper](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e75ppvr66i64tg6rh85l.gif)
 
This will make you better, will make you less in a "*i can try it*" and more in a "*i can do it*"

There is one simple rule you should never forget:
*"if you could write it yourself, you are allowed to use it"*
Running my first Gitlab CI/CD pipeline
Tags: gitlab, mkdocs, docker, devops
Published: 2021-04-18 17:28:26

I was testing some Gitlab functionalities on my last jobs, but I've never played it by myself so, I decided to migrate my personal wiki/toolbox into Gitlab pages and see how it goes.

Why Gitlab? Because I am feeling more comfortable with it. Github is a very nice SCM but I wanted to start working with Gitlab and I though that this could be a very nice opportunity to do so.

So, I migrated my repository from Github to Gitlab, just pushing all the files to an empty Gitlab repository project. That's all.

Also I created a ".gitlab-ci.yaml" file with a few steps to control the deployment:

```yaml
image: python:3.8-buster

before_script:
  - pip install -r requirements.txt

test:
  stage: test
  script:
  - mkdocs build --strict --verbose --site-dir test
  artifacts:
    paths:
    - test
  except:
  - master

pages:
  stage: deploy
  script:
  - mkdocs build --strict --verbose --site-dir public
  artifacts:
    paths:
    - public
  only:
  - master
```
Leaving this file in the repository root path, now the project looks like this:
```
CMD> tree -a -L 1                       
.
├── docs
├── .git
├── .gitignore
├── .gitlab-ci.yml
├── mkdocs.yml
├── README.md
└── requirements.txt

2 directories, 5 files
```
When I just committed my changes into the repository, everything starts to run and the CI finally just deployed my project into Gitlab Pages. Here is the result: [Cosckoya Gitlab pages](https://cosckoya.gitlab.io).

Amazing.

I really want to test some more Gitlab CI/CD (Terraform, Docker, Helm) and integrations (Hangouts, Slack) with this new toy of mine.

Enjoy!
How to start Spring Apache Kafka Application with SpringBoot Auto-Configuration
Tags: springboot, apachekafka
Published: 2021-04-18 17:28:14

https://grokonez.com/java-integration/distributed-system/start-spring-apache-kafka-application-springboot

How to start Spring Apache Kafka Application with SpringBoot Auto-Configuration

The <strong>Spring Apache Kafka</strong> (spring-kafka) provides a high-level abstraction for Kafka-based messaging solutions. And <strong>Spring Boot 1.5</strong> includes auto-configuration support for <strong>Apache Kafka</strong> via the <strong>spring-kafka</strong> project. So in the tutorial, <strong>JavaSampleApproach</strong> will show you how to start <strong>Spring Apache Kafka Application</strong> with <strong>SpringBoot</strong>.

Related Articles:
- <a href="https://grokonez.com/java-integration/start-apache-kafka">How to start Apache Kafka</a>
- <a href="https://grokonez.com/spring-framework/spring-boot/how-to-start-spring-kafka-application-with-spring-boot">How to start Spring Kafka Application with Spring Boot</a>
- <a href="https://grokonez.com/spring-framework/spring-boot/spring-jms-explicitly-configure-spring-activemq-connectionfactory-springboot">Spring JMS – Explicitly Configure Spring ActiveMQ ConnectionFactory | SpringBoot</a>

<!--more-->
<h2>I. Technologies</h2>
– Java 8
– Maven build
– Spring Boot
– Apache Kafka
– Spring Tool Suite editor
<h2>II. Overview</h2>
As above mention, <strong>SpringBoot</strong> supports auto-configuration for <strong>Apache Kafka</strong> development:
- Use <strong>spring.kafka.*</strong> in <strong>application.properties</strong> file to modify external configuration.

<pre><code class="language-java">
spring.kafka.bootstrap-servers=localhost:9092
spring.kafka.consumer.group-id=jsa-group
</code></pre>

<img src="https://grokonez.com/wp-content/uploads/2017/06/SpringBoot-Kafka-Application.png" alt="Spring Apache Kafka Application" width="359" height="397" class="alignnone size-full wp-image-5907" />

- Use Spring auto-configured <strong>KafkaTemplate</strong> to send Kafka-based messages:

More at:

https://grokonez.com/java-integration/distributed-system/start-spring-apache-kafka-application-springboot

How to start Spring Apache Kafka Application with SpringBoot Auto-Configuration
Github Repositories
Tags: github, javascript
Published: 2021-04-18 17:22:53

Showcase your Github repositories in your static website, including updated stars, forks count! Check the repository here:

https://github.com/PeterHdd/ghrepos

website: https://peterhdd.github.io/ghrepos/

just include the iframe provided in the website, add your Github username, stars condition and you can have a section dedicated to your Github projects in your static website.
Comparisons with the Logical and Operator 
Tags: javascript, devops, tutorial, beginners
Published: 2021-04-18 17:19:00

#### Comparisons with the Logical And Operator
Sometimes you will need to test more than one thing at a time. The logical and operator (&&) returns true if and only if the operands to the left and right of it are true.

The same effect could be achieved by nesting an if statement inside another if:
* Example:
```
function test(num) {
 if (num >= 25) {
  if (num <= 55) {
    return "Yes";
  }
}
return "No";
}
```
This will only return Yes if num is greater than or equal to 25 and less than or equal to 55. The same logic can be written as:
```
function test(num) {
 if (num >= 25 && num <= 55) {
  return "Yes"; 
}
return "No";
}

test(10); // will display No if console.log 
```
Here we replaced the two if statements with one statement, using the && operator, which will return the string Yes if val is less than or equal to 50 and greater than or equal to 25. Otherwise, will return the string No.


#### Comparisons with the Logical Or Operator
The logical or operator (||) returns true if either of them is true. Otherwise, it returns false.

The logical or operator is composed of two pipe symbols: (||). This can  be found between your Backspace and Enter keys.
* Example:
```
function test(num) {
  // Only change code below this line
  if (num < 10 || num > 20) {
    return "Outside";
  }
  return "Inside";
}

test(15); // will display Inside
```
Here we Combined the two if statements into one statement which returns the string Outside if val is not between 10 and 20, inclusive. Otherwise, return the string Inside.
Kotlin – Spring Security – Customize Authentication Success Handler
Tags: kotlin, springsecurity, springboot
Published: 2021-04-18 17:13:09

https://grokonez.com/spring-framework/spring-boot/kotlin-spring-boot/kotlin-spring-security-customize-authentication-success-handler

Kotlin – Spring Security – Customize Authentication Success Handler


In the tutorial, we will show you how to customize Authentication Success Handler with Kotlin Spring Security web application.

<!--more-->
<h2>I. Technologies</h2>
– Kotlin 1.2.20
– Apache Maven 3.5.2
– Spring Tool Suite – Version 3.9.0.RELEASE
– Spring Boot – 1.5.10.RELEASE
– Bootstrap
<h2>II. Goal</h2>
We create a Kotlin SpringBoot MVC Web Application as below:

<img src="https://grokonez.com/wp-content/uploads/2018/02/kotlin-spring-security-customize-login-successfully-project-structure-project-structure.png" alt="kotlin spring security - customize login successfully - project structure - project structure" width="338" height="328" class="alignnone size-full wp-image-10747" />

We have a login page:

<img src="https://grokonez.com/wp-content/uploads/2018/02/kotlin-spring-security-customize-login-successfully-project-structure-login-form.png" alt="kotlin spring security - customize login successfully - project structure - login form" width="622" height="383" class="alignnone size-full wp-image-10748" />

When login successfully with admin/admin account, it will redirect to <code>/admin</code>:

<img src="https://grokonez.com/wp-content/uploads/2018/02/kotlin-spring-security-customize-login-successfully-project-structure-admin.png" alt="kotlin spring security - customize login successfully - project structure - admin" width="424" height="161" class="alignnone size-full wp-image-10749" />

When login successfully with user/user account, it will redirect to <code>/user</code>:

<img src="https://grokonez.com/wp-content/uploads/2018/02/kotlin-spring-security-customize-login-successfully-project-structure-user.png" alt="kotlin spring security - customize login successfully - project structure - user" width="409" height="167" class="alignnone size-full wp-image-10750" />

How to achieve it?
-> We will customize AuthenticationSuccessHandler.

More at:

https://grokonez.com/spring-framework/spring-boot/kotlin-spring-boot/kotlin-spring-security-customize-authentication-success-handler

Kotlin – Spring Security – Customize Authentication Success Handler
Listing the contents of a remote ZIP archive with Ruby
Tags: ruby, curl, zip, http
Published: 2021-04-18 16:54:52

---
title: Listing the contents of a remote ZIP archive with Ruby
published: true
tags: ruby, curl, zip, http
---

Below is a small Ruby utility function, which takes a url of a ZIP archive and returns the file names of its content.

It will only download *just* enough data to list the archive content and no more.

{% gist https://gist.github.com/rhardih/278a3cc6f5534785068819159f2c2919 file=zip_file_names_v2.rb %}

The code comments should reveal what the individual steps does, but in case you like a more in-depth look at things, I wrote a blog post here, with accompanying **curl** commands:

https://rhardih.io/2021/04/listing-the-contents-of-a-remote-zip-archive-without-downloading-the-entire-file.