Skip to content

Instantly share code, notes, and snippets.

View OlegKorn's full-sized avatar
💭
SEEK FOR A JUNIOR QA JOB

O OlegKorn

💭
SEEK FOR A JUNIOR QA JOB
View GitHub Profile
re.findall(r'[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z]+', s)
import requests
proxies = {"http": "socks5://localhost:9050", "https": "socks5://localhost:9050"}
r = requests.get("http://ifconfig.me", proxies=proxies)
print(r.text)
@OlegKorn
OlegKorn / useful_python_snippets.py
Created August 20, 2021 03:49 — forked from fomightez/useful_python_snippets.py
Useful Python snippets
# These are meant to work in both Python 2 and 3, except where noted.
# See my useful_pandas_snippets.py for those related to dataframes (such as pickling/`df.to_pickle(save_as)`)
# https://gist.github.com/fomightez/ef57387b5d23106fabd4e02dab6819b4
# also see https://gist.github.com/fomightez/324b7446dc08e56c83fa2d7af2b89a33 for examples of my
# frequently used Python functions and slight variations for more expanded, modular structures.
#argparse
# good snippet collection at https://mkaz.tech/code/python-argparse-cookbook/
@OlegKorn
OlegKorn / Python re findall websites
Created August 31, 2021 02:34
Python re findall websites
a = '''<a href="dfsdfdsfd" target="_blank" class="_1rehek">
сайт-сайт.рф</a>
</a>ваываыва4333.РФ
<div>www.dekorm.com</div>
https://wewefds.net
http://dsdfsdfs.org
www.fsdsdfsd.РФ
сайт.тест
сайт.домен
'''
@OlegKorn
OlegKorn / gist:9453e7b6afd70f68038cea2108a3fbab
Last active September 23, 2022 02:08
cyfor: Reports-Отгрузка на экспорт - число значений "№ декларации"
numDeclClass = "first b-list__table-col_name_name_gtd"
for (i=0; i<classes.length; i++) {
declNum = classes[i].textContent.trim()
console.log(declNum)
}
console.log("num of № декларации is: ", classes.length)
@OlegKorn
OlegKorn / intToRoman.js
Last active October 7, 2022 04:29
leetcode - intToRoman.js
/*
author Oleg Kornilov
kornilovoy@gmail.com, https://github.com/OlegKorn
*/
var intToRoman = function(num) {
var equivalents = {
1: "I",
4: "IV",
@OlegKorn
OlegKorn / jsFindValueByKeyInDict.js
Last active October 7, 2022 04:37
JS: finding a value by a key in dictionary
function isThereEquivalent(equivalentsArr, value) {
try {
var equivalent = Object.entries(equivalentsArr).find(([key]) => key === value.toString())[1]
return equivalent
}
catch (e) {
if (e instanceof TypeError) {
return false
}
@OlegKorn
OlegKorn / bubbleSort.js
Created October 10, 2022 06:17
bubble sort JS
function bubbleSort() {
a = [33, 2, 3345, 34456456, 3, 3434, 41, 314, 34, 34445]
for (var i = 0; i < a.length; i++) {
var swapped = false
for (var j = 0; j < a.length - 1; j++) {
if (a[j] > a[j+1]) {
@OlegKorn
OlegKorn / twoSum.js
Created October 11, 2022 04:53
leetcode twoSum
// https://leetcode.com/problems/two-sum/
/*
author Oleg Kornilov
kornilovoy@gmail.com
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
@OlegKorn
OlegKorn / palindrom.js
Created October 12, 2022 07:07
leetcode - Palindrom.js
/*
author Oleg Kornilov
kornilovoy@gmail.com
github.com/OlegKorn
https://leetcode.com/problems/palindrome-number/solution/
*/
var isPalindrome = function(x) {
x = x.toString()