teleren/devto huggingface dataset:
Element Locator Strategy - Introduction and best practices
Tags: tutorial, testing, beginners
Published: 2020-08-04 17:30:44

This video is the first in a series on locator strategies.

It introduces you to types of locator strategies and importance of proper locator strategies as well as best practices to follow for testers and developers.

Locators are used by our tests to perform specific actions on a web page such as clicking on a link or button, getting the text of a header or entering some value into an input field.

{% youtube LB8GBc_NNTE %}
nMobile: the extra secure, sever-less and trusted chat app
Tags: security, privacy, messaging, snapchat
Published: 2020-08-04 17:20:13

“The decisions we make about communication security today will determine the kind of society we live in tomorrow.” by Whitfield Diffie. Launching nMobile 1.0, the extra secure, trusted and server-less chat app powered by blockchain tech.
https://blog.nkn.org/nmobile-the-trusted-chat/
PHP and Composer lovers, this if for you
Tags: php, security, devops, productivity
Published: 2020-08-04 17:14:59

We all know how it goes... our PHP Composer dependencies get out of date and we forget to update them, and that's not good if we want to keep shipping safe apps. I'd recommend using an automated dependency update bot: [Pmbot](https://pmbot.io).

All you need to do is to use our latest CLI v1.9.0 and use our `composer` plugin in your `.pmbot.yml`:

```yaml
version: '1'
packageManagers:
  - packageManager:
      name: composer
```

If you haven't done it yet, install Pmbot with Docker in a couple of minutes: instructions [here](https://docs.pmbot.io/core/installation).

Ruby/Gem lovers, stay tuned !

----
Official website: https://pmbot.io
Blog: https://blog.pmbot.io
Docs: https://docs.pmbot.io
I learnt to shuffle an array and an important lesson. 
Tags: algorithms, ds, developer
Published: 2020-08-04 17:14:28

😏All these years I have faced the constant problem of sorting an array of int, strings, by property value. 

😳I have never thought how can I shuffle this sorted array (even unsorted array).

I came across this problem while I was building a Duolingo style Math quiz app. I had to randomize the position of the correct answer in the _array_ of options. 

🤔 I pondered over writing some pseudo code for it, I knew it has to do with randomly selecting an index between the boundaries of the array.

😴 Yet as a _lazy_ engineer I googled for it immediately, to see how people do it. I came across [Fisher–Yates shuffle](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm) algorithm.

```
for i from n−1 downto 1 do
     j = random integer such that 0 ≤ j ≤ i
     exchange a[j] and a[i]
```

🤯 It was quite intriguing with its simplicity. I was able to shuffle my options array. 
But then I thought, 

> Would I have come up with similar algo. without google? I do not know but it would have taken some time

😇 I will not be able to solve all problems without taking help. But I should be comfortable to try and solve it, before getting answers from google. 

I had to practice on solving problems that make me uncomfortable.

🚩 I need to take on new challenges outside of my fulltime work(codewars, Leetcode, Freecodecamp, [#100daysofreact](https://twitter.com/hashtag/100DaysOfCode?))

> The experience of reinventing the wheel is different for every person

**The implementation**
```
shuffleOptions = (optionsArr) => {
        var m = optionsArr.length, t, i;
        while (m) {
            i = Math.floor(Math.random() * m--);
            t = optionsArr[m];
            optionsArr[m] = optionsArr[i];
            optionsArr[i] = t;
        }
        return optionsArr;
    }
```


Amazing visualization + complexity comparison [here](https://bost.ocks.org/mike/shuffle/).




*_Randomness mentioned here are pseudo randomness_*
How to maximise browser compatibility for rel value "preload"
Tags: lighthouse, preloading, firefox
Published: 2020-08-04 16:57:36

---
title: How to maximise browser compatibility for rel value "preload"
published: true
description: 
tags: lighthouse, preloading, Firefox
//cover_image: https://direct_url_to_image.jpg
---

When using Google Lighthouse to optimise the web performance, a common recommendation by Lighthouse would be to `preload key requests` by using `<link rel="preload">`. However, the rel value `preload` is not supported by some major browsers like Firefox.

To maximise the use of rel value `preload` for most major browsers and to provide a fallback method at the same time, the most commonly adopted approach seems to be to use both the default rel value and the rel value `preload` together. For instance, in loading css stylesheets, we can do something like `<link rel="preload stylesheet">`. This way, browsers that support preloading would preload as intended and browsers that do not would load the stylesheets the regular way. Further, only 1 request would be sent for the stylesheets when the page loads.

Credits to [Stack Overflow](https://stackoverflow.com/questions/45321043/preload-css-file-not-supported-on-firefox-and-safari-mac) for the nifty workaround!
Why is Python so popular?
Tags: python, machinelearning, datascience
Published: 2020-08-04 16:53:40

Why is Python so popular?

It’s one of the best languages when learning to code
If you're new to coding or you're hoping to get someone you know interested in coding, good on you! Secondly, consider making Python your language of choice. It's one of the easiest programming languages to learn, due to the fact that it reads and writes quite a bit like plain English.
In fact, there are many code clubs out in the world that you can join to help teach school kids how to code, and Python is one of the most common tools for this, at least in my experience. From little scripts and games to controlling LEDs and robots, there is a lot you can do to make learning fun. And if you're a kid at heart like me, you'll enjoy the projects as an adult too!

We also have an Introduction to Python course here at GoSkills, so make sure you check that out if you’re looking to get started.

Python is heavily used in the Internet of Things
With the rise of the Internet of Things - small low-power devices that are connected to the internet and can run any custom code - Python has risen to the top for a lot of the devices you can buy and tinker with. Devices like the Raspberry Pi are tiny and connect to a multitude of sensors, displays, lights, robots and more, and allow you to write code to communicate between these parts, as well as send and receive data over Bluetooth, the internet and other communication methods.
While not all of these devices support Python, a lot of them do; either a fully-featured version of Python or Micropython: a subset of Python for simpler devices, so you can still take advantage of the simplicity and productivity of Python without needing the full power it normally requires.
Reference : https://www.pythonslearning.com/2020/08/python-tutorials-point.html
ADD_MONTHS and TRUNC for calculating dates in Oracle PL/SQL
Tags: oracle, sql, plsql, trunc
Published: 2020-08-04 16:52:36

There are business use cases where dates have to be calculated based on certain cut off days. Especially this is important for account payables when invoices have to be paid based on certain criteria which involves cut off days configured for a specific vendor.

This can be achieved by using Oracle PL/SQL inbuilt date functions and by using them we can leverage the cut off days criteria to get the expected date values for paying the invoices.
In this article let’s look take a business use case for paying vendor on 10th of every month based on the invoice cutoff date.

Example: 
Invoice date = 7/25/2020 then Payment date has to be = 8/10/2020
Invoice date = 7/26/2020 then Payment date has to be = 9/10/2020

Here we are using the cut off days = 26 and months forward = 1. But that will not resolve the issue when the invoice is on the exact cutoff date.

Hence we will use Oracle PL/SQL inbuilt date function and resolve this date logic. We will use case function to determine the current day and then add the months using ADD_MONTHS. 
TRUNC (Date, ‘MM’) provides the 1st of the month and + 9 will give the 10th of the month.

**SQL Query:**

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/0tlnc25vvy3gldcs0qu8.png)

**Output:**

 ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/yuf54xdf51zng2ye6jmn.png)
My first React App
Published: 2020-08-04 16:49:54

<iframe src="https://player.vimeo.com/video/444606094" width="640" height="400" frameborder="0" allow="autoplay; fullscreen" allowfullscreen></iframe>
<p><a href="https://vimeo.com/444606094">Project2v1</a> from <a href="https://vimeo.com/user120810422">Pamela Gilmour</a> on <a href="https://vimeo.com">Vimeo</a>.</p>

https://virtualcharms-horoscope.herokuapp.com/

What is it?

I am venturing into tech from holistic health and part of my job is to be knowledgeable of any healing modality that I come across. Astrology is a vast and deep field with a rich history. People for millennia have accessed astrology as well as countless other divination methods to improve their lives, enhance their luck and find love. Most of the astrologers I personally follow, their work is influenced by psychology at some level (usually either professional or academically). Today, astrology is becoming more and more prominent in pop-culture, no longer confined to one page at the back of a newspaper or magazine. I am seeing more and more horoscope apps and I love them all. It’s exciting for me to see these traditionally and inherently esoteric institutions merging with technology AND this is the very crux of my own creative work.  

So as I was preparing for my second project, creating a React app that accesses an API, I went searching for an API that resonated with me. I found this delightful horoscope API (http://ohmanda.com/api/horoscope/) in a google search, and got to coding my app.

My Process:

This was my second project so I incorporated my time-management lessons from my last project and first, actually looked at what my deadline was before I got emotionally invested. I created my own deadlines accordingly and wrote up a simple MVP that I thought would be achievable in the timeframe given.

Features:

My app is a simple horoscope app: It has a welcome greeting, a header so you know what you are looking at and a list of the zodiac signs in a colorful card-like layout, with an image and range of birthdates for each sign accordingly. So, in order to read your horoscope, you just click on the card of your Sun sign and VOILA! You get a horoscope message from the horoscope API! How cute!

Lessons Learned:

I was able to incorporate some basic CSS grid, with which I tried out several different layouts. I decided with a list format because it was the least awkward experience.

With my first pass of code, I made a component for each zodiac sign, but decided that was not the best use of React and so went back and refactored my code to be simpler and more dynamic. CLEAN & DRY!

Stretch Goals:
Now that I have the beginnings of a hip, bright, and colorful horoscope app, on a free weekend in the future, I will be replacing the images with those that I will have illustrated myself (https://virtualcharms.github.io/fortune-click/), optimizing load speed, thinking up more features to make the page more interactive and informative and maybe even playing with the layout more.
انشاء متجر الكتروني
Published: 2020-08-04 16:36:51

سطورإنو المنصة الجديدة لإنشاء المواقع الاكترونية باحترافية , جرب مجانا انشاء متجر الكتروني عربي احترافي ,يمكنك انشاء متجر الكتروني في أقل من 5 دقائق
https://www.storeino.com
What are CTF’s and why you should play CTF’s?
Tags: ctf, ethicalhacking, cybersecurity
Published: 2023-03-10 05:47:26

---
title: What are CTF’s and why you should play CTF’s?
published: true
date: 2020-08-04 16:35:25 UTC
tags: ctf,ethicalhacking,cybersecurity
canonical_url: 
---

![](https://cdn-images-1.medium.com/max/768/1*Pzc5BWfqJ6ym7rH5a6xf-g.jpeg)

CTF or Capture the Flags, probably you have not heard of it and there is nothing bad in it and its because CTF’s are quite underrated. So the question is what is CTF and why you should get started with CTF if you want to start your career in cyber security.

This blog is going to be short and I will get straight into the point . CTF or Capture the Flags are challenges based on cyber security and ethical hacking. There are several reasons why CTF’s are helpful. One of the reason is that there are a number of domains within cyber security itself like digital forensics , cryptography , web application hacking , binary exploitation and many more and its not possible for one to master everything. CTF helps us to find the domain in which we are interested.

CTF’s may be underrated but these are very helpful in increasing one’s knowledge regarding cyber security. Besides these CTF competitions are even organised internationally also like the Google CTF, DEFCON, CSAW etc.

So a question may arise that will playing CTF make one a professional in cyber security ? And the answer is that it depends on your experience. Initially if you have never played any CTF you won’t be able to solve any . You need to the study the write ups that are available and understand the approach that others are using and eventually you will be creating your own write ups one day. It requires time and experience in cyber security and playing CTF is a bonus for you.

Are there any prerequisites ? I would not say that no there are no prerequisites, ofcourse you need to have some basic knowledge of hacking and programming. You need to know how to perform a RCE or a SQLI or a XSS , you need to know about cryptography , about the ciphers and even about computer networking . Many are depend on automated tools like sqlmap and yes they help a lot but you need to know the backend process of all these things.

![](https://cdn-images-1.medium.com/max/678/1*5EjbLo4gTSFAcy4zrBpvzw.jpeg)

So the final question is from where we can play CTF? There are a lots of sites which host CTF challenges such as HackTheBox , OverTheWire , TryHackMe , Hackerone etc .
showDEV - A place to share personal and open-source coding projects!
Tags: react, node, postgres, showdev
Published: 2020-08-04 16:29:33

Hey, devs! 👋🏻

Hope everyone is doing safe!

I decided to 1)learn more about relational databases, 2) improve my React knowledge, and 3) buy a domain and study more about DNS, etc... So, my idea was to create something like https://www.uplabs.com/ or https://dribbble.com/, for developers in order to apply all of that! 😬

It took me 3 weeks and it is still far from what I imagined for the v1, but I really would appreciate you guys giving a try and sending all your great feedback.

**Demo:**
https://showdev.live/

**Stack:**
React, Node (Express), PostgreSQL, TailwindCSS, Heroku, Cloudinary

**Features:**
- OAuth with Github (only way at the moment)
- Create and View projects
- Upload Images (JPEG, PNG, GIF)
- Vote
- Comments
- Filters

**Plan for v2:**

[Users]
.Edit and Delete projects
.Delete comments made
.Accept Videos
.Infinite-scroll
.PWA
.Favorites Projects

[Development]
.Tests
.Docker

Thank you!
What is a javascript engine?
Tags: javascript
Published: 2020-08-04 16:25:12


#Javascript Engine
> A JavaScript engine is a computer program that executes JavaScript (JS) code. A JavaScript engine can be implemented as a standard interpreter, or just-in-time compiler that compiles JavaScript to bytecode in some form.

In a browser, the JavaScript engine runs in concert with the rendering engine via the Document Object Model.

# List of popular projects that are implementing a JavaScript engine:

* V8: open source, developed by Google, written in C++. Google Chrome and the many other Chromium-based browsers use it.
* SpiderMonkey: developed by Mozilla for use in Firefox and its forks.
* JavaScriptCore is Apple's engine for its Safari browser.
* Chakra (JScript9): Internet Explorer.
* Chakra (JavaScript): Microsoft Edge.

<< **Next blog i will explain about to v8 engine.** >>
 
Referances:
https://en.wikipedia.org/wiki/JavaScript_engine
HELP HTACCESS
Tags: htaccess
Published: 2020-08-04 16:22:36

---
title: HELP HTACCESS
published: true
description: 
tags: htaccess
//cover_image: https://direct_url_to_image.jpg
---
Mine is a question.
I have a redirect from, (example.com/users?user='username')
I have redirected this to (example.com/username)
How I am also trying to redirect (example.com/members/settings) to (example.com/settings), the redirect seems to work, except that, its opening the page of (example.com/username).

Here is my code.

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]*)$ users/index.php?id=$1 [L]
RewriteEngine on
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^example.com/members/settings$ http://example.com/settings/ [R=301,L]

How can i make (example.com/settings) to open its own page?
🎤Microsoft Technology Associate Certification Practice Questions 🏆
Tags: tutorial, javascript, computerscience, webdev
Published: 2020-08-04 16:15:29

### Hi, I myself am MTA Certified 98-382
### If you are giving this exam, you must enroll in the course below -

https://www.udemy.com/course/mta-98-382/?couponCode=ANANTMTA360
🏆
### This link will give you a discounted price. 
### MTA Certification has lot of value, which is given by **Microsoft**🏆

### I would say give it a try. Course price have took very nominal and is at discounted rate now!!!

## Think about it. 🔥🔥
I have specially created this course to ease your work and for you to achieve and clear the certification test.

# COMMENT AND IF THIS POST REACHES MORE THAN 5000 VIEWS, I'll GIVEAWAY 10 of these COURSES FOR **FREE**!!!
VueJS Quick Tip: Vue-router-next in the Composition API
Tags: vue, javascript
Published: 2020-08-04 16:07:50

The new version of Vue Router is almost ready.  Here's how to access the route and router within the Composition API's setup function.

Make sure to call them before any await calls, or they might not work right!

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/rtit99mlz4d7vc67vimp.jpg)
Postgres \set variable
Tags: postgres, vim
Published: 2020-08-04 15:57:02

Within `psql`, you can `\set` variables and reference them with `:'var-name'`. For example:

```sql
\set query '%SaaS%'

SELECT
  'https://example.com/companies/' || companies.id AS url,
  companies.name
FROM
  companies
  JOIN notes ON notes.company_id = companies.id
WHERE
  companies.name ILIKE :'query'
  OR companies.description ILIKE :'query'
  OR notes.comments ILIKE :'query'
GROUP BY
  url,
  companies.name
ORDER BY
  companies.name ASC;
```

I like to [run scripts from Vim through `psql` with this config](https://dev.to/croaky/format-sql-on-save-run-sql-with-leader-r-296d).
SSH Key with Ed25519
Tags: unix, macos, ssh
Published: 2020-08-04 15:55:28

With my last team, at the request of [Ryan](https://r.32k.io/), our CTO, I stopped using RSA for my public keys and started using Ed25519.

Ed25519 uses elliptic curve cryptography with good security and performance. That's the real reason to use it.

My favorite thing, though, is when the whole team uses Ed25519, a server's `~/.ssh/authorized_keys` file looks 😍:

```
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIAePksB5aPc6sww+RMzJwpVuDhRAgzOKP1Q/o3suIbw alice@home.local
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEB/O/VwAvqWIV/EN9aHjHAg/9JYsX/Ce2yvr5wPI3gZ bob@work.local
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAYG1rgF4YSSBwtinbhFLR/Qeah11jYcQpf6lX4yql60 carol@home.local
```

Create the key:

```
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -C "$(whoami)@$(hostname)"
```

Start the SSH agent:

```
eval "$(ssh-agent -s)"
```

Update `~/.ssh/config`:

```
Host *
  AddKeysToAgent yes
  UseKeychain yes
  IdentityFile ~/.ssh/id_ed25519

Host github.com
  Hostname ssh.github.com
  Port 443
```

Add the private key to the SSH agent on macOS:

```
ssh-add -K ~/.ssh/id_ed25519
```
Convert Unicode strings to ASCII with ColdFusion & JUnidecode
Tags: coldfusion, cfml, unicode, utf8
Published: 2020-08-04 15:54:11

I’ve struggled for years attempting to identify the best solution for converting unicode accents and other characters using ColdFusion.  I’ve used [regex](https://www.bennadel.com/blog/1155-cleaning-high-ascii-values-for-web-safeness-in-coldfusion.htm), [java.text.Normalizer](https://cflib.org/udf/deAccent), [ICU4J Transliterate](https://gist.github.com/JamoCA/ec4617b066fc4bb601f620bc93bacb57) and [Apache.Lang3.StringUtils.StripAccents](https://www.codota.com/code/java/methods/org.apache.commons.lang3.StringUtils/stripAccents) and recently scrapped them all in favor of using [JUnidecode](https://github.com/gcardone/junidecode).  JUnidecode is a Java port of [Text::Unidecode](https://metacpan.org/pod/release/SBURKE/Text-Unidecode-0.04/lib/Text/Unidecode.pm) perl module.  The JUnidecode Java library only has one method and it takes a string and transliterates it to a valid 7-bit ASCII String (obviously it also strips diacritic marks).

Examples:
- Москвa becomes Moskva.
- čeština becomes cestina.
- Հայաստան becomes Hayastan.
- Ελληνικά becomes Ellenika.
- 北亰 becomes Bei Jing
- Häuser Bäume Höfe Gärten becomes Hauser Baume Hofe Garten
- daß becomes dass

**WARNING:** Please be aware that Junidecode doesn't like emojis. You may need to sanitize (or convert to aliases) using [cf-emoji-java](https://github.com/JamoCA/cf-emoji-java) prior to using converting to ASCII7.

Here's a demo script I've written that has some generic test cases:
[https://gist.github.com/JamoCA/6565bd4e2526b7c177a5f0cde3980d1c](https://gist.github.com/JamoCA/6565bd4e2526b7c177a5f0cde3980d1c)

{% gist https://gist.github.com/JamoCA/6565bd4e2526b7c177a5f0cde3980d1c %}
Use Cases: Tire Sizes API
Tags: api, javascript, vehicles, carsxeusecase
Published: 2020-08-04 15:48:53

The general rule of thumb is that tires can last anywhere between 25,000 to 50,000 miles before they need to be replaced.<sup>[1](https://www.actiongatortire.com/often-change-tires/#:~:text=Mileage,that%20come%20with%20your%20car.)</sup> That means that going into year 2 most car owners start thinking about getting new tires. 

Tire companies that have worked with CarsXE API have increased their conversions by over 30% because they provided a quick and easy solution for their customers with the least amount of friction.

As customers look online and locally for good deals tire shops need to quickly figure out what vehicle the user is driving so they can find all the options that fit that car. The provider that offers the least friction to the customer is likely to capture that buyer.

#### Here's the problem:
Most customers **don't** know what's the make, model, year \& trim of the vehicle they drive.

#### Answer:
Most customers **do** know their license plate number *or* can figure out where to find the VIN (Vehicle Identification Number).

[CarsXE API](api.carsxe.com) provides all sorts of vehicle data through its API. One of the largest use cases of the [Vehicle Specifications API](https://api.carsxe.com/vehicle-specifications) is tire companies that would like to access the specific tire size of a vehicle from a VIN. 

Companies also use our [Vehicle Plate Decoder](https://api.carsxe.com/vehicle-plate-decoder) to get the VIN from a license plate which could then be used to get the tire size. 

Let's see it in action.

### Step 1
Ask the customer for a license plate number & state. (You could also use the [Vehicle Plate Image Recognition](https://api.carsxe.com/vehicle-plate-recognition) to extract the license plate number from an image.)

### Step 2
Get vehicle data from the license plate. More on that here:
{% link https://dev.to/carsxe/decoding-a-vehicle-license-plate-with-an-api-2ba9 %}

### Step 3
Get tire size from VIN extracted. More on that here:
{% post https://dev.to/carsxe/get-vehicle-specifications-using-an-api-32e8 %}

### Step 4
Congrats! From a license plate, we were able to find the tire size of the vehicle attached to the plate.

This process gives the user less friction and allows them to know their tire size. As you can see we could also expand this power beyond tire sizes as the Vehicle Specifications API provides many useful nuggets of information on the vehicle.