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([Parameter(Mandatory=$true)][string]$InputFile) | |
if (-not (Test-Path $InputFile)) { Write-Error "No '$InputFile'"; exit 1 } | |
ffmpeg -i "$InputFile" -vn -b:a 64k $("$( [System.IO.Path]::ChangeExtension($InputFile, '.mp3') )") |
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]$Pattern, | |
[string]$Path | |
) | |
if (-not (Test-Path $Path)) { | |
Write-Error "File '$Path' not found." | |
exit 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
gc $env:USERPROFILE\.ssh\id_ed25519.pub | ssh $args[0] "cat >> .ssh/authorized_keys" |
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]$Query | |
) | |
$apiKey = "" # https://console.cloud.google.com/apis/credentials | |
$cseId = "" # https://programmablesearchengine.google.com/ | |
$results = @() | |
$encodedQuery = [System.Uri]::EscapeDataString($Query) |
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
#Requires -Version 5.1 | |
<# | |
.SYNOPSIS | |
Копирует все стили из одного документа Word в другой. | |
.DESCRIPTION | |
Этот скрипт открывает два документа Word: документ-донор и целевой документ. | |
Затем он копирует все стили из донора в целевой документ, перезаписывая существующие стили с теми же именами. | |
Для работы скрипта требуется, чтобы на компьютере был установлен Microsoft Word. | |
.PARAMETER SourcePath | |
Обязательный. Укажите путь к документу Word, из которого нужно скопировать стили (донор). |
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 = [Runtime.Interopservices.Marshal]::GetActiveObject("Word.Application") | |
$doc = $word.ActiveDocument | |
if ($doc) { | |
# Clear highlights & shading | |
foreach ($r in $doc.StoryRanges) { | |
do { | |
$r.HighlightColorIndex = [Microsoft.Office.Interop.Word.WdColorIndex]::wdNoHighlight | |
$r.Shading.BackgroundPatternColor = [Microsoft.Office.Interop.Word.WdColor]::wdColorAutomatic | |
$r = $r.NextStoryRange | |
} while ($r) |
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
Add-Type -AssemblyName System.Windows.Forms | |
[System.Windows.Forms.Screen]::PrimaryScreen.Bounds |
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
from PIL import Image | |
import pytesseract | |
import sys | |
if len(sys.argv) < 2: | |
sys.exit(1) | |
image_path = sys.argv[1] | |
image = Image.open(image_path) | |
text = pytesseract.image_to_string(image, lang="deu") |
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 KillHeadLessWord { | |
$sessionId = [System.Diagnostics.Process]::GetCurrentProcess().SessionId | |
Get-Process -Name WINWORD -ErrorAction SilentlyContinue | | |
Where-Object { $_.MainWindowHandle -eq 0 -and $_.SessionId -eq $sessionId } | | |
Stop-Process -Force | |
} | |
function ProgressWindow { | |
Add-Type -AssemblyName System.Windows.Forms | |
$form = New-Object System.Windows.Forms.Form |
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 pandas as pd | |
pd.read_excel('PH.xlsx').to_json('PH.json', orient='records', indent=4, force_ascii=False) |
NewerOlder