Skip to content

Instantly share code, notes, and snippets.

View kylefender's full-sized avatar

Kyle Fender kylefender

  • ConnectWise
  • Michigan
View GitHub Profile
@kylefender
kylefender / DevBoxstarter
Last active January 25, 2023 21:08
Setup my dev machine
# Run the rest in the boxstarter shell
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Confirm
# From https://gist.github.com/flcdrg/87802af4c92527eb8a30
# This will install NuGet module if missing
Get-PackageProvider -Name NuGet -ForceBootstrap
# PowerShellGet. Do this early as reboots are required
if (-not (Get-InstalledModule -Name PowerShellGet -ErrorAction SilentlyContinue)) {
@kylefender
kylefender / ListTables.sql
Last active August 9, 2017 13:37
Lists all tables in the current database, including which procedures in the database reference these tables
/*
-- Lists all tables in the current database, including which procedures in the database reference these tables
NOTES:
There may be some false matches for Table_Name in the Referenced_by procedures
(for example: when a table name is a substring of another table name)
You can qualify the database names to find references in sprocs for tables in another database (on same server or using linked servers)
*/
SELECT Server_Name = @@SERVERNAME,
@kylefender
kylefender / ListStoredProcedures.sql
Created August 9, 2017 13:40
Lists all Stored Procedures and functions in the current database, along with Tables_referenced and parameters
/*
Lists all Stored Procedures and functions in the current database, along with Tables_referenced and parameters
NOTE:
These may be be some false matches for Table_Referenced
(for example: when a table name is a substring of another table name)
You can qualify the database names to find references in sprocs for tables in another database (on same server or using linked servers)
*/
SELECT Server_Name = @@SERVERNAME,
Database_Name = Routine_Catalog,
@kylefender
kylefender / jasmine.extensions.ts
Last active September 12, 2022 15:41
Jasmine extensions that make creating and interacting with mocked methods and properties easier. These are based on an article by Andrei Mihalciuc (https://itnext.io/better-typescript-support-for-jasmine-20dc7454ba94)
// Based on https://itnext.io/better-typescript-support-for-jasmine-20dc7454ba94
import { Pipe, Type } from '@angular/core';
import { TestBed } from '@angular/core/testing';
export type Spied<T> = T & { [Method in keyof T]: jasmine.Spy };
export function spyOnClass<T>(spiedClass: Type<T>): Spied<T> {
const prototype = spiedClass.prototype;
let methodNames = Object.getOwnPropertyNames(prototype)