-
-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dostonnabotov:main' into main
- Loading branch information
Showing
13 changed files
with
238 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
[ | ||
{ | ||
"categoryName": "Miscellaneous", | ||
"snippets": [ | ||
{ | ||
"title": "Hexadecimal Color", | ||
"description": "Matches hex color codes", | ||
"author": "majvax", | ||
"tags": [ | ||
"color", | ||
"hexadecimal" | ||
], | ||
"contributors": [], | ||
"code": "^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$\n\n\n-> Usage:\n#FFF1 ✗\n#FFF ✓\n#FFF000 ✓\n" | ||
}, | ||
{ | ||
"title": "IPv4", | ||
"description": "Matches IPv4 address", | ||
"author": "majvax", | ||
"tags": [ | ||
"ipv4", | ||
"networking" | ||
], | ||
"contributors": [], | ||
"code": "^((25[0-5]|2[0-4]\\d|1\\d{2}|\\d{1,2})\\.){3}(25[0-5]|2[0-4]\\d|1\\d{2}|\\d{1,2})$\n\n\n-> Usage:\n123.300.0.101 ✗\n127.0.0.1 ✓\n192.168.0.1 ✓\n" | ||
}, | ||
{ | ||
"title": "Unintentional Duplication", | ||
"description": "Matches duplicated word in a text.", | ||
"author": "majvax", | ||
"tags": [ | ||
"duplication" | ||
], | ||
"contributors": [], | ||
"code": "\\b(\\w+)\\s+\\1\\b\n\n\n-> Usage:\nI need to finish this task ✗\nI need to to finish this task ✓\n" | ||
}, | ||
{ | ||
"title": "Whitespace Trimmer", | ||
"description": "Matches leading and/or trailing whitespace.", | ||
"author": "majvax", | ||
"tags": [ | ||
"trim" | ||
], | ||
"contributors": [], | ||
"code": "^\\s+|\\s+$\n\n\n-> Usage:\n(don't account for the quotation marks, it just to visualize whitespace)\n\"Hello World\" ✗\n\" Hello World\" ✓\n\"Hello World \" ✓\n\" Hello World \" ✓\n" | ||
} | ||
] | ||
}, | ||
{ | ||
"categoryName": "Validation pattern", | ||
"snippets": [ | ||
{ | ||
"title": "Email Address", | ||
"description": "Match any email address", | ||
"author": "majvax", | ||
"tags": [ | ||
"email" | ||
], | ||
"contributors": [], | ||
"code": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$\n\n-> Usage:\n[email protected] ✓\n[email protected] ✓\n" | ||
}, | ||
{ | ||
"title": "Strong Password", | ||
"description": "Match password with at least 12 characters, one uppercased letter, one number, and one special character.", | ||
"author": "majvax", | ||
"tags": [ | ||
"password" | ||
], | ||
"contributors": [], | ||
"code": "^(?=.*[A-Z])(?=.*[a-z])(?=.*\\d)(?=.*[@$!%*?&])[A-Za-z\\d@$!%*?&]{12,}$\n\n-> Usage:\nlongpassword ✗\nlongpassw0rd ✗\nlongp@ssw0rd ✗\nLongp@ssw0rd ✓\n" | ||
} | ||
] | ||
} | ||
] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
title: Swap numbers | ||
description: Swaps two numbers without using third variable | ||
author: Emosans | ||
tags: swap,numbers | ||
--- | ||
|
||
```c | ||
#include<stdio.h> | ||
void swap(int* num1,int* num2){ | ||
*num1 = *num1 + *num2; | ||
*num2 = *num1 - *num2; | ||
*num1 = *num1 - *num2; | ||
} | ||
|
||
// Usage: | ||
int a = 3,b = 4; | ||
swap(&a,&b); // swaps the values of the a and b variables | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
Title: Hexadecimal Color | ||
Description: Matches hex color codes | ||
Author: majvax | ||
Tags: color,hexadecimal | ||
--- | ||
|
||
|
||
```regex | ||
^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$ | ||
-> Usage: | ||
#FFF1 ✗ | ||
#FFF ✓ | ||
#FFF000 ✓ | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
Title: IPv4 | ||
Description: Matches IPv4 address | ||
Author: majvax | ||
Tags: ipv4,networking | ||
--- | ||
|
||
|
||
```regex | ||
^((25[0-5]|2[0-4]\d|1\d{2}|\d{1,2})\.){3}(25[0-5]|2[0-4]\d|1\d{2}|\d{1,2})$ | ||
-> Usage: | ||
123.300.0.101 ✗ | ||
127.0.0.1 ✓ | ||
192.168.0.1 ✓ | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
Title: Unintentional Duplication | ||
Description: Matches duplicated word in a text. | ||
Author: majvax | ||
Tags: duplication | ||
--- | ||
|
||
|
||
```regex | ||
\b(\w+)\s+\1\b | ||
-> Usage: | ||
I need to finish this task ✗ | ||
I need to to finish this task ✓ | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
Title: Whitespace Trimmer | ||
Description: Matches leading and/or trailing whitespace. | ||
Author: majvax | ||
Tags: trim | ||
--- | ||
|
||
|
||
```regex | ||
^\s+|\s+$ | ||
-> Usage: | ||
(don't account for the quotation marks, it just to visualize whitespace) | ||
"Hello World" ✗ | ||
" Hello World" ✓ | ||
"Hello World " ✓ | ||
" Hello World " ✓ | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
Title: Email Address | ||
Description: Match any email address | ||
Author: majvax | ||
Tags: email | ||
--- | ||
|
||
|
||
```regex | ||
^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ | ||
-> Usage: | ||
[email protected] ✓ | ||
[email protected] ✓ | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
Title: Strong Password | ||
Description: Match password with at least 12 characters, one uppercased letter, one number, and one special character. | ||
Author: majvax | ||
Tags: password | ||
--- | ||
|
||
|
||
```regex | ||
^(?=.*[A-Z])(?=.*[a-z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{12,}$ | ||
-> Usage: | ||
longpassword ✗ | ||
longpassw0rd ✗ | ||
longp@ssw0rd ✗ | ||
Longp@ssw0rd ✓ | ||
``` |