Skip to content

Instantly share code, notes, and snippets.

@BurstX
BurstX / xcopy-repo.ps1
Last active July 19, 2022 11:42
Windows command line to copy repo with a Visual Studio solution (without compilation artifacts and temporary IDE files)
xcopy $srcPath $destPath /E /H /Q /EXCLUDE:vs.excl
<#
vs.excl file:
--------------
\obj\
\bin\
\.vs\
\.vscode\
\.idea\
@BurstX
BurstX / book-archiver.ps1
Last active May 8, 2022 10:52
This script archives documents in a folder (and its subfolders) that may benefit from archiving (i.e. jpg, epub are skipped; pdf's and other files are left archived if they can be compressed to a certain percentage, etc.)
<#
.SYNOPSIS
.PARAMETER Ratio
A real number within (0, 1). Ratio of the compressed file that is accepted as the archive.
Files that cannot be compressed better or equal to this ratio compared to the original,
are not archived (left as is).
#>
param(
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Running;
[SimpleJob(RuntimeMoniker.Net60)]
[MinColumn, MaxColumn]
public class Test
{
public static int A = 0;
private const int Max = 10_000;
using System;
using System.Collections;
using System.Security.Cryptography;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
namespace MyBenchmarks
{
public class CompareArraysBenchmark
{
@BurstX
BurstX / Uninstall-Cortana.ps1
Created July 15, 2021 09:27
Uninstall Cortana from Windows 10 via PowerShell
Get-AppxPackage -allusers Microsoft.549981C3F5F10 | Remove-AppxPackage
Get-EventLog -LogName System |? {$_.EventID -in (6005,6006,6008,6009,1074,1076)} | ft TimeGenerated,EventId,Message -AutoSize –wrap
@BurstX
BurstX / Get-OfflineOneDriveFiles.ps1
Created May 4, 2021 09:33
PowerShell (posh) script to get all the offline (taking hard-drive space) files in OneDrive local folder
<#
.SYNOPSIS
Borrowed code: https://github.com/PowerShellJax/Get-FileMetaData/blob/master/Get-FileMetaDataFunction.ps1
#>
param(
[Parameter(Mandatory=$true)]
[string] $OneDriveRootDiskPath
)
<#
.SYNOPSIS
! UPDATE THE VARIABLES IN THE BEGINNING
OF THE SCRIPT ACCORDING TO YOUR ENVIRONMENT
x
The script sets up the environment to reproduce the problem
stated in https://social.msdn.microsoft.com/Forums/en-US/7c93cb0c-d500-477b-b9fa-83f604299a28/expansion-of-wildcard-will-possibly-exceed-10000-terms?forum=sharepointsearch
The script creates:
1) a file share on the local drive with a tree of folders
Материалы для дополнительного чтения на английском:
https://golang.org/ref/spec - спецификация по язык
https://golang.org/ref/mem - модель памяти го. на начальном этапе не надо, но знать полезно
https://golang.org/doc/code.html - про организацию кода. GOPATH и пакеты
https://golang.org/cmd/go/
https://blog.golang.org/strings
https://blog.golang.org/slices
https://blog.golang.org/go-slices-usage-and-internals
https://github.com/golang/go/wiki - вики го на гитхабе. очень много полезной информации
<webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
<metaData>
<type name="Microsoft.SharePoint.WebPartPages.XsltListViewWebPart, Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
<importErrorMessage>Cannot import this Web Part.</importErrorMessage>
</metaData>
<data>
<properties>
<property name="ShowWithSampleData" type="bool">False</property>
<property name="Default" type="string" />