teleren/devto huggingface dataset:
#1 iOS Security Tips: UIPasteboard | iOS Development
Tags: ios, security, swift
Published: 2022-05-17 17:26:16

##What is UIPasteboard: 
This is a method to share data between any other app using cut or copy methods.

##How it become a Security concern:
When we copy a sensitive piece of data, It will store in the general paste board of our system which can access by another apps

##How to access general paste board programmatically:
```swift
UIPasteBoard.general.string
```

##Methods to prevent this security issue:
####1. isSecureTextEntry
UITextField has a property called isSecureTextEntry. We can set this to true. Its mainly used for passwords
```swift
let passwordTextField = UITextField()
passwordTextField.isSecureTextEntry = true
```

####2. Wipe the content in the paste board in the AppDelegate's applicationWillResignActive method

```swift
UIPasteboard.general.items = [[String: Any]()]
```

####3. Create an app specific paste board
The data will not be available to other app if we use custom paste board.
How to create a custom paste board in AppDelegate
```swift
extension AppDelegate {
    static let pastboardName = UIPasteboard.Name(rawValue: "CustomPasteBoard")
    static var customPasteBoard: UIPasteboard? = UIPasteboard(name: pastboardName, create: true)
}
```
How to store data in custom paste board
```swift
extension UITextField {
    open override func copy(_ sender: Any?) {
        AppDelegate.customPasteBoard?.string = self.text
    }
    
    open override func cut(_ sender: Any?) {
        AppDelegate.customPasteBoard?.string = self.text
        self.text = nil
    }
    
    open override func paste(_ sender: Any?) {
        if let text = AppDelegate.customPasteBoard?.string {
            self.text = text
        }
    }
}
```
This will store your app's data to custom paste board.

