Skip to content

Instantly share code, notes, and snippets.

Mike Sigsworth mikesigs

Block or report user

Report or block mikesigs

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mikesigs
mikesigs / AddSelfAsSqlAdmin.bat
Created Jul 30, 2019
Add Self as SQL Admin on local instance
View AddSelfAsSqlAdmin.bat
@echo off
rem
rem ****************************************************************************
rem
rem Copyright (c) Microsoft Corporation. All rights reserved.
rem This code is licensed under the Microsoft Public License.
rem THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
rem ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
rem IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
rem PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
@mikesigs
mikesigs / cloudSettings
Created Feb 9, 2018
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2018-02-09T03:11:48.470Z","extensionVersion":"v2.8.7"}
@mikesigs
mikesigs / 1 - PowerShell Customization.md
Last active May 23, 2018 — forked from jchandra74/PowerShell Customization.md
PowerShell, Cmder / ConEmu, Posh-Git, Oh-My-Posh, Powerline Customization
View 1 - PowerShell Customization.md

Pimping Up Your PowerShell & Cmder with Posh-Git, Oh-My-Posh, & Powerline Fonts

Backstory (TLDR)

I work as a full-stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.

For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.

Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.

View Setpoint Startup
http://slickdeals.net/forums/showpost.php?p=6480998&postcount=1
Vista Blocked Programs at Startup- Fix Once and for All
I have the VISTA HOME Premium and like the VISTA Basic I do not have Security Policy Control on my non-VISTA Apps. Mad If you have Windows Vista Ultimate then you do. So here is a way too once and for all to fix that VISTA tray BLOCKED APP alert that is quite annoying in that you are alerted with every bootup that your app is blocked and you must allow the app to run each time by giving VISTA permission blessing. Boo on that. So here is the fix:
Remove the startup app that is offending by:
Start----Run----and type in msconfig.exe
Go to STARTUP Tab and remove the app that is blocked by Vista noting on a sheet of paper where the program is run from. If the program app is run from the startup menu, then just go to Start---All Program Files---Startup Folder and remove the app there.
View SQL_Date_Conversions.sql
/* *** SQL Server Date Calculations *** */
-- First day of prior month
SELECT DATEADD(mm, DATEDIFF(mm,0,DATEADD(mm,-1-DATEPART(day,GetDate()),GetDate())),0) /*first day of prior month*/
-- Last month
SELECT CAST(DATEPART(m, GetDate())-1 AS INT) /*last month*/
-- Current year
SELECT CAST(DATEPART(yyyy, GetDate())AS INT) /*current year*/
-- Current day
SELECT CAST(DATEPART(dd, GetDate())AS INT) /*current day*/
-- First day of current year
@mikesigs
mikesigs / LCD.cs
Last active Apr 22, 2016
Lowest Common Denominator
View LCD.cs
void Main()
{
var input = new long[,] { {1, 2}, {1, 3}, {1, 4} };
var fractions =
from i in Enumerable.Range(0, input.GetUpperBound(0) + 1)
select Tuple.Create(input[i,0], input[i,1]);
var denoms = fractions.Select(t => t.Item2).ToArray();
@mikesigs
mikesigs / replace_root.sh
Created Mar 24, 2016 — forked from pmiossec/replace_root.sh
Script to permit to rcheckin a git repository to a newly created TFVC repository with git-tfs
View replace_root.sh
#Script to permit to rcheckin a git repository to a newly created TFVC repository with git-tfs
#adaptation from my answer: http://stackoverflow.com/questions/645450/insert-a-commit-before-the-root-commit-in-git/30558271#30558271
#usage: pass to the script (1) the url of the tfs server, (2) the tfs path in the repository, (3) the changeset id
#../replace_root.sh "https://urlOfYourTfs/DefaultCollection" "$/EmptyTfs/Trunk" 21
# Command to get Changeset ID
# tf history "$/EmptyTfs/Trunk" /collection:"https://urlOfYourTfs/DefaultCollection" /noprompt /stopafter:1
# Clean up any previous attempt
rm -rf ./.git/refs/replace
@mikesigs
mikesigs / build.fsx
Created Mar 18, 2016
F# Suave Build Script
View build.fsx
// --------------------------------------------------------------------------------------
// A simple FAKE build script that:
// 1) Hosts Suave server locally & reloads web part that is defined in 'app.fsx'
// 2) Deploys the web application to Azure web sites when called with 'build deploy'
//
// Source: https://github.com/tpetricek/suave-xplat-gettingstarted/blob/master/build.fsx
// --------------------------------------------------------------------------------------
#r "packages/FSharp.Compiler.Service/lib/net45/FSharp.Compiler.Service.dll"
#r "packages/Suave/lib/net40/Suave.dll"
#r "packages/FAKE/tools/FakeLib.dll"
@mikesigs
mikesigs / NonEF_DatabaseFixture.cs
Last active Feb 19, 2016
xUnit2 DatabaseFixture that Drops and Creates LocalDb
View NonEF_DatabaseFixture.cs
public class DatabaseFixture
{
private readonly string DataDirectory = AppDomain.CurrentDomain.BaseDirectory;
private const string DatabaseName = "TestDb";
private const string DbFilename = DatabaseName + ".mdf";
private const string DbLogFilename = DatabaseName + "_log.ldf";
private const string TestDbConnectionStringName = "TestDb";
private const string MasterDbConnectionStringName = "MasterDb";
private string DbPath => Path.Combine(DataDirectory, DbFilename);
private string DbLogPath => Path.Combine(DataDirectory, DbLogFilename);
@mikesigs
mikesigs / DependenciesVisualizer.linq
Created Feb 2, 2016 — forked from plaurin/DependenciesVisualizer.linq
LinqPad query to generate a DMGL of projects, libraries and NuGet packages dependencies
View DependenciesVisualizer.linq
<Query Kind="Program" />
private string[] projectExtensionExclusions = new[] { ".vdproj", ".ndproj", ".wdproj", ".shfbproj" };
private string rootFolder = @"C:\Users\Pascal\Dev\MyProject";
void Main()
{
LoadAllProjects();
LoadAllPackagesConfig();
GenerateDGML(Path.Combine(rootFolder, "Dependencies.dgml"));
You can’t perform that action at this time.