Skip to content

Instantly share code, notes, and snippets.

View NickCraver's full-sized avatar
:shipit:
Shipping

Nick Craver NickCraver

:shipit:
Shipping
View GitHub Profile
@NickCraver
NickCraver / Windows10-Setup.ps1
Last active April 1, 2024 10:52
(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
@NickCraver
NickCraver / Microsoft.PowerShell_profile.ps1
Last active March 18, 2024 13:25
Craver's oh-my-posh profile
# This goes in your Microsoft.PowerShell_profile.ps1 (can find the path via $PROFILE in your prompt)
Import-Module -Name posh-git,oh-my-posh,Terminal-Icons
Set-PoshPrompt -Theme craver
@NickCraver
NickCraver / DmpAnalysis.linq
Last active March 17, 2024 16:32
DMP Analysis in LinqPad
<Query Kind="Program">
<NuGetReference Prerelease="true">Microsoft.Diagnostics.Runtime</NuGetReference>
<Namespace>Microsoft.Diagnostics.Runtime</Namespace>
<Namespace>System</Namespace>
<Namespace>System.IO</Namespace>
<Namespace>System.Linq</Namespace>
<Namespace>System.Text</Namespace>
<Namespace>Microsoft.Diagnostics.Runtime.Utilities</Namespace>
</Query>
@NickCraver
NickCraver / Metrics.cs
Last active October 29, 2023 00:48
MetricsPrototyping
using System.Collections.Concurrent;
using System.Collections.Immutable;
using System.Collections.Generic;
using System.Net;
using System.Threading;
using System;
namespace MetricsPrototype
{
public class Example
@NickCraver
NickCraver / Readme.md
Created April 10, 2016 19:40
A simple LINQPad script I wrote for load testing SQL Server.

This is a simple LINQPad script I wrote one day to load test some large SQL servers. Maybe it's useful to someone. The basic premise is defining your queries once, including which ID patterns to fetch (at the bottom), and load test a mixture. The script defines everything needed in one place, then fires up the command-line linqpad runner to run many queries at once.

Params up top:

const string LinqPadPath = @"C:\Linqpad\lprun.exe";
const bool runSequential = false;
const int defaultThreads = 1;
const int defaultIterations = 2000;
@NickCraver
NickCraver / Win10NagRemover.ps1
Last active July 25, 2023 00:20
Windows 10 Upgrade Nag Remover. This script removes the Windows 7 & 8 updates that cause the Windows 10 upgrade nags to appear and hides them to prevent re-install. Must be run as administrator.
# Simple script to remove the Windows 10 "Nag" Updates and telemetry additions for Windows 7 & 8 users
# This will uninstall the updates and hide them, preventing installation in the future
# Note: MUST BE RUN AS ADMINISTRATOR, setting updates to hidden requires admin permissions
# Updates removed:
# KB3035583 - Update installs Get Windows 10 app in Windows 8.1 and Windows 7 SP1
# https://support.microsoft.com/en-us/kb/3035583
# KB2952664 - Compatibility update for upgrading Windows 7
# https://support.microsoft.com/en-us/kb/2952664
# KB2976978 - Compatibility update for Windows 8.1 and Windows 8
# https://support.microsoft.com/en-us/kb/2976978
@NickCraver
NickCraver / Build.xml
Last active July 7, 2023 16:40
Stack Overflow Build Reference Docs
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="PrepareStaticContent" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- Passed in Parameters -->
<configuration></configuration>
<workingDir></workingDir>
<buildNumber></buildNumber>
<buildViews>false</buildViews>
<minifyJs>true</minifyJs>
<TargetsDirectory></TargetsDirectory>
@NickCraver
NickCraver / SSMS17and17-HiDPI.ps1
Last active June 24, 2023 23:30
PowerShell: SSMS 16 & 17 HiDPI Enable
$xml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3"><asmv3:application><asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings"><dpiAware>True</dpiAware></asmv3:windowsSettings></asmv3:application><dependency><dependentAssembly><assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*" /></dependentAssembly></dependency><dependency><dependentAssembly><assemblyIdentity type="win32" name="debuggerproxy.dll" processorArchitecture="X86" version="1.0.0.0"></assemblyIdentity></dependentAssembly></dependency></assembly>';
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide" -Name PreferExternalManifest -Value 1 -Type DWord;
$ssms16 = "C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\ManagementStudio\Ssms.exe";
if ((
@NickCraver
NickCraver / BotLovin.cs
Last active January 5, 2023 11:36
Some bot/crawler fun on Stack Overflow. 10 hours of fun, to be precise.
private static readonly string[] tenHoursOfFun =
{
"https://www.youtube.com/watch?v=wbby9coDRCk",
"https://www.youtube.com/watch?v=nb2evY0kmpQ",
"https://www.youtube.com/watch?v=eh7lp9umG2I",
"https://www.youtube.com/watch?v=z9Uz1icjwrM",
"https://www.youtube.com/watch?v=Sagg08DrO5U",
"https://www.youtube.com/watch?v=5XmjJvJTyx0",
"https://www.youtube.com/watch?v=IkdmOVejUlI",
"https://www.youtube.com/watch?v=jScuYd3_xdQ",
@NickCraver
NickCraver / github-honesty.user.css
Created December 16, 2019 22:53
Label fun for GitHub!
.timeline-comment-label[aria-label*="previously committed"] {
display: inline-block;
text-indent: -9999px;
line-height: 0;
}
.timeline-comment-label[aria-label*="previously committed"]::after {
background: none !important;
color: inherit;
content: "Co-conspirator";
display: block;