Apple Doc of [UIPasteboard](https://developer.apple.com/documentation/uikit/uipasteboard)
Happy Coding🔥
Setting Up a Headless Pi on new Raspbian Images
Tags: pihole, linux, opensource
Published: 2022-05-17 17:19:42

Yesterday I wanted to boot my raspberry pi 3 without having to connect it to my monitor; I realised after flashing the card 3 times it wasn't working...

Typically you just need 2 files to have a functional headless raspberry pi (`ssh, wpa_supplicant`) right from boot. However, in this case I was met with a blue-screen of death asking me to create a new username by connecting a wired keyboard...

Anyways, without sounding any more dramatic;  

Here is what the new setup should look like on every Raspbian sd-card /BOOT partition: 

- `wpa_supplicant.conf`
- `userconf.txt` {pi:encrypted-password}
- `ssh`

You can also just clone my [repo](https://github.com/vonthecreator/headlesspi-new-defaults) for the defaults.
How to always Paste and Match Style on macOS
Tags: macos, productivity, stackoverflow, shortcuts
Published: 2022-05-17 17:01:06

---
title: "How to always Paste and Match Style on macOS"
published: true
description: "Let's make ⌘ + V Paste and Match Style by default."
tags: ["macOS", "productivity", "stackoverflow", "shortcuts"]
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/senpst8m4wurz1aqifps.png
canonical_url: https://www.iamkonstantin.eu/post/2022/05/17/how-to-always-paste-and-match-style-on-macos/
---
## How to always Paste and Match Style on macOS

It’s safe to say that some of us do a lot of copy-pasting during the day. (StackOverflow even [sells a dedicated keyboard](https://www.theverge.com/22761188/stack-overflow-the-key-copy-paste-review-price-release-date-keyboard)).

While the ability to copy content from one app and paste it into another is probably in the TOP 3 productivity features of a modern computer, it doesn’t come without its quirks…

Just in case you don’t know what I’m talking about - when you copy some text content from a place with formatting (like custom font, colors, etc.) and then paste it into another app that also supports (to some extent) rich text formatting.

By default, copy-paste (⌘ + C / ⌘ + V) allows an app to capture all [available content types](https://developer.apple.com/documentation/appkit/nspasteboarditem/1508499-types) when pasting. As a result, copying a snippet from a web page comes in both plain text and rich/formatted text. All worldly computer things have opted to use the richest form of content available in the clipboard when pasting for reasons beyond my understanding 🙄.
  
Honestly, I can’t remember when (if at all) I needed this behavior. In all cases, I want the source text to match the destination formatting as best as possible. This feature exists; it’s the **Edit** \> **Paste and Match Style** command.

To fix this in (almost) all apps, you head to System Preferences \> Keyboard \> Shortcuts \> App Shortcuts and then hit the plus button to create a new shortcut with the menu title “Paste and Match Style” and assigning ⌘ + V! That’s it 🎉! 

![Screenshot of the macOS system preferences showing custom app shortcuts.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/senpst8m4wurz1aqifps.png)

⚠️ This technique does not work in Microsoft apps like Word, which chooses to override and shamelessly disregard the user’s system preferences or (most of) the text services provided by macOS 🤷🏻‍♂️.
Angular 10 with PRIMENG DROP DOWNS Not binding saved data
Tags: angular, webdev, primeng
Published: 2022-05-17 16:59:39

Here are my models they come down from the api fine, the problem is not when I change the drop down and save that part if fine the issue is when the page loads all the drop downs are at their default

export interface LookUpData {
    Id: number;
    Display: string;
    Description: string;
    Value: string;
}

export interface RiskQuestionaireData {
    RiskId: number;
    OrgId: number;
    QuestionDetail: QuestionDetail[];
}

export interface QuestionDetail {
    Id: number;
    Category: string;
    Question: string;
    InherentId?: number;
    CurrentId?: number;
    ResidualId?: number;
    LookUpData: LookUpData[];
    AnswerListText: string;
    InherentConsequence:LookUpData;
    CurrentConsequence:LookUpData;
    ResidualConsequence:LookUpData;
}






here is the ngTemplate i use
for ngModel is have tried [(ngModel)]="questionDataObject.QuestionDetail[rowIndex].InherentId" as well as [(ngModel)]="questionDataObject.QuestionDetail[rowIndex].InherentConsequence




<ng-template pTemplate="body" let-rowData let-rowIndex="rowIndex"  let-columns="columns"  >
            <tr>
            

              
              <td colspan="2" [pEditableColumn]="rowData">
                <p-dropdown [options]="getddlList(rowData)" optionLabel="Display"    optionValue ="Id"
                  [(ngModel)]="questionDataObject.QuestionDetail[rowIndex].InherentId" name="inherent">
                </p-dropdown>
              </td>
              
              
            </tr>
          </ng-template>
angular
primeng
angular2-template
prime
Install cfn_nag on Windows
Tags: aws, devops
Published: 2022-05-17 16:43:46

When writing any type of code you always want it to follow best practices or be as secure as it can be. 

When writing [AWS CloudFormation templates](https://www.techielass.com/create-an-s3-bucket-using-aws-cloudformation) you can use **cfn_nag** to perform some basic security tests on your templates. 

The tool can validate both JSON and YAML AWS CloudFormation templates against the [AWS CloudFormation Resource Specification](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-resource-specification.html). 

I recently wanted to use the [cfn-nag](https://github.com/stelligent/cfn_nag) tool on some templates I was writing but couldn't find any instructions to install on Windows, but I have found a way to do it.

## Step 1 - Install Windows Subsystem for Linux
Windows has a tool called [Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/windows/wsl/about?WT.mc_id=AZ-MVP-5004737), that allows you to run a GNU/Linux environment on your Windows machine without the overhead of having to run a dual booting system on your machine. 

To install WSL on your machine open up an elevated PowerShell command and type:
```powershell
wsl --install
```

This will download the latest Linux kernel, and install a Linux distribution, by default this is Ubuntu. 

Once WSL has been installed you will be asked to set up a username and password.  Follow best practices with this.  If you ever forget the password, [you can reset it](https://www.techielass.com/reset-ubuntu-password-in-wsl-on-windows-10/). 

## Step 2 - Install Ruby
The cfn-nag tool has a dependency on Ruby so we need to ensure that is installed.  We can do this by issuing the command within our WSL terminal:
```powershell
sudo apt install ruby
```

## Step 3 - Install the cfn-nag tool
Now you have all the dependencies installed you can install the tool itself.  To do that we use the following command: 
```powershell
sudo gem install cfn-nag
```

## Start to use cfn-nag
Everything is now installed and ready for you to use!


![cfn-nag being used](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hh9m0uiwcxat0otvsvuh.png)
Day-89 Training At Ryaz
Tags: javascript, webdev, beginners, programming
Published: 2022-05-17 16:42:06

Date:17/05/2022
Day:Tuesday

Today, I started at about 10:30 am as I was in progress to complete the project and the java script course so, today I started with the left over task so, today I started with the java script course firstly I started at about integrating the email verification in the bidding project so, I got some errors and would not able to do it but I would surely able to complete it by tomorrow and the the first half of the day I started with the left over java script course and the instructor started with the project that is rebuilt in the course and only the some changes are advised from the instructor and after this I started with the git hub section as the instructor started with all the basics of GitHub pull, push,commit and all the things so, I scrolled all the videos as I watch it as I only skimmed it as I know the git commands so, after this  I searched for the payment integration with my project so, I didn't find suitable for me so, if I get it fit to project I would do it surely. so, this way my day ended up and I got to learn many new things.
React Dashboards - Why Are They So Popular And How To Build One?
Tags: react, javascript, webdev
Published: 2022-05-17 16:20:42

---
title: React Dashboards - Why Are They So Popular And How To Build One?
published: true
description: Dashboards are a very popular type of web application, as they can be used to display a variety of data in many formats to the user and provide relevant information and metrics. Learn more about how to build dashboards using React.
tags: react, javascript, webdev
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rq08oxd38rk9q6cvhdub.png
---

Dashboards are a very popular type of web application. A great thing about dashboards is that they can be used to display a variety of data in many formats to the user and provide relevant information and metrics. There are different types of dashboards, such as admin dashboards that can be used to manage users, accounts, and business-related data or financial dashboards that display useful financial information, statistics and various charts and graphs. One dashboard I worked on in the past was a platform for recruiters that incorporated information about jobs, applications, applicants, credits, etc. Whilst an admin user could manage all jobs and users and configure rules for the system, a recruiter user could create jobs and buy credits. In a nutshell, dashboard applications make it easy to see a lot of data quickly but also to effortlessly access various features.

## What Tools Should Be Used To Build A Dashboard?

Dynamic dashboards can involve quite a lot of interactivity and data fetching, sometimes even in real-time. That's why a lot of developers choose frameworks that are declarative and can be used to build single-page applications (SPAs). Good examples are React, Vue and Angular. A single page application avoids page reloads, so the UI can be updated instantly in many different places after API requests are performed. For example, a dashboard home page could display a few different widgets, and each of them can make its own API requests to fetch required data.  What's more, these frameworks are component-based, and components are great for encapsulating and reusing common UI elements and logic.  Most dashboard applications do not require any search engine optimisation, as they often require a user to be authenticated, so that's another point for SPAs. 

## Learn More About How To Build Dashboards using React

Building a dashboard might seem like an overwhelming task at the start. There are so many things going on, after all, such as displaying dashboard widgets and providing users with the capability to configure them. Fortunately, building a dashboard might be easier than you think. I've written a tutorial called [React Dashboard Tutorial—How To Build an Interactive Dashboard](https://www.telerik.com/blogs/react-dashboard-tutorial-build-interactive-dashboard?utm_medium=referral&utm_source=dev.to&utm_campaign=kendo-ui-react-blog-exploration-react-dashboards) - it will walk you through how to create an interactive dashboard in React.
Journal of self-growth
Tags: devjournal, reflection, popularity, softskill
Published: 2022-05-17 16:15:17

The area in my life where I have been afraid to try is meeting new people, talking to strangers and building connections. Because I have been afraid to fail, afraid to embarrass myself and fearful of rejection, this is an area that I believe will be a stretch and challenge for me. It's been important to me because I am still thinking about improving it.

When I was young, there were moments in school when I felt lonely. I enjoyed reading history books more than engaging with my peers to play silly games. Also, I witnessed how school bullying happened with naughty students laughing at others for being ugly, being too short and being stupid. The best way for me to not be bullied is to stay away from others, disengage and keep quiet. It is to avoid injustice in school with the trauma that I could never forget. Being unpopular is a scary thought.

In contrast, having a good relationship with everyone would lead to a better life. Being popular online would bring higher income, a better career, and more confidence, and it seems to be less stressful. I have to forget the experience of harmful interactions with classmates and re-learn how to be more friendly and grab every opportunity to connect, socialise and engage with others. To get better soft skills, I would need to have self-reflection, accept some of my assumptions in life are false, differentiate facts from misconceptions, collaborate more and show curiosity toward other people. By having the necessary soft skills, I could unlock success in life.
Top 7 Featured DEV Posts from the Past Week
Tags: top7
Published: 2022-05-17 15:27:27

---
title: Top 7 Featured DEV Posts from the Past Week
published: true
description: A round up of the most-read and most-loved contributions from the community this past week
tags: icymi 
cover_image: https://thepracticaldev.s3.amazonaws.com/i/sfwcvweirpf2qka2lg2b.png
---

_Every Tuesday we round up the previous week's top posts based on traffic, engagement, and a hint of editorial curation. The typical week starts on Monday and ends on Sunday, but don't worry, we take into account posts that are published later in the week._ 

## 14 Tips to Write Amazing CLI Apps

@wesen finds command-line tools an incredible way to multiply the impact of the code they produce. Here is a collection of tips gathered over the years writing CLI tools.

{% embed https://dev.to/wesen/14-great-tips-to-make-amazing-cli-applications-3gp3 %}


## The Ideas behind Clean Code

For applications that tend to grow and remain for many years, the Clean Architecture approach is a good solution to use. However, for simple and non-evolving systems, it may not be worth the effort as you'll see from @rubemfsv…

{% embed https://dev.to/rubemfsv/clean-architecture-the-concept-behind-the-code-52do %}


## Finding Meaning in Software Engineering

@thawkin3 brings up some important thoughts about fulfillment and satisfaction in the workplace and beyond.

{% embed https://dev.to/thawkin3/my-recurring-existential-crisis-as-a-software-engineer-453o %}

## Lights on, Lights off

Whether you like to "dark mode all the things" like @whitep4nth3r or prefer to brighten up your screen, it's nice to have the option between light & dark mode. Learn how to provide that option with just 14 lines of CSS!

{% embed https://dev.to/whitep4nth3r/light-and-dark-mode-in-just-14-lines-of-css-424e %}


## Can you Prevent Merge Conflicts?

Solving merge conflicts is fun! - said no one ever. @benjamincohen123 runs us through what merge conflicts are, how to resolve them, and maybe how to prevent them in the first place!

{% embed https://dev.to/benjamincohen123/can-you-resolve-merge-conflicts-before-they-happen-46nd %}


## Building a Music Player

In this detailed tutorial, learn step-by-step how @madza created a music player in React to showcase their own music. Be sure to tune into Madza's beats as well. 🙌

{% embed https://dev.to/madza/how-i-built-a-music-player-to-showcase-my-own-tracks-3268 %}


## The Novu project got funded!

@scopsy open-sourced the Novu project which now has more than 3,500 stars on GitHub! With their latest $6.6 million funding round, they’re ready to build this project with the help of the open source community.

{% embed https://dev.to/scopsy/our-open-source-project-got-funded-1bon %}


_That's it for our weekly Top 7 for this Tuesday! Keep an eye on dev.to this week for daily content and discussions...and be sure to keep an eye on this series in the future. You might just be in it!_
Variables in Swift
Tags: swift, ios, mobile, tutorial
Published: 2022-05-17 16:02:44

What are variables? Most of you are here to understand the first and foremost concept of programming, but we will help you answer with the simple steps:

If you were attentive and loved Maths as your subject in High School, it's easy to identify this concept quickly.
Never mind, forget that Math Class from your boring instructor. We are here to explain it in an easy way. For that, speak out the word variable. Does it sound somewhere close to the word "Vary", well now we assume you know the meaning and would have guessed the definition of the term "variables".

Variables are one of the concepts in programming and not just Swift. It stores some value whether it may be an Int, Float, String, Double, etc.

If you are new to Swift or programming, we suggest you go over the upcoming article to understand Data Types (Int, String, Double, etc.)

Also, we highly encourage you to implement it with us by running the Playgrounds app by Apple. You can download it from the App Store. If you don't have Mac but an iPad, it will run on that too!

Let us now declare a variable. To declare a variable in Swift, we first write down "var". You can say it's also a short form of the term "Variable". If you see the color of the keyword we entered, it would be the pink one. After that, you write the name of your variable, which you can see in the following examples:

```swift
var name
//or
var age
```

Congratulations! You have declared a variable, but to give/store a value. Follow the last step.

The last thing we do is give them the value, like

```swift
var name = "Krishna"
var age = 18
```

Since the variable "name" is a String, you have to add a quotation mark. Also, we know that constants don't vary, but variables do. So, if you want to change the age to 72, it's easy to do that (not in real life).

```swift
age = 72
```

This time you don't write that keyword "var" again, write the variable name "age" or whatever you declared, and add the new value to it!

### What's next?

It's beautiful to start a journey but don't stop here, push yourself to learn other concepts. To understand the following concepts in order, you must be understanding the concept of [constants](https://www.swiftanytime.com/constants-in-swift/) next. Have a great time ahead!

Eat. Sleep. Swift Anytime. Repeat
#OPENSOURCE
Tags: php, phpcommunity, c4rl3, programming
Published: 2022-05-17 15:57:45

We are actually performing a chat app to Work on mobile device..
the iPhone version is under development and I do not hide from you that it promises

#PHP
#AGORA
#agoraio
#opensource 
#DEVCommunity
#c4rl3
https://t.co/RkzYW0MODV https://t.co/4aZFp68N3F
Routing Table Filtering
Tags: opensource, tutorial, microservices, luos
Published: 2022-05-17 15:53:34

What if you needed to select specific services from your network, based on their characteristics?

⏩ https://www.luos.io/docs/luos-technology/services/routing-table

We have what you need! Luos offers a routing table filtering method to access service information, such as alias, type, ID, physical location, etc.

Suddenly, your life just got a lot easier, didn't it?
What you need to be prepared for any job interview 🎙
Tags: codenewbie, podcast, career, interview
Published: 2022-05-17 15:38:05

Just want to give a heads up to the latest CodeNewbie Podcast episode.

### Listen on Apple Podcasts:

{% embed https://podcasts.apple.com/us/podcast/s20-e307-what-you-need-to-be-prepared-for-any-job-interview/id919219256?i=1000561546843 %}

### Listen on Spotify:

{% embed https://open.spotify.com/episode/0E0TRc2emvFksaAuYkyemn?si=2N1jpyawTzW65zWYJqouwQ %}

### [Or listen right here on DEV](https://dev.to/codenewbie/s20e307-what-you-need-to-be-prepared-for-any-job-interview-randall-kanna)

Make sure to subscribe to the CodeNewbie podcast if you have not yet!

Happy coding!
Test
Published: 2022-05-17 15:18:18

Just getting an idea about how this blog works.


```python
console.log('hello world');
```

```javascript
print('hello world');
```

` <p>Hello World<p> `

```HTML 
<p>Hello World<p>
```

```jsx
return(
console.log("Hello World")
)
```

> This is a quote

# Hello
## World
### hihihi

Regular **Bold** _Italic_

<p style="color: red;">Hello<p>
Python challenge_20🐍⚔️💪
Tags: python, beginners, programming, tutorial
Published: 2022-05-17 15:08:54

##Palindrome Number

- Given an integer x, return true if x is palindrome integer.
- An integer is a palindrome when it reads the same backward as 
  forward.
- For example, 121 is palindrome while 123 is not.

#### Example 1:
Input: x = 121
Output: true

#### Example 2:
Input: x = -121
Output: false


###Explanation: 
- From left to right, it reads -121.
- From right to left, it becomes 121-. 
- Therefore it is not a palindrome.

#####leetcode Task URL: https://bit.ly/3Prd3bK

###My Solution
```
def isPalindrome(x):
    pal_num = str(x)

    while len(pal_num) > 1:
        head = pal_num[0]
        tail = pal_num[-1]
        pal_num = pal_num[1:-1]

        if head != tail:
            return False

    return True
```

### Connect with Me 😊
- [LinkedIn](https://www.linkedin.com/in/mahmoud-el-kariouny-822719149/)
- [Twitter](https://twitter.com/Mahmoud42275)