This file contains hidden or 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
re.findall(r'[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z]+', s) |
This file contains hidden or 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
import requests | |
proxies = {"http": "socks5://localhost:9050", "https": "socks5://localhost:9050"} | |
r = requests.get("http://ifconfig.me", proxies=proxies) | |
print(r.text) |
This file contains hidden or 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
# 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/ |
This file contains hidden or 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
a = '''<a href="dfsdfdsfd" target="_blank" class="_1rehek"> | |
сайт-сайт.рф</a> | |
</a>ваываыва4333.РФ | |
<div>www.dekorm.com</div> | |
https://wewefds.net | |
http://dsdfsdfs.org | |
www.fsdsdfsd.РФ | |
сайт.тест | |
сайт.домен | |
''' |
This file contains hidden or 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
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) |
This file contains hidden or 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
/* | |
author Oleg Kornilov | |
[email protected], https://github.com/OlegKorn | |
*/ | |
var intToRoman = function(num) { | |
var equivalents = { | |
1: "I", | |
4: "IV", |
This file contains hidden or 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
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 | |
} |
This file contains hidden or 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
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]) { |
This file contains hidden or 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
// https://leetcode.com/problems/two-sum/ | |
/* | |
author Oleg Kornilov | |
[email protected] | |
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 |
This file contains hidden or 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
/* | |
author Oleg Kornilov | |
[email protected] | |
github.com/OlegKorn | |
https://leetcode.com/problems/palindrome-number/solution/ | |
*/ | |
var isPalindrome = function(x) { | |
x = x.toString() |
OlderNewer