Skip to content

Instantly share code, notes, and snippets.

@anuvyklack
anuvyklack / Windows10-Setup.ps1
Created May 31, 2020 09:17 — forked from NickCraver/Windows10-Setup.ps1
(In Progress) PowerShell Script I use to customize my machines in the same way for privacy, search, UI, etc.
##################
# Privacy Settings
##################
# Privacy: Let apps use my advertising ID: Disable
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 0
# To Restore:
#Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 1
# Privacy: SmartScreen Filter for Store Apps: Disable
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost -Name EnableWebContentEvaluation -Type DWord -Value 0
@anuvyklack
anuvyklack / Misc.md
Last active September 14, 2021 20:33
[Bash scripts]

Check if package is installed and install otherwize

if ! dpkg-query -W -f='${Status}' $package | grep "ok installed";
then
    apt install $package;
fi

Make zsh primery shell

@anuvyklack
anuvyklack / Misc.md
Last active September 15, 2019 04:26
[Python]
>>> name="Василий"
>>> f'{name}'
'Василий'
>>> f'name'={name}
'name=Василий'

>>> f'{name=}'  # if version >= python 3.8
"name='Василий'"
@anuvyklack
anuvyklack / miscellaneous.md
Last active November 14, 2019 17:33
[Vim Script]

Получить переменную буфера по номеру окна

getbufvar(winbufnr(window), '&buftype')

Execute command form string epanded with the word under the cursor

noremap <silent> K :execute "vert help ".expand("<cword>")<CR>
@anuvyklack
anuvyklack / miscellaneous.md
Last active September 3, 2019 16:44
[PowerShell] Useful gists for powershell

Get all cmdlets from the session and leave only those with the property "source" equal to "conda":

gcm | ? {$_.Source -eq "Conda"}

Вывести листинг функции в консоль (несколько вариантов):

  • (gcm mkdir).Definition
  • $function:mkdir
  • ${function:mkdir}