teleren/devto huggingface dataset:
How to Create SSH keys with Terraform?
Tags: github, terraform, devops, technology
Published: 2022-07-17 14:07:50

---
title: How to Create SSH keys with Terraform?
published: true
date: 2022-05-17 08:07:20 UTC
tags: github,terraform,devops,technology
canonical_url: https://faun.pub/how-to-create-ssh-keys-with-terraform-a615dfc631c1
---

[![](https://cdn-images-1.medium.com/max/902/0*Awoi_2ICuXm2yOY1.png)](https://faun.pub/how-to-create-ssh-keys-with-terraform-a615dfc631c1?source=rss-6e21f0d290d1------2)

Terraform allows you to set up servers in the cloud without much hassle. To access those servers with your CI/CD tools, however, requires…

[Continue reading on FAUN Publication »](https://faun.pub/how-to-create-ssh-keys-with-terraform-a615dfc631c1?source=rss-6e21f0d290d1------2)
How to add autolink plugin to TinyMCE in WordPress
Tags: php, wordpress
Published: 2022-06-10 10:10:30

---
title: How to add autolink plugin to TinyMCE in WordPress
published: true
date: 2022-05-17 08:04:11 UTC
tags: PHP,Wordpress
canonical_url: https://daniele.tech/2022/05/how-to-add-autolink-plugin-to-tinymce-in-wordpress/
---

An easy way to add a plugin for TinyMce in WordPress

The post [How to add autolink plugin to TinyMCE in WordPress](https://daniele.tech/2022/05/how-to-add-autolink-plugin-to-tinymce-in-wordpress/) appeared first on [Daniele Mte90 Scasciafratte](https://daniele.tech/eng).
Today's Daily Dose of Programming Humor
Tags: jokes, dailydeveloperjokes
Published: 2022-05-17 08:00:29

---
title: "Today's Daily Dose of Programming Humor"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
published: true
tags: #jokes, #dailydeveloperjokes
---

Hi there! Here's today's Daily Developer Joke. We hope you enjoy it; it's a good one.

![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e12598ab1885.png)

---

For more jokes, and to submit your own joke to get featured, check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/). We're also open sourced, so feel free to view [our GitHub Profile](https://github.com/dailydeveloperjokes).

### Leave this post a ❤️ if you liked today's joke, and stay tuned for tomorrow's joke too!

_This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit._

<!--
Joke text:
___Q:___ How do you stop a web developer stealing your stuff?

___A:___ Write 403 on it.
 -->
Can php file bundle by webpack like html
Tags: webpack, html, javascript, php
Published: 2022-05-17 07:53:30

WebPack can bundle HTML files and output from the src directory to the dist directory.

`./src/index.html to ./dist/index.html` We know this is a static HTML file, but when I use it in my PHP project, it will need to change the index.html to index.php file. Also, I need to change or customize all of the static content to PHP logic or dynamic content.

My question is if I need to add a new section or edit something in my main HTML file then I will need to change on `./src/index.html` file from the src folder, then WebPack will do bundle again and make an `./dis/index.html` file to the dist directory. Then again need to change the same process for the PHP files and change in PHP file for dynamic content.

Should I use the PHP file in the src directory and use here PHP functions, logic or something else or dynamic content? Then bundle finally for distribution or final file to dist directory as `./src/index.php file ./dist/index.php`

**Have any way for use PHP finalize for render/bundle to for distribution?**
The Only News Bot for your all Daily News
Tags: python, devnewsbot, programming, news
Published: 2022-05-17 07:47:17


It's preferable to read the news as a tech fan to keep up with what's new in the world of technology.

Also difficult to keep up with websites and news; visiting each page only to see what's new takes time. It's also difficult to keep track of tech news websites.

**Isn't it more convenient to have all of those news websites and articles in one place?** 

As a result of this, I developed a **[DevBudBot](https://t.me/DevBudbot)**.

Check out live Bot here [DevBudBot](https://t.me/DevBudbot) 

## So, what exactly is this and what does it do?

[DevBudBot](https://t.me/DevBudbot) is a Telegram bot that collects data from a variety of websites and provides article titles with embedded urls.

All of the website urls are in the command, and all you have to do is click on your preferred site name in the command to obtain the news.

### Supported websites till now :

- [The Verge](https://www.theverge.com/)
- [Dev.to](https://dev.to/)
- [Product hunt](https://www.producthunt.com/)
- [The next web](https://thenextweb.com/)
- [Sidebar](https://sidebar.io/)
- [Echojs](https://www.echojs.com/)
- [Tech Crunch](https://techcrunch.com/)
- [Hacker News](https://news.ycombinator.com/)
- [Tldr](https://tldr.tech/)
- [Medium](https://medium.com/)
- [Css-tricks](https://css-tricks.com/)
- [Wired](https://www.wired.com/)

**You can find the project on [GitHub](https://github.com/amrohan/Dev-News-Bot)**
How to Remove Sensitive Data You Accidentally Uploaded To Github
Tags: git, beginners, programming, codenewbie
Published: 2022-05-17 07:38:02

You should upload all your project files to GitHub or Bitbucket. 

Some secrets need to stay secret. 

A good example is environment files, where we store our DB credentials and API keys. 

You can use the gitignore file to disallow them from entering the cloud. But if you've accidentally shared them already, adding them on gitignore later won't help. 

Your secret may be on all the branches and commits history. Your secrets are on the internet!

Here's how to remove them permanently and stay safe. 

[How to Remove Sensitive Data You Accidentally Uploaded To Github](https://www.the-analytics.club/delete-file-from-git-history)
Where Should you use async and defer ? Good SEO-practices
Tags: javascript, react, seo, html
Published: 2022-05-17 07:30:21


**[share your Knowledge as well](https://github.com/premshetty/Good-SEO-practise)**

## Lets see the difference between async and defer first


## normal Script Execution

![image](https://user-images.githubusercontent.com/40886278/168419722-5699e1b2-ffab-4212-bc99-2e98a1f27b7a.png)

Keep only important Scripts here , that should execute while the page loading itself

## with Async 

![image](https://user-images.githubusercontent.com/40886278/168419751-439390b8-44f6-46cd-a9d0-78ad30c68d86.png)

If you want a script that should be executed immediately after fetching you may use async that also  helps increases the performance of your website 
## with Defer

![image](https://user-images.githubusercontent.com/40886278/168419779-1e8f774a-2ecf-4fec-831a-4ea1a51505e8.png)

and Finally defer if you want some script to execute after all the contents are loaded and executed , or any less important scripts can be executed with defer


## Now you know the difference , lets also see how to use it
### using Defer
```
<script defer src="sitewide.js"></script>
<script defer src="jquery.min.js"></script>
<script defer src="page-specific.js"></script>
```

### using Async 

```
<script async src="sitewide.js"></script>
<script async src="jquery.min.js"></script>
<script async src="page-specific.js"></script>
```
Next i will post how to reduce the unwanted Css Load stay tuned !!

you can also edit this files : [github](https://github.com/premshetty/Good-SEO-practise)

## addition tips
### Don't leave Anchor Tage Empty
`<a> something </a>`
This will be a bad practise instead use p tag or use `href` inside `<a>` tag
Python vs Golang vs Rust
Tags: python, go, rust, programming
Published: 2022-05-17 07:23:42

## Test scenario

I have taken the [Two sum problem](https://leetcode.com/problems/two-sum/) from Leetcode.

The problem statement:

> Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.
> 
> You may assume that each input would have exactly one solution, and you may not use the same element twice.
> 
> You can return the answer in any order. 

> Example 1:
> 
> Input: nums = [2,7,11,15], target = 9
> Output: [0,1]
> Explanation: Because nums[0] + nums[1] == 9, we return [0, 1].
> 
> Example 2:
> 
> Input: nums = [3,2,4], target = 6
> Output: [1,2]
> 
> Example 3:
> 
> Input: nums = [3,3], target = 6
> Output: [0,1]
> 
>  
> 
> Constraints:
> 
>     2 <= nums.length <= 104
>     -109 <= nums[i] <= 109
>     -109 <= target <= 109
>     Only one valid answer exists.
>

## Implementation

I have used a hash map to solve this problem across all three languages.


### Python

```python
class Solution:
    def twoSum(self, nums: List[int], target: int) -> List[int]:
        hash_table = {}
        for i, num in enumerate(nums):
            target_num = target - num
            if num in hash_table:
                return i, hash_table[num]
            else:
                hash_table[target_num] = i
        return None
```

#### Python stats

- Run time: **40ms**
- Memory usage: **14.5 MB**


### Golang

```Go
func twoSum(nums []int, target int) []int {
    hashMap := make(map[int] int)
    for i := 0; i < len(nums); i++{
        if _, found := hashMap[nums[i]]; found {
            ans := []int{i, hashMap[nums[i]]}
            return ans
        } else {
            hashMap[target- nums[i]]= i
        }
    }
    return nil
}
```

#### Golang stats

- Run time: **4ms**
- Memory usage: **4.3 MB**


### Rust

```rust
use std::collections::HashMap;
impl Solution {
    pub fn two_sum(nums: Vec<i32>, target: i32) -> Vec<i32> {
        let mut hash_table: HashMap<i32, i32> = HashMap::new();
    for i in 0..nums.len() {
        // println!("Processing number: {}", nums[i]);
        match hash_table.get(&nums[i]){
            Some(&x) => return vec![x, i as i32],
            None => hash_table.insert(target - nums[i], i as i32),
        };
    };
    return vec![-1, -1]
    }
}
```

#### Rust stats

- Run time: **2ms**
- Memory usage: **2.2 MB**

## Conclusion

- As per the results, Rust took the least memory and was the fastest of all three.

For more such insights follow me on [Twitter](https://twitter.com/soumendrak_).
Original post: [Hashnode](https://blog.soumendrak.com/python-vs-golang-vs-rust)
Kickstart Your MVP Development With These Ruby on Rails Gems
Tags: rails, development, programming
Published: 2022-05-17 06:55:44

Building and owning a Digital Product is pretty these days, and when you want to build a digital product, what could be a better option than an MVP- a Minimum Viable Product!

One of the biggest advantages that put MVP ahead of everyone in the competition is reaching the audience fast without any excess expense of your resources.

However, to publish a full-fledged product in the market, you would need an extensive backend to build a strong structure first.

Ruby on Rails Development is the one you can not ignore when it comes to a project-oriented robust backend technology!

It becomes essential to opt for the right technology or the Ruby on Rails Development Company for the MVP Development.

For every startup, the beginning period is crucial in terms of cost-effectiveness to build any product or enter the market.

Now anyone would think, why pick only Ruby on Rails for MVP?

Multiple reasons can back up my argument here that Ruby on Rails is the ideal choice for MVP backend technology.

- First of all, the prototyping process could be rapid.
- Modern open-source language can be a boon for your initial startup stage as it can cut your costs in the most exceptional ways.
- Handles your MVPs Security aspects
- Exceptional flexibility
- Automated Testing facility

Furthermore, one of the best Ruby on Rails Gems exists to improve your MVP development process at the utmost level. 

Let’s find out which Gems can be proven useful to your MVP!

## Best Ruby on Rails Gems and tools for your MVP Development

<b>For Authentication Process</b>

1. Oath
2. Rack-case
3. devise
4. omniauth

<b>For automated Testing</b>

1. RSpec
2. Database_cleaner
3. factory_bot

<b>For coding style</b>

1. Rails_best_practices
2. RuboCop
3. lefthook

<b>For Debugging process</b>
1. Letter Opener
2. Pry-byebug

<b>APIs</b>
1. Dox
2. JSON API-serializer

<b>To ensure data security</b>
1. Brakeman 
2. Bundler-audit
3. Rack-attack
4. Secure Headers

So we have covered some of the areas of web development, but you could get detailed information about how <i>Ruby on Rails services</i> can be helpful for your MVP product here.

Undoubtedly, Ruby on Rails Gems can work exceptionally with your project but getting the assistance of a professional could make you optimize this technology far better than you can think of.

Moreover, there are plenty of good Ruby on Rails Development Companies out there that offer expert services when you Hire <b>Ruby on Rails Developer</b> for your project. And the best part is you can take free trials and schedule an interview with their experts to know whether you could get on the same page or not!

Hiring an [**RoR Developer**](https://www.bacancytechnology.com/ruby-on-rails-development) could be a win-win situation for you as you can get an amazing product developed in no time with the most cost-effective solutions. So take the opportunity now!
Kotlinでfatjar(shadowjar)を作る(kts版)
Published: 2022-05-17 06:33:49

毎回fatjarを作るときにやり方ググるのが面倒なので自分の記事としてメモしておきます。
なおGradleはkts版とします。Groovy版では少々記述を変える必要があります

## 参考
fatjarとは依存ライブラリも含めたjarファイルです。通常のbuildをした場合に生成されるjarファイルは依存ライブラリは含まれていなく、そのjarを実行する際には依存ライブラリを指定してあげる必要があります。
fatjarを生成しておくと、このjarファイルだけでプログラムの実行が可能となります。
なお、ここまでfatjarと書いていますが、実際に作成に使用するのはshadowjarです。

## 手順
新しいバージョンが常に出ているはずなので、最新のバージョンはこちらで確認しましょう
https://imperceptiblethoughts.com/shadow/getting-started/

build.gradle.kts
```kotlin
plugins {
    kotlin("jvm") version "1.6.20"  // ここはもともと書いてあるはず
    id("com.github.johnrengelman.shadow") version "7.1.2"
    id("java")
}

// jarファイルを実行時に実行されるメインファイルのクラスを指定する。
val jar by tasks.getting(Jar::class) {
    manifest {
        // mainメソッドが存在するファイルのパスに、末尾にKtを付与したものです。
        attributes["Main-Class"] = "packagename.XxxxxXxxxxKt"
    }
}
```

こうすることで、
```
gradle shadowJar
```
で`build/libs/xxxxxxxxx-1.0-SNAPSHOT-all.jar`にshadowJarが生成されます。
このjarを以下のように実行すると
```
java -jar build/libs/xxxxxxxxx-1.0-SNAPSHOT-all.jar
```
先程指定した`packagename.XxxxxXxxxxKt`のmainメソッドが実行されます。

もしほかのmainメソッドを実行したい場合は
```
java -cp build/libs/xxxxxxxxx-1.0-SNAPSHOT-all.jar packagename.YyyyyyYyyyyyKt
```
のように実行することができます。この場合、`build.gradle.kts`の`jar manifest`の記載は不要になります。(その代わり`java -jar`では実行できない)

以上です。shadowJarを使うだけであれば、pluginに2行追加するだけで良いので非常に楽です。ただ、依存の衝突などが発生した場合は大変ですがその際はMergeStrategyを記述する必要があります。
Svelte Components
Tags: javascript, svelte, webdev, wecoded
Published: 2022-05-17 06:23:26

**What is a component? **

> A component in simple words is a stand alone section of a webpage. Basically they are the building blocks to create a web page which can be put together and output to the dom or the browser to create a whole website.


 For example the `nav bar `or `footer` on your webpage can be a component. In svelte kit whole page is represented by component as well. Say for example you have an about page, then in order to represent that about page you would have an `about component` also. Naming of a svelte component has to be `something.svelte`, for example for an about page it can be` about.svelte`. That means the `.svelte `extension is being used in naming svelte components. 

Inside a svelte component we can essentially have 3 different things -

1. `an html template `- which is the html page that is rendered to the browser.
2. `a script tag` - where any interactive javascript which we inject in to the webpage goes in.
3. `a style tag `- where any css to style the template goes in.  

We usually write all of our svelte code inside the `src folder`. We create the components and later inject them into the dom. All of our scripts from our different components and all of our styling from the components are bundled together and made in to a single file in svelte. 

```
<script>
let name = 'Arya';
</script>

<main>
<h1> hello {name}</h1>
</main>
```
The code block above explains the syntax in which we dynamically write svelte. 
 
**Binding variables or values to input fields -**

```
<input type = "text" bind:value = " "  >
```

In order to bind a variable or value to input fields, all we have to do is add and input type text and add in a bind attribute : and add what we would like to bind to the value of the input. 

What this help us achieve is that when the value of the input changes, then the variable changes accordingly and vice versa.
Installing Azure CLI on Windows locally
Tags: azure, cli, cloud, blob
Published: 2022-05-17 06:04:03

The Azure Command-Line Interface (CLI) is a cross-platform command-line tool that can be installed locally on Windows computers. Connecting to Azure and executing commands on Azure resources can be done using the Azure CLI for Windows. Through the Azure Cloud Shell, Microsoft Azure CLI for Windows can also be used from a browser or running inside a Docker container. Further, Azure CLI can also be accessed via command prompt, a familiar interface for most people.

The goal of this article is to walk you through how to install the Azure CLI locally on a Windows computer. You will use the PowerShell environment to do this. The installation is global, hence Azure CLI can be used locally either from PowerShell or command prompt (CMD).

1. Start PowerShell as administrator



![first](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0w5h0k6lztc55pkjbyif.png)

Then 


![second](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bp3ugcisrsjfthkavqps.png)


copy this code into the powershell and press enter:
 **$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri https://aka.ms/installazurecliwindows -OutFile .\AzureCLI.msi; Start-Process msiexec.exe -Wait -ArgumentList '/I AzureCLI.msi /quiet'; rm .\AzureCLI.msi**


![third](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fsykbe0qa3qi6i9d0isk.png)


It will take little time to run, so be patient.

2. After installing of the above, Start up the powershell again but not necessarily as admin and then type:  **az**

![fourth](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wrhf6vn8qdo38xptiagy.png)

3. Go to CMD to confirm if the installation is global, type: **az**


![fifth](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ubyg6d2imgyo7ip3klik.png)

To create blob storage using Azure CLI, I planned to provide instructions, but it was necessary to install Azure CLI locally on a Windows computer before I could proceed. Keep an eye out for the next blog, you will be right if you guessed that it deals with creating Blob Storage using Azure CLI.

Thanks for sharing!
Don't Use Console.log to Log a List of Objects!
Tags: web, javascript, typescript
Published: 2022-05-17 05:40:01

When debugging your JavaScript application, `console.log()` is one of the most valuable methods to log into the browser console for the value of an object or anything. 

But it's pretty challenging to navigate when displaying a list of objects. 

For example, let's console log this data.

```js
const data = [
  {
    "_id": "628332c6b14a04d1708be802",
    "index": 0,
    "guid": "61ec3d19-f7f3-4083-8bef-b9042c881c79",
    "isActive": true
  },
  {
    "_id": "628332c61dc4ecd57ae4f6fd",
    "index": 1,
    "guid": "49ea2d62-afec-4f62-9eae-0890a94462e3",
    "isActive": true
  },
  {
    "_id": "628332c6391c257b04b3c574",
    "index": 2,
    "guid": "a7f2240b-5b9b-4786-8b9d-92307f313349",
    "isActive": true
  },
  {
    "_id": "628332c66e1d9b58e696e38f",
    "index": 3,
    "guid": "b52e0d56-28d8-418f-a30f-e431b7fcaa20",
    "isActive": true
  },
  {
    "_id": "628332c676d375dc108e0f28",
    "index": 4,
    "guid": "e37e0f56-1c35-4f59-bb12-eda874be49fb",
    "isActive": false
  }
]
```

![Screenshot from 2022-05-17 06-32-17.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1652765570592/fDtcEuRUo.png)

And now let's use `console.table(data)` instead.

![Screenshot from 2022-05-17 06-33-46.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1652765646587/vyn1_joP3.png)

The data is much more readable and navigable. You can learn more about `console.table` [here](https://developer.mozilla.org/en-US/docs/Web/API/console/table).

*Article posted using [bloggu.io](https://bloggu.io). Try it for free.*
Tauri or Flutter v3 for a Rust desktop app?
Published: 2022-05-17 05:25:19

Though our open source mobile side is Flutter, but I can not decide either. Our desktop side uses Sciter, similar to html/js. We can use most of old html/js with Tauri. We can also reuse some mobile Flutter code, but our desktop design is super different from mobile. Flutter is not css based, few code can be shared between mobile and desktop per my understanding.

Drawback of flutter:

- Debugging rust with Flutter is not conveninent.

- Both of them are open source, but Tauri has much smaller code base, we can do code change on Tauri, but it is hard for us on Flutter.

I created a pool on my github discussions.

https://github.com/rustdesk/rustdesk/discussions/533
Ask Dev community: License Key Generation
Published: 2022-05-17 05:20:36

After dealing with Paddle's service customer support, I've given up the idea of integrating the service; the major reason for using Paddle was to use their license key APIs.

I am thinking to build my own License key generation. But I am new to backend development, looking some guidance on architecture level or things that I don't know I should consider.


Below are the following services I am planning to build
--------------------------------------------------------------
**1. License Registration** - _Register the license key for the first time_

When user inputs the license key and purchaser’s email, it validates with the backend based on machine’s serial id to determine if it is the first time registration or not.

**2. License Unregistration** - _Un-register the license key from the device._

Let’s say if user decides to use the app on another machine then user has to unregister the current device.


**3. License Update Registration** -_ Register new device for the same key_

Basically user re-registers their key on a new device. 

**4. License Verification** - _Validation every X hours_
Validate every X hours to check if the app has the right key on right machine.

**5. License Revocation** - _Invalidate the key_
When a refund is successful, revoke the existing license key.


**_What do y'all think?_**
You can DM me [here](https://twitter.com/pradeepb28), if you want to share your view in private.