Skip to content

Instantly share code, notes, and snippets.

View jetstreamin's full-sized avatar
:octocat:
chillin' like the vanilla shake that I am

Mike Mahon jetstreamin

:octocat:
chillin' like the vanilla shake that I am
View GitHub Profile
@jetstreamin
jetstreamin / dev-toolbelt.bat
Created January 20, 2019 12:49
This is my script for installing a dev box. It uses chocolaty and a couple other package managers for Windows 10.
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
@jetstreamin
jetstreamin / GetEstimatedSPExecutionTime.sql
Created October 7, 2018 22:28
Get Estimated SP Execution Time
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;

ASP.NET Razor Syntax Reference

Code Block

@{
    int x = 123;
    string y = "because.";
}

Expression (Html Encoded)

@jetstreamin
jetstreamin / RowModifiedTrigger.sql
Last active January 27, 2019 20:34
SQL - Row Update Trigger
-- 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
@jetstreamin
jetstreamin / LastUpdateOfTable.sql
Created July 31, 2018 13:20
SQL Server - Last Update of a Table
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
@jetstreamin
jetstreamin / ObjectDumper.cs
Created July 27, 2018 15:56
Object Dumper - C# way to dump all properties of an object
public static class ObjectDump
{
public static void Write(TextWriter writer, object obj)
{
if (obj == null)
{
writer.WriteLine("Object is null");
return;
}
# 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
@jetstreamin
jetstreamin / batch.bat
Created February 18, 2017 19:05 — forked from bangonkali/batch.bat
Attaching Notepad++ to git commit editor.
git config core.editor "'C:\Program Files (x86)\Notepad++\notepad++.exe' -multiInst -notabbar -nosession -noPlugin"
@jetstreamin
jetstreamin / SQL-OUTPUT-Insert-Update
Created February 6, 2017 20:32
SQL OUTPUT for Inserts & Updates
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
@jetstreamin
jetstreamin / Jenkins - Update Next Build Number
Created February 3, 2017 00:44
Jenkins - Update Next Build Number
Jenkins.instance.getItemByFullName("YourJobName").updateNextBuildNumber(45)