Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Text;
using System.Web;
using System.Web.Configuration;
using System.Web.Mvc;
SELECT cp.objtype AS ObjectType,
OBJECT_NAME(st.objectid,st.dbid) AS ObjectName,
cp.usecounts AS ExecutionCount,
st.TEXT AS QueryText,
qp.query_plan AS QueryPlan
FROM sys.dm_exec_cached_plans AS cp
CROSS APPLY sys.dm_exec_query_plan(cp.plan_handle) AS qp
CROSS APPLY sys.dm_exec_sql_text(cp.plan_handle) AS st
WHERE OBJECT_NAME(st.objectid,st.dbid) = 'stored_proc_name'
rm alias:curl
New-ALias find Get-ChildItem
function touch ([string]$name) {
if($name -match '[^\.]+\.[^$]+') {
New-Item -ItemType File -Name $name
} else {
New-Item -ItemType Directory -Name $name
}
.load sos / .loadby sos clr
!help
.time
!threadpool
!runaway - all threads + cpu usage
!threads
~[threadId]s
!clrstack (-p)
!dumpobj 0x3333(address)
@karol-pawlowski
karol-pawlowski / cmder.config.xml
Last active January 10, 2019 09:59
Conemu configuration file
<?xml version="1.0" encoding="utf-8"?>
<key name="Software">
<key name="ConEmu">
<key name=".Vanilla" modified="2019-01-10 10:58:30" build="190108">
<value name="Language" type="string" data="en"/>
<value name="StartType" type="hex" data="02"/>
<value name="CmdLine" type="string" data=""/>
<value name="StartTasksFile" type="string" data=""/>
<value name="StartTasksName" type="string" data="{Shells::PowerShell (Admin)}"/>
<value name="StartFarFolders" type="hex" data="00"/>
@karol-pawlowski
karol-pawlowski / choco-installer.ps1
Last active July 23, 2020 08:59 — forked from amogram/chocolatey-env-setup.ps1
A Chocolatey script for PowerShell I use to set up my Windows development environment. I use this when setting up my own Dev VMs. Use at your own risk.See http://bit.ly/1a301JK and http://chocolatey.org/ for more information.
# Install Chocolatey and applications
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
# Disable confirmations
choco feature enable -n allowGlobalConfirmation
# Running this runs the above
iex ((new-object net.webClient).DownloadString('https://gist.githubusercontent.com/karol1990/4f5455e9fbfb3c8af145b60c084c8ebe/raw/62dfd04b592177a7bfdfee9d787a0ef41882266d/chocolatey-env-setup.ps1'))