Skip to content

Instantly share code, notes, and snippets.

param ([string]$pathToInsertableTemplate)
$msword = [System.Runtime.Interopservices.Marshal]::GetActiveObject("Word.Application")
$doc = $msword.ActiveDocument
$insertableTemplate = $msword.Documents.Open($pathToInsertableTemplate)
$insertableTemplate.Content.Copy()
$selection = $msword.Selection
$selection.Paste()
$insertableTemplate.Close([ref]$false)
[System.Runtime.Interopservices.Marshal]::ReleaseComObject($insertableTemplate) | Out-Null
[System.Runtime.Interopservices.Marshal]::ReleaseComObject($msword) | Out-Null
param (
[string]$findText,
[string]$replacewithText
)
$msword = [System.Runtime.Interopservices.Marshal]::GetActiveObject("Word.Application")
# https://learn.microsoft.com/ru-ru/office/vba/api/word.find.execute
$MatchCase = $false
$MatchWholeWord = $true
@eugrus
eugrus / WikiDataMovieByActors.sparql
Created March 30, 2024 18:13
Search for movies on WikiData by the actors who played in them.
SELECT ?film ?filmLabel
WHERE {
?actor1 rdfs:label "Jennifer Aniston"@en.
?actor2 rdfs:label "Adam Sandler"@en.
?film wdt:P161 ?actor1, ?actor2.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
@eugrus
eugrus / newdoc.sh
Created March 6, 2024 14:36
Create a new document in LibreOffice Writer, using an existing one as a template.
libreoffice --writer --infilter="writer8_template" $1
| xxd -p -c1 | awk '{printf "\\x%s", $1}'
~/.wine
~/.local/share/PortWINE/PortProton/data/prefixes
~/.steam/steam/steamapps/compatdata
~/.PlayOnLinux/wineprefix
~/Games (Lutris)
@eugrus
eugrus / gist:2fe726ff0ec1d52d07795fe7d5e55468
Created January 18, 2024 21:06
glxinfo output on ThinkPad T440p with GK208M (GeForce GT 730M, rev a1) running Debian 12
name of display: :1
display: :1 screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
GLX_ARB_context_flush_control, GLX_ARB_create_context,
GLX_ARB_create_context_no_error, GLX_ARB_create_context_profile,
GLX_ARB_create_context_robustness, GLX_ARB_fbconfig_float,
GLX_ARB_framebuffer_sRGB, GLX_ARB_multisample,
@eugrus
eugrus / gist:d348c36d1d462b5df1bebf9ab5ead3b3
Created January 18, 2024 20:24
vulkaninfo output on ThinkPad T440p with GK208M (GeForce GT 730M, rev a1) running Debian 12
==========
VULKANINFO
==========
Vulkan Instance Version: 1.3.239
Instance Extensions: count = 20
===============================
VK_EXT_acquire_drm_display : extension revision 1
@eugrus
eugrus / 40-libinput.conf
Created January 16, 2024 23:28
/etc/X11/xorg.conf.d/40-libinput.conf
Section "InputClass"
Identifier "libinput touchpad catchall"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
Option "Tapping" "on"
Option "MiddleEmulation" "true"
Option "DisableWhileTyping" "true"
EndSection