Skip to content

Instantly share code, notes, and snippets.

View IndifferentDisdain's full-sized avatar

Joseph Short IndifferentDisdain

View GitHub Profile
@IndifferentDisdain
IndifferentDisdain / Azure Pipelines YAML
Created December 26, 2019 16:14
Sample Azure Pipelines YAML build for ASP.NET Core web project and SQL Database project
# ASP.NET Core
# Build and test ASP.NET Core projects targeting .NET Core.
# Add steps that run tests, create a NuGet package, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
trigger:
- master
pool:
vmImage: 'windows-latest'
@IndifferentDisdain
IndifferentDisdain / gist:b18f61237546f47b038ddd50163db5d7
Created October 30, 2017 17:23
Example generic input component wrapper. if props.value is null, react bitches about it. So I have to ternary to get rid of warning, which feels hackey. Null is a perfectly acceptable value for a string prop that's never been set.
import * as React from 'react';
interface InputGroupProps {
disabled?: boolean;
label: string;
onChange(propName: string, newValue: number | string): any;
propName: string;
type?: string;
value: number | string;
}
@IndifferentDisdain
IndifferentDisdain / fk_drop_readd.sql
Created August 30, 2017 17:50
Dynamically drop and re-create foreign keys in SQL Server
/*
This script will load all foreign keys associated to a particular primary key, drop them (to allow you to do some work that
would violate primary keys), then re-add them. In our example, we're removing all foreign keys to a Products table, then re-creating them.
Inspired by https://stackoverflow.com/questions/925738/how-to-find-foreign-key-dependencies-in-sql-server
*/
DECLARE @tblProductFKs TABLE (FK_TABLE VARCHAR(100), FK_COLUMN VARCHAR(100), PK_TABLE VARCHAR(100), PK_COLUMN VARCHAR(100), Constraint_Name VARCHAR(100))
INSERT INTO @tblProductFKs