@{
int x = 123;
string y = "because.";
}
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
REM Dev Box Setup | |
REM This script sets up my dev boxes for virtual machines that I use. | |
REM It will go through and 1st install Chocolatey, then it will installs extensions for vs code and perform various | |
REM other setup functions. | |
REM M. Mahon | |
REM @jetstreamin | |
REM Chocolaty Command Reference: https://chocolatey.org/docs/commands-reference |
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
SELECT TOP 10 d.object_id, d.database_id, OBJECT_NAME(object_id, database_id) 'proc name', | |
d.cached_time, d.last_execution_time, d.total_elapsed_time, | |
d.total_elapsed_time/d.execution_count AS [avg_elapsed_time], | |
d.last_elapsed_time, d.execution_count | |
FROM sys.dm_exec_procedure_stats AS d | |
WHERE OBJECT_NAME(object_id, database_id) = 'sp_GlobalIndex_IncrementalUpdate_GetDocuments' | |
ORDER BY [total_worker_time] DESC; |
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
-- Add the Modified field to the row | |
-- E.g. Add a column to the table using a create/alter statement like: | |
-- ... | |
-- Modified DATETIME2(3), | |
-- ... | |
-- Then create the trigger | |
CREATE TRIGGER updateModified | |
ON dbo.YourTable | |
AFTER UPDATE |
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
declare @objectid int | |
select @objectid = object_id from sys.objects where name = 'documents' | |
select top 50 | |
db_name(database_id) as [DbName] | |
, * | |
from sys.dm_db_index_usage_stats where object_id = @objectid | |
and last_user_update is not null | |
order by last_user_update |
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 ObjectDump | |
{ | |
public static void Write(TextWriter writer, object obj) | |
{ | |
if (obj == null) | |
{ | |
writer.WriteLine("Object is null"); | |
return; | |
} |
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
# longIslandIcedTea.py | |
# btc_usd on bitfinex | |
# Mike Mahon | |
# [email protected] | |
# 07/02/2017 | |
# Interval Tests - 01-01-2016 to 06-02-2017 - Beg. Bal: $50 | |
# 1 min interval - End Bal: | |
# 15 min interval - End Bal: $223.32 | |
# 30 min interval - End Bal: $206.58 |
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
git config core.editor "'C:\Program Files (x86)\Notepad++\notepad++.exe' -multiInst -notabbar -nosession -noPlugin" |
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
INSERT INTO [TaskComments] ([TaskId], [CommentId]) | |
OUTPUT INSERTED.TaskId, INSERTED.CommentId, GETDATE() AS 'Created' | |
VALUES (24, 44) | |
UPDATE Tasks SET Completed = '02-22-2017' OUTPUT INSERTED.Completed, DELETED.Completed WHERE Id = 79 |
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
Jenkins.instance.getItemByFullName("YourJobName").updateNextBuildNumber(45) |