This file contains 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
<!-- save it under %USERPROFILE%\Documents\Visual Studio 2015\Code Snippets\Visual C#\My Code Snippets. --> | |
<?xml version="1.0" encoding="utf-8" ?> | |
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> | |
<CodeSnippet Format="1.0.0"> | |
<Header> | |
<Title>Insert Console.ReadLine()</Title> | |
<Shortcut>crl</Shortcut> | |
<Description>Code snippet for Console.ReadLine</Description> | |
<Author>Stack Overflow User</Author> | |
<SnippetTypes> |
This file contains 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
# originally posted on msdn: https://blogs.msdn.microsoft.com/debuggingtoolbox/2010/10/11/powershell-script-troubleshooting-for-port-exhaustion-using-netstat/ | |
## Original author: frank.taglianetti@microsoft.com | |
## Displays port counts per IP address | |
## Parameters = none | |
## Modified 12/6/2011 to include Windows Vista or later | |
## TCP Parameters documented in http://support.microsoft.com/kb/953230 | |
function MaxNumOfTcpPorts #helper function to retrive number of ports per address | |
{ |
This file contains 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
<log4net debug="false"> | |
<appender name="INFOFileAppender" type="log4net.Appender.RollingFileAppender"> | |
<!--<level value="INFO" />--> | |
<filter type="log4net.Filter.LevelRangeFilter"> | |
<param name="LevelMin" value="INFO" /> | |
<param name="LevelMax" value="FATAL" /> | |
</filter> | |
<file value="log\log.txt" /> | |
<appendToFile value="true" /> | |
<rollingStyle value="Size" /> |
This file contains 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
-- original source: http://www.sommarskog.se/query-plan-mysteries.html | |
-- replace object_id and db_id as needed | |
-- Reminder: You need the server-level permission VIEW SERVER STATE to run queries against the plan cache | |
SELECT qs.plan_handle, a.attrlist | |
FROM sys.dm_exec_query_stats qs | |
CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) est | |
CROSS APPLY (SELECT epa.attribute + '=' + convert(nvarchar(127), epa.value) + ' ' | |
FROM sys.dm_exec_plan_attributes(qs.plan_handle) epa | |
WHERE epa.is_cache_key = 1 | |
ORDER BY epa.attribute |
This file contains 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
-- Source http://www.sommarskog.se/query-plan-mysteries/setoptions.sql | |
-- Function to translate the set_options attribute in sys.dm_plan_exec_attributes. | |
-- Written by Erland Sommarskog, 2011-01-02. | |
-- Usage: pass to it the set of options of a given cache plan entry: SELECT Set_option FROM setoptions (4347) ORDER BY Set_option | |
CREATE FUNCTION dbo.setoptions (@setopts int) RETURNS TABLE AS | |
RETURN | |
WITH | |
L0 AS(SELECT 1 AS c UNION ALL SELECT 1), | |
L1 AS(SELECT 1 AS c FROM L0 AS A, L0 AS B), | |
L2 AS(SELECT 1 AS c FROM L1 AS A, L1 AS B), |
This file contains 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
#https://www.sqlservercentral.com/Forums/Topic1479951-392-1.aspx | |
IF OBJECT_ID('tempdb..#indexInfo') IS NOT NULL | |
DROP TABLE #indexInfo; | |
SELECT TOP 0 | |
t.TABLE_CATALOG AS db, | |
t.TABLE_SCHEMA AS SchemaName, | |
OBJECT_NAME(i.OBJECT_ID) AS TableName, | |
ISNULL(i.name,'<HEAP>') AS IndexName, | |
i.index_id AS IndexID, |
This file contains 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
Thanks to: https://stackoverflow.com/a/5201642/1456567 | |
You can do this fairly easily without git rebase or git merge --squash. In this example, we'll squash the last 3 commits. | |
If you want to write the new commit message from scratch, this suffices: | |
git reset --soft HEAD~3 && | |
git commit | |
If you want to start editing the new commit message with a concatenation of the existing commit messages (i.e. similar to what a pick/squash/squash/…/squash git rebase -i instruction list would start you with), then you need to extract those messages and pass them to git commit: |