teleren/devto huggingface dataset:
🌈Meet Omkar DevTools: Your Swiss Army Knife as a Ninja Developer🚀
Tags: webdev, python, productivity, tooling
Published: 2023-06-01 14:44:01

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

Maybe you just know [PowerToys](https://github.com/microsoft/PowerToys#about). It's a set of utilities for power users to tune and streamline their Windows experience for greater productivity.

[DevTools](https://www.omkar.cloud/devtools/) is more or less the same thing, but for developers.

## Introduction

Before Omkar DevTools, you must be using a lot of online tools on different sites.

Every time you need to remember the url of the tool, or open Notion to find my notes about the tools and I wasted a lot of times.

Not any more with Omkar DevTools you can access a number of tools in one Dashboard. 

At the moment there a lot of tools available inside Omkar DevTools:

- JSON to YAML
- YAML to JSON
- Base64 Encoder
- UUID Generator
- Secret Key Generator
- Hash Generator
- Lorem Ipsum Generator
- JWT Decoder
- Number Base Converter
- HTML Encoder and Decoder
- URL Encoder and Decoder
- GZIP Compressor/Decompressor
- Color Blindness Simulator
- File Hash Generator
- Base64 File Encoder
- Case Convertor
- Text Counter
- Json Duplicate Remover

## How to use DevTools

You can easily use Omkar Tools by visiting [https://www.omkar.cloud/devtools/](https://www.omkar.cloud/devtools/)


![Dashboard](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9fs7skbylaqg8fk793ys.png)

## Final Thoughts

Try Omkar Devtools at [https://www.omkar.cloud/devtools/](https://www.omkar.cloud/devtools/)

I am curious to hear your thoughts in the Comments about Omkar DevTools.

Dhanyawad 🙏

> I am an IITian with a perfectionist attitude to work, open to projects. See my projects at [https://dev.to/chetanan/chetan-jains-portfolio-cl6](https://dev.to/chetanan/chetan-jains-portfolio-cl6)
Level up your skills with pair programming
Tags: beginners, programming, novicelearner, softskills
Published: 2023-06-01 13:35:42

The focus of today's post is on the well-known concept in the developers' world: **Pair Programming**.

When I initially began learning coding, I discovered the concept of Pair Programming from my mentor, who also happens to be my husband. I realised how it aids in enhancing one's programming skills, although I naturally had doubts at first.

Given my introverted personality and struggle with imposter syndrome, it took me some time to gather the courage to actively approach my engineer colleagues and propose pairing sessions. Typically, I aimed to initiate such sessions at least once every sprint, occasionally even more frequently depending on the number of programming tasks relevant to the current sprint. 

**So what is Pair Programming about?**

The name itself is self-explanatory. When practicing Pair Programming, you collaborate with a team member who ideally possesses seniority or more experience either in the programming language or the project you'll be working on. 

**What are the benefits of this method?**

I was honestly surprised at how quickly my programming skills improved after just a few pairing sessions. It got me wondering, why did that happen?

One of the coolest things about pair programming is the interaction between you and your colleague during the session. In my limited experience with pairing, usually, one person takes the lead while the other follows along, providing comments and insights along the way. This collaboration generates new ideas and leads to better problem-solving (after all, two brains are better than one!). It's like having a study buddy, but for coding.

Pairing also serves as a way to reinforce the knowledge you gain from observing your teammate's approach to problem-solving. Instead of talking to a rubber duck (yes, some programmers do that), you're discussing your thoughts and explanations with an actual person. And let's be honest, bouncing ideas off a real person should yield better results than talking to an inanimate object. 

**What's next?**

If you're a junior developer like me and still getting acquainted with the team, don't hesitate to suggest a pairing session with someone you feel comfortable with. Chances are, they'll be more than willing to join you. 

Don't worry about potentially slowing down your colleague's workflow due to your limited knowledge and experience. Remember, for you, it's a valuable learning experience, and for your colleague, it's an excellent opportunity to practice mentoring and enhance their communication skills.

Happy pairing!
LSM references
Tags: lsm
Published: 2023-06-01 14:09:55

This article would be updated as soon as a new useful article out to the world.

### Basis
1. [Overview of the Linux Kernel Security Subsystem - James Morris, Microsoft](https://youtu.be/L7KHvKRfTzc)
2. [Inside the Linux Security Modules (LSM) - Vandana Salve, Prasme Systems](https://youtu.be/RKBBPsp-TZ0)
3. [Tutorial: How to Write a Linux Security Module - Casey Schaufler, Intel](https://youtu.be/4rFxZw3USIs)

### Stacking
1. [LSM Stacking - What You Can Do Now and What's Next - Casey Schaufler, Intel](https://youtu.be/XtKodXBxY6U)
2. [Using a Different LSM from the Host in a Container - John Johansen, Canonical](https://youtu.be/THzC4lZTH-k)
File uploading in Flask
Tags: python, flask, mysql, cloudstorage
Published: 2023-06-01 14:09:11

I've used two ways of uploading files 
- only directly to folder
- directly into database from a folder

### Upload to a folder

You can choose the folder of your choice to receive uploaded files, here in my project when a file is uploaded the file is taken , sperated by extension, rename the file to current timestamp and upload the file to folder and the name to the database. The file is only saved in the folder.
```
app = Flask(__name__, static_folder='uploads')
```


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

So the file into the folder and the name to the database.

### Upload to database from a folder

So if you wanna a directly upload any file to the database, you need to save it as `BLOB`.
File size by MySQL type:
```
TINYBLOB 255 bytes = 0.000255 Mb
BLOB 65535 bytes = 0.0655 Mb
MEDIUMBLOB 16777215 bytes = 16.78 Mb
LONGBLOB 4294967295 bytes = 4294.97 Mb =4.295 G
```

So basically you'd have to convert the file into binary form and then upload it to the database. 

```
def convertToBinaryData(filename):
    with open(filename, 'rb') as file:
        binaryData = file.read()
    return binaryData
```


Eventhough we are saving the file directly into the database we are forced to assign a location of file upload as same as the previous method. If you don't, flask will throw a error such as `No such filename as filename.type`.


![Imagesx](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5jqent248z4357ssqkex.png)



So we follow the same steps as before,and we add a step in converting the uploaded file to binary and upload the file and the file's name to the database.

You can delete the file from the folder after upload to the database if you want to. 

Please check if the upload works!!

Here's the view of the `BLOB` file and their names in the mysql database

![Image-database](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pmz0cjem1gg4xnwv9t4n.png)

Give it a shot and enjoy!! THANKS!

---


## Project Installation


### Requirements
- Python `3.10.6`

### Install
- clone 
```
git clone https://github.com/pj8912/flask-file-upload.git
```

- Create `virtual environment` and **activate**

- Install requirements
```
pip install -r requirements.txt
```

### Configuration 
- I used `mysql` database for this project

- create an `.env` and add appropiate values for your mysql setup 
- `.env` variables : 
    - `DB_HOST=`
    - `DB_USERNAME=`
    - `DB_PWD=`
    - `DB_NAME=file-test`

Host, username, password and database name

My **database name** is **`file-test`**

- **SQL file**

*Import* sql file from **`mysql/file-test.sql`**

### Run

``` 
python app.py
```
How to Build - No Code Dev Portfolio GitHub
Tags: javascript, tutorial, portfolio, github
Published: 2023-06-01 14:08:44

Hello amazing Peoples on the internet, After a long time we are going to know how to build no code portfolio with github. I'm working on my youtube channel where you will get content related to the open-source development, freelance work, Technical Writing and opportunities through opensource. 

Here is the Link to My Channel - https://www.youtube.com/@GaneshsYT
<mark>if you Love the content, Consider to Subscribe. </mark>


---
# Introduction ✨
A building developer portfolio from scratch is time consuming but believe me it worth in previous article we talked about git showcase and now we are going to implement same idea. 

- [What is Github Showcase](https://dev.to/ganeshstwt/build-personal-github-showcase-47b2) 

In this article we are going to build smart developer portfolio less than 5 clicks. Building portfolio is time taking process and if you are looking for simples way to build portfolio with less time you're in right place. 

<img width="100%" style="width:100%" src="https://media.giphy.com/media/fE4yliHjpWWDpGxOEN/giphy.gif">


# What You Need ✍
This is very important section because here we need 
- Github Account 
- Git Basics
- Projects Repo's on Github

That's it. Your portfolio is ready. If you don't know what is git & Github here you can check [A Complete Guide on Git & Github](https://dev.to/ganeshstwt/customize-your-github-profile-1fnb) There are three simple steps you have already have github account 

1. Sign in with Github
2. Authorize Git Showcase 
3. Portfolio is ready 

Its simple to build portfolio with git showcase and host to github pages or netlify you don't need to put extra efforts everything is prebuild. 
 
# No Code Portfolio - Github 👩🏻‍💻
Here are the steps you should follow to build no code portfolio with Git showcase - 
1. Visit to [GitShowcase](https://www.gitshowcase.com/)
2. Sign in with Github Account
3. Authorize Github Account
4. Done. 


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


# Live Demo 
Here is the Live Demo of your portfolio which you build with node code - Git Showcase 

[Live Demo Link to Git Showcase Portfolio](https://www.gitshowcase.com/showcasecat)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rwux79aptzkv3j3jzwd8.gif)



# conclusion 
That's it and your portfolio is ready to launch also Git showcase provides free domain & hosting as showcase/username you can also use your custom domain. 

📌Actively Looking for opportunities in Developer Relationships share some if you have 👇🏻

📌Reach out to me via [Twitter](https://twitter.com/ganeshstwt) 
📌Check out my Youtube channel here 

{% embed https://www.youtube.com/watch?v=52biDlBTrhQ&t=404s %}
Engaging Content on Javascript Core Concepts 💻
Tags: beginners, webdev, frontend, javascript
Published: 2023-06-01 14:03:05

I have started a series on **Javascript Core Concepts**. This series covers all the important javascript concepts which are vital to understand as a javascript developer. Good understanding of a language can benefit the developer in writing clean and optimised code. It improves code debugging and thus increase the productivity.

---

## ABOUT ME
I have 6+ years of experience in Frontend Development.I have worked in various **product based companies** and got a chance to build the **enterprise applications from scratch** which are used by prime hotel chain brands such as ESA, G6, Hilton which ranked in top 10 hotel chains. I have developed my coding skills through working in **startups** which are known to have a very **fast paced environment**. This really helped me gain lots of knowledge. Now I am here and available to share this vital knowledge with you. If you are a **beginner** or a **working professional** and want to be more efficient in coding and master the javascript language, I am here to help and guide you. **Mastering the javascript** will open the door for you to start **working on any latest framework with ease**. This will **make you so powerful as a developer** and you can simply **crack any interviews** with **higher packages**!


## I am available for **mentorship** and **training** on **Javascript**.

---


## Contact -
**Email** - codecraftjs@gmail.com
**Instagram** - codecraftjs
**Hashnode** - [code-craft.hashnode.dev](code-craft.hashnode.dev)
Upstream speaker spotlight: Nithya Ruff, head of the open source program office at Amazon
Tags: opensource, maintainers, upstream
Published: 2023-06-01 14:00:00

Upstream is next week—June 7!—and wow, our schedule is shaping up brilliantly. Over the next week we’ll share more details about the amazing speaker lineup. [RSVP now](https://upstream.live/)!

We kicked off these speaker highlights [with Julia Ferraioli of Open Source Stories](https://blog.tidelift.com/upstream-speaker-spotlight-julia-ferraioli-co-founder-of-open-source-voices), who closes the day with her talk, How we treat others is a supply chain issue.

Next up: Nithya Ruff! We are delighted to have Nithya Ruff, head of the open source program office at Amazon, as our opening external speaker at Upstream on June 7, 2023. Nithya will share her perspective on the accidental relationship between open source maintainers and consumers.

Most independent open source developers never intended to be a supplier to a Fortune 50 critical infrastructure project. Imagine a home cook suddenly having to serve their food intended for daily consumption, in a 2-star Michelin Restaurant. It was just not built or ready for that level of expectation and scrutiny. 

In reality, that is what is happening with the success of open source in the world. Small one or two person projects suddenly come into the spotlight and discover that the world is now depending on them. To be fair, the Michelin restaurant did not know that their component came from a small home cook or a small farmer. It was brought in accidentally by their chefs or purveyors. It was all an accidental relationship that they now need to live with. 

How do we live in this world of unintended relationships between supplier and consumer, and who is responsible for making it work for both?

More about Nithya: Prior to Amazon, she started and grew Comcast and Western Digital’s Open Source Program Offices. Nithya first glimpsed the power of open source while at SGI in the ‘90s and has been building bridges between companies and the open source community ever since. She’s also held leadership positions at Wind, Synopsys, Avaya, Tripwire and Eastman Kodak.

She is a passionate advocate and a speaker for opening doors to new and diverse people in technology and can often be seen speaking and writing on this topic. In fact, Nithya joined us for a panel discussion on [best practices for inclusive development](https://tidelift.com/webinar/best-practices-for-inclusive-development/on-demand) back in October 2022.

We can’t think of a better person to help us kick off the discussion on the accidental supply chain at Upstream on June 7, 2023. [RSVP so you don’t miss it](https://upstream.live/)!
Notification Components just Released! 🎉
Tags: react, tailwindcss, html, news
Published: 2023-06-01 13:47:37

New month and a new component released! 🎉
Upgrade your user experience with our new Accessible Notifications, featuring 24 variations!

[https://wind-ui.com/components/notifications/](https://wind-ui.com/components/notifications/)

Feel free to copy, use & share the love 💚
Capturing browser console logs on automated test
Tags: selenium, frontend, testing, rails
Published: 2023-06-01 13:43:02

Test flakiness is not only annoying, but also costing time, energy, and money in the long run. That's why it is important to deal with them as soon as possible.


![Flaky test meme](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cnlofymuvsslz63xy38b.jpg)

One of the most challenging test type to debug and fix when flakiness occurs is feature test with browser testing. This is because there are usually many elements involved in the test (backend/server, the test spec, and the browser controller) and these elements have to work together in the correct manner for the test to run. Most of the time, flakiness occurs due to race condition (the browser controller was too fast for the backend, etc)

Recently our application, which is built on Ruby on Rails on the backend suffers from test flakiness during CI. Our feature tests are setup to use Capybara with Selenium Chrome driver, and when the test failed, it failed at random points with error message that's too generic. Making things complicated is the fact that tests that succeed locally failed on Travis CI.

Unable to simulate the failing tests, I had to resort to different method: **figure out what the browser console output at the time of failure**. With only headless mode available on Travis CI, this can be done programatically:

```ruby
  def console_logs
    driver.browser.logs.get(:browser)
  end
```

Please note that the `selenium-webdrivers` gem need to be the newer version (v4 onwards) for this to work.

By default this will only capture log messages on warn/fatal level (output from `console.warn` and `console.error`). To retrieve the log messages on info/debug level, I needed to change Selenium Chrome's logging preference option:

```ruby
Capybara.register_driver :chrome do |app|
  chrome_options = Selenium::WebDriver::Chrome::Options.new

  chrome_options.logging_prefs = {
    browser: 'ALL', # Capture JavaScript errors
    driver: 'SEVERE', # Capture WebDriver errors
  }

  http_client = Selenium::WebDriver::Remote::Http::Default.new

  options = {
    browser: :chrome,
    options: chrome_options,
    http_client: http_client,
  }
  Capybara::Selenium::Driver.new(app, **options)
}
```

That's it folks. Hope that helps somebody too.
算法的时间复杂度表达方式“O”是啥？怎么读？
Tags: 算法, bigo, omicron, 奥密克戎
Published: 2023-06-01 13:29:16

- 算法的时间复杂度准确的来说全称应该是：“算法的渐进时间复杂度”
  > 这里的“渐进”可以理解为一种趋势，“O”真正描述的是随着输入规模的膨胀，算法所需计算次数的膨胀趋势；这往往描述的是最极端，最坏的情况所需的计算次数；

- "时间"复杂度中的“时间”并不是时间
  > 不是我们生活中的分秒时间概念，而是次数，是对于次数的抽象表达;因为真正的处理耗时受到硬件等条件的制约，无法确定；

- 这个“O”该怎么读？这不是零，是O，大写的欧；比如O(n)；
  - 首先得知道它是啥，他是希腊字母O，不是英文字母（拉丁字母）O；不是同一个字符体系；虽然长得差不多；
  - 为啥是希腊字母？这是国际数学惯用规范的问题，数学领域就喜欢这么用，就是喜欢用希腊字母来作为数学符号；可以看下面的希腊字母表，会有很多熟悉的面孔
    ```
    > 大写形式：Α, Β, Γ, Δ, Ε, Ζ, Η, Θ, Ι, Κ, Λ, Μ, Ν, Ξ, Ο, Π, Ρ, Σ, Τ, Υ, Φ, Χ, Ψ, Ω
    > 小写形式：α, β, γ, δ, ε, ζ, η, θ, ι, κ, λ, μ, ν, ξ, ο, π, ρ, σ/ς, τ, υ, φ, χ, ψ, ω
    ```
  - 如何发音？一般人都是发 "big O" 但是其作为希腊字母表的第15个字母正确的发音是：“omicron” ;这里我不能明白大家为啥都叫" big O "

  - 新冠肺炎的一个变异毒株 B.1.1.529 被 WHO 命名为“omicron” ，正是希腊字母的第15个字母O，关于这个命名，英文圈都是发音：“omicron” ,却不是 “big O” ;  中文音译过来是：“奥密克戎”

  - 综上：新冠变异毒株的读法，以及一些数学符号比如A，发：“alpha”音；我觉得O(n)最为标准的读法应该是："奥密克戎n"，而不该是“big O n”吧
Azure Functions Tips: override the host.json settings!!
Tags: azure, azurefunctions, serverless
Published: 2023-06-01 13:28:35

The `host.json` file in Azure Functions is a configuration file that provides runtime-specific settings for your function app. 
This file is located at the root of a function app project. 
Some of the settings that can be configured in the `host.json` file include the version of the Azure Functions runtime, logging settings, function timeout duration, and settings for bindings and triggers. 
The settings in the `host.json` file apply to all functions within a function app.

Every time you need to change some settings inside it, you need to redeploy the entire Functions App (I know that you can access to the  files in the deploy directly from the portal, but it isn't a good idea!!). Fortunately, you can override the values you have in the `host.json` thought the `appsettigs.json` file (or using the configuration blade in the portal).  

In particular, you can set the configuration value similar to the following:

```
AzureFunctionsJobHost__<HOST-CONFIG-VALUE> = value
```
where `<HOST-CONFIG-VALUE>` is the `host.json` value you want to override.
For example, suppose you have the following host.json:

```json
{
  "version": "2.0",
  "logging": {
    "applicationInsights": {
      "samplingSettings": {
        "isEnabled": true,
        "excludedTypes": "Request"
      }
    }
  },
  "functionTimeout": "00:05:00",
  ....
}
```

In that file, you set the timeout for your functions to 5 minutes. If you want to override that value to have 3 minutes of timeout, you can add the following setting in the `appsetting.json` file:

```json
{
  "IsEncrypted": false,
  "Values": {
    ...
    "AzureFunctionsJobHost__functionTimeout": "00:03:00",
    ...
  }
}
```

In that case `<HOST-CONFIG-VALUE>` is `functionTimeout`.
If the value you want to override is a property of a section in the `host.json` config, you need to use the `__` string to describe the hierarchy.
解決 Replit 猜錯套件安裝的問題
Tags: replit, python
Published: 2023-06-01 13:26:51

[Replit](https://replit.com/) 是我很喜歡的線上開發環境, 它除了給你一台雲端的虛擬電腦以外, 在協助開發的工作上也加上了不少的功能, 像是最近它就加入了類似 ChatGPT 的 AI 聊天功能 [GhostWriter](https://www.semafor.com/article/02/15/2023/startup-replit-launches-a-chatgpt-like-bot-for-coders)。

不過 Replit 有一個很貼心、卻有可能造成困擾的功能, 就是在預設的狀況下, 它會幫你根據程式碼匯入的模組猜測應該要安裝哪一個套件, 並且會自動幫你安裝。既然是猜測, 當然有可能會猜錯, 造成程式無法執行。以這個 [Test-Config](https://replit.com/@meebox/TestConfig) 專案為例, 預期要使用 [`googlesearch-python`]() 套件內的 `googlesearch` 匯入可取得 Google 搜尋結果的 `search` 函式：

```python
from googlesearch import search

for i in search('nba', advanced=True):
  print(i.title)
```

但 Replit 總是會猜測成使用 [`google-search`](https://pypi.org/project/google-search/) 套件：

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

但是 `google-search` 套件內的 `googlesearch` 模組並沒有 `search` 函式, 導致一執行就出錯：

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

你必須自行解除安裝 `google-search` 套件, 再安裝 `googlesearch-python` 套件才整讓程式正常運作, 但麻煩的是之後若是因為任何套件有更新, Replit 還是會再猜測, 又重新安裝 `google-search` 套件了。

## 使用 .replit 檔設定專案

其實 Replit 中每個專案都有一個 [.replit 設定檔](https://docs.replit.com/programming-ide/configuring-repl), 可以控制專案的一些細部動作, 當然也包含要如何安裝套件。要編輯這個檔案, 必須先顯示隱藏檔：

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

### 取消自動猜測並安裝套件的功能

開啟 .replit 檔後, 可以找到 [\[packager\]](https://docs.replit.com/programming-ide/configuring-repl#packager) 區段：

```ini
# Configures the packager.
[packager]
language = "python3"
ignoredPackages = ["unit_tests"]

  [packager.features]
  enabledForHosting = false
  # Enable searching packages from the sidebar.
  packageSearch = true
  # Enable guessing what packages are needed from the code.
  guessImports = false
```

其中 [\[packager.features\]](https://docs.replit.com/programming-ide/configuring-repl#packagerfeatures) 子區段中有個 [guessImports](https://docs.replit.com/programming-ide/configuring-repl#guessimports) 可以設定要不要讓 Replit 自己猜測要使用哪一個套件, 預設為 `true`, 只要改為 `false`, 就不會自動猜測並且安裝套件, 但是就變成要**自行安裝**所有需要用到的套件。

### 取消猜測特定模組安裝套件的功能

剛剛的設定會完全取消 Replit 自動從模組名稱猜測並安裝對應套件的功能, 這可能會讓你覺得不大方便, 不過還好, 另外有一個設定是 [ignoredPackages](https://docs.replit.com/programming-ide/configuring-repl#ignoredpackages) 可以列出不要讓 Replit 去猜測的模組清單, 例如：

```ini
# Configures the packager.
[packager]
language = "python3"
ignoredPackages = ["googlesearch", "unit_tests"]
```

這樣當 Replit 看到程式碼中要匯入 `googlesearch` 模組時, 就不會猜測應該要安裝哪一個套件, 但是如果看到的不是在這個清單內的模組, 還是會自動猜測並安裝套件。

## 使用特殊格式註解強制指定要使用的套件

前面的設定雖然可以解決問題, 不過卻必須自行安裝沒有自動猜測的模組對應的套件。Replit 很貼心的想到了這一點, 因此提供有另外一個功能, 讓你可以在匯入模組的陳述句加上[特定格式的註解](https://docs.replit.com/programming-ide/installing-packages#guessing-failures), 強制讓 Replit 安裝指定的套件。例如以下的註解就會讓 Replit 知道要使用 `googlesearch` 模組需要安裝的是 `googlesearch-python` 套件：

```python
from googlesearch import search  #upm package(googlesearch-python)
```

當 Replit 看到這一行時, 就會幫你自動安裝 `googlesearch-python` 套件, 不需要你再自行安裝了。