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
#!/usr/bin/python3 | |
import json | |
import sys | |
def format_json(input_file): | |
try: | |
with open(input_file, 'r', encoding='utf-8') as file: | |
# Загружаем содержимое файла как JSON | |
data = json.load(file) |
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
#!/usr/bin/python3 | |
import sys | |
import json | |
import csv | |
# Функция для рекурсивного обхода JSON-структуры и извлечения значений тега "nm" | |
def extract_nm_values(data, level=0): | |
nm_values = [] # Создаем список для хранения значений тега "nm" |
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
#include <iostream> | |
#include <string> | |
class Fruit { | |
private: | |
std::string name; | |
std::string colour; | |
public: | |
Fruit(std::string name, std::string clr) : name(name), colour(clr) {} |
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
#!/bin/bash | |
echo "Content-Type: text/plain; charset=utf-8" && echo | |
IFS='?' read -ra url_parts <<< "$REQUEST_URI" | |
# Extract the query string from the URL | |
query_string="${url_parts[1]}" | |
# URL-decode the query string |
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
Option Explicit | |
Dim myKey | |
' https://learn.microsoft.com/en-us/office/vba/api/word.keybindings.add | |
Private Sub Document_New() | |
KeyBindings_AddKey | |
End Sub | |
Private Sub Document_Open() | |
KeyBindings_AddKey |
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
# Получение доступа к запущенному экземпляру Word | |
$word = [System.Runtime.Interopservices.Marshal]::GetActiveObject("Word.Application") | |
# Вставка текста "Hello, world!" в текущую позицию курсора | |
$word.Selection.TypeText("Hello, world!") |
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
Get-Process | Where-Object { $_.ProcessName -eq "WINWORD.EXE" } | ForEach-Object { Stop-Process -Id $_.Id -Force } |
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
# Set error reporting | |
Set-StrictMode -Version latest | |
# Check if the required arguments are provided | |
if ($args.Count -ne 2) { | |
Write-Host "Usage: searchindocs.ps1 <SearchedString> <SearchPath>" |
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
param( | |
[string]$path = "." | |
) | |
function Get-FolderStructure { | |
param( | |
[string]$folderPath | |
) | |
$folders = Get-ChildItem -Path $folderPath -Directory |
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
while ! rsync --partial --progress -av -e ssh user@server:"/remotepath" '/localpath'; do sleep 5; done |