const commonOpt = {
key: 'val',
key1: 'val1'
}
const unitedOpt = {
...commonOpt,
key: 'lav'
}
const commonOpt = {
key: 'val',
key1: 'val1'
}
const unitedOpt = Object.assign(commonOpt, { key: 'lav' })
import requests
import time
import hashlib
import nacl.signing
import nacl.encoding
public_key = 'your_public_key_here'
secret_key = 'your_secret_key_here'
http_method = "POST"
route_path = "/get-item"
query_params = "Amount=%220.25%22&Limit=%22100%22&Offset=%22150%22&Order=%22desc%22"
body_string = ""
timestamp = str(int(time.time()))
non_signed_string = f"{http_method}{route_path}?{query_params}{body_string}{timestamp}"
signing_key = nacl.signing.SigningKey(secret_key, encoder=nacl.encoding.HexEncoder)
signed = signing_key.sign(non_signed_string.encode())
signature_hex = signed.signature.hex()
headers = {
'X-Api-Key': public_key,
'X-Sign-Date': timestamp,
'X-Request-Sign': signature_hex,
'Content-Type': 'application/json'
}
url = f"https://api.dmarket.com{route_path}?{query_params}"
response = requests.post(url, headers=headers, json={})
print(f"Status Code: {response.status_code}")
print(f"Response: {response.json()}")
.swiper-horizontal>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic, .swiper-pagination-horizontal.swiper-pagination-bullets.swiper-pagination-bullets-dynamic {
left: 50%;
transform: translateX(-50%);
white-space: nowrap;
}
.swiper-pagination-bullets {
left: 0 !important;
transform: translateX(0) !important;
}
const childElement = document.getElementById('child'); // находим потомка
const parentElement = childElement.parentNode; // находим родителя
// Создаем новый элемент
const newElement = document.createElement('p');
newElement.textContent = 'Новый элемент';
// Заменяем старый элемент на новый
parentElement.replaceChild(newElement, childElement);
const oldElement = document.getElementById('old');
// Создаем новый элемент
const newElement = document.createElement('div');
newElement.textContent = 'Новый элемент';
// Заменяем старый элемент новым
oldElement.replaceWith(newElement);
const oldElement = document.getElementById('old');
oldElement.replaceWith(document.createRange().createContextualFragment(`
<div class="box box2">
<p1>hello world</p1>
</div>
`));
... {
opacity: 0;
scale: 0
}
const queryString =
"room_number[]=2&room_number[]=3&room_number[]=4&price_min=111&price_max=999&area[]=Ленинский район"
function convertQueryString(query) {
const result = []
const pairs = query.split("&")
pairs.forEach((pair) => {
const [name, value] = pair.split("=")
const cleanName = name.replace(/\[\]/g, "")
result.push({
name: cleanName,
value: decodeURIComponent(value),
})
})
return result
}
const output = convertQueryString(queryString)
console.log(output)
const queryString = "room_number[]=2&room_number[]=3&room_number[]=4&price_min=111&price_max=999&area[]=Ленинский район";
const output = queryString.split('&').map(pair => {
const [name, value] = pair.split('=')
return {
name: name.replace(/\[\]/g, ''),
value: decodeURIComponent(value),
}
})
console.log(output)
function scrollToElementWithOffset(element, offset = 0, behavior = 'smooth') {
const elementTopPosition = element.getBoundingClientRect().top
const offsetPosition = elementTopPosition + window.pageYOffset - offset
window.scrollTo({
top: offsetPosition,
behavior,
})
}
const targetElement = document.querySelector('#myElement');
scrollToElementWithOffset(targetElement, 100)
*:lang(en-US) {
outline: 2px solid deeppink;
}
*:lang(ru) {
color: red;
}
pip install pandas openpyxl
import pandas as pd
import os
def parse_excel(file_path):
# Read the Excel file
df = pd.read_excel(file_path, header=None)
# Loop through each row in the DataFrame
for index, row in df.iterrows():
name = row[0]
link = row[1]
# Extract the file extension from the link
file_extension = os.path.splitext(link)[1] # Get the extension, e.g., .jpg
# Form the new filename
new_filename = f"{name}{file_extension}"
# Output the new filename
print(new_filename)
# Example usage
parse_excel("test.xlsx")