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
public static void Main(string[] args) | |
{ | |
var path = @"C:\Users\bob\Downloads\AliceInWonderland.txt"; | |
path = @"C:\Users\bob\Downloads\Frankenstein.txt"; | |
path = @"C:\Users\bob\Downloads\MobyDick.txt"; | |
var text = File.ReadAllText(path); | |
// add numbers in front of each line | |
var lines = text.Split(["\r\n", "\n"], StringSplitOptions.None); | |
var digits = Math.Floor(Math.Log10(lines.Length) + 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
using System; | |
using System.Threading.Tasks; | |
using Windows.Foundation; | |
using Windows.Graphics.Imaging; | |
using Windows.Storage; | |
public static async Task AddExifToFile() | |
{ | |
// get an input file | |
var inputPath = @"d:\temp\tiger.png"; |
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
"Docker Desktop Installer.exe" install --accept-license --installation-dir=F:\Docker\Docker --wsl-default-data-root=F:\Docker\wsldata --hyper-v-default-data-root=F:\Docker\hvdata --windows-containers-default-data-root=F:\Docker\wincdata |
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
C:\Program Files\WindowsApps\findstr /S /Q:u fileExplorerContextMenus *.xml |
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
-- was adapted from https://www.brentozar.com/archive/2017/08/drop-indexes-fast which fails for some pks | |
CREATE OR ALTER PROCEDURE dbo.DropIndexes | |
@SchemaName NVARCHAR(255) = 'dbo', | |
@TableName NVARCHAR(255) = NULL, | |
@WhatToDrop VARCHAR(10) = 'Everything', | |
@ExceptIndexNames NVARCHAR(MAX) = NULL | |
AS | |
BEGIN | |
SET NOCOUNT ON; |
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
public static class BinaryUtilities | |
{ | |
[DllImport("dbghelp", CharSet = CharSet.Unicode)] | |
private static extern bool SymInitialize(nint hProcess, string? userSearchPath, bool fInvadeProcess); | |
[DllImport("dbghelp", CharSet = CharSet.Unicode)] | |
private static extern bool SymCleanup(nint hProcess); | |
[DllImport("dbghelp", CharSet = CharSet.Unicode)] | |
private static extern ulong SymLoadModuleEx(nint hProcess, nint hFile, string imageName, string? moduleName, long baseOfDll, int dllSize, nint data, int flags); |
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
extern "C" __declspec(dllimport) BOOL getCursorPos(LPPOINT); | |
extern "C" FARPROC __imp_getCursorPos = GetProcAddress(LoadLibrary(L"user32.dll"), "GetCursorPos"); | |
int main() | |
{ | |
POINT p{}; | |
getCursorPos(&p); | |
return 0; | |
} |
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 <windows.h> | |
#include <dxgi.h> | |
#include <D3dkmthk.h> | |
#include <stdio.h> | |
#include "nvml\include\nvml.h" | |
#pragma comment(lib, "nvml\\lib\\nvml.lib") | |
#pragma comment(lib, "dxgi.lib") |
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
using System; | |
using System.Collections.Generic; | |
using System.Drawing; | |
using System.IO; | |
using System.Linq; | |
using System.Runtime.InteropServices; | |
using System.Runtime.InteropServices.ComTypes; | |
using System.Windows.Forms; | |
namespace OnDemandDataObject; |
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 <windows.h> | |
#include <userenv.h> | |
#include <atlbase.h> | |
#include <stdio.h> | |
#include <shlobj.h> | |
#include <string> | |
#pragma comment(lib, "userenv") |
NewerOlder