Skip to content

Instantly share code, notes, and snippets.

View stevewithington's full-sized avatar
⛑️
solving problems

Steve Withington stevewithington

⛑️
solving problems
View GitHub Profile
@stevewithington
stevewithington / auto-increment-npm
Created March 30, 2021 22:43 — forked from LukePammant/auto-increment-npm
Auto-increment NPM package in Azure Pipelines and publish to Azure Artifacts
trigger:
branches:
include:
- develop
- master
paths:
include:
- ./
resources:
@stevewithington
stevewithington / powershell-create-system-dsn-via-csv-import.md
Last active January 13, 2023 06:12
Powershell: Create/Add Windows System DSN via .CSV Import

Powershell: Create/Add Windows System DSN via .CSV Import

You can create/add/update/get a Windows System DSN pretty easily with Powershell.

Example dsn.csv file

Database, SystemDSN, Server
AAA, AAA_DSN, SomeIP\User
@stevewithington
stevewithington / add-images-to-gist.md
Last active February 26, 2021 13:13
Add Image(s) to Gist

Add Image(s) to Gist

If you don't already have an existing gist, you'll need to create one before proceeding.

Clone Your Gist

git clone https://gist.github.com/<hash>.git # via https
git clone [email protected]:<hash>.git     # via ssh
@stevewithington
stevewithington / mso-versions.md
Last active February 25, 2021 17:34
Windows Outlook Conditional CSS: Targeting Specific MSO Versions

Targeting Specific Outlook Versions

Outlook version(s) Code
All Windows Outlook (Most common) <!--[if mso]> your code <![endif]-->
Outlook 2000 <!--[if mso 9]> your code <![endif]-->
Outlook 2002 <!--[if mso 10]> your code <![endif]-->
Outlook 2003 <!--[if mso 11]> your code <![endif]-->
Outlook 2007 <!--[if mso 12]> your code <![endif]-->
Outlook 2010 <!--[if mso 14]> your code <![endif]-->
@stevewithington
stevewithington / get-latest-git-tag.sh
Created February 23, 2021 22:25
Git: Get Latest Tag
# get latest tag for the current branch
git describe --tags
# outputs > v*.*.*-{hash}
# get latest tag for the current branch without the hash
git describe --tags --abbrev=0
# outputs > v*.*.*
# get latest tag across all branches
git describe --tags $(git rev-list --tags --max-count=1)
@stevewithington
stevewithington / sql-cte-update.sql
Last active January 12, 2021 19:37
SQL: Update a table with Common Table Expression (CTE)
/*
Example of how to update a table in SQL using a Common Table Expression (CTE)
*/
USE [SomeTable]
GO
;WITH cte AS (
SELECT te.LandEntityId, te.BirthDate, te.BirthDateId, dd.DateId
FROM TypedEntity te
@stevewithington
stevewithington / dim-date.sql
Last active January 13, 2021 22:51
SQL: Date Dimension Table
USE [SomeDB]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
@stevewithington
stevewithington / sql-convert-string-to-date.sql
Last active January 13, 2021 22:50
SQL: UDF to convert string to date or return '0001-01-01'
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <[email protected]>
-- Create date: 2020.12.21
-- Description: Convert string to DATE if NULL or invalid, else set to '0001-01-01'
-- =============================================
CREATE FUNCTION [dbo].[udf_ConvertStringToDate]
@stevewithington
stevewithington / web.config
Last active November 9, 2020 18:25
Example web.config for Server Offline / Maintenance Mode
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<clear />
<!-- `stopProcessing` is irrelavent for `redirect` rules -->
<rule name="MAINTENANCE MODE" enabled="true">
<match url="^(.*)$" ignoreCase="true" />
@stevewithington
stevewithington / useful-git-commands.md
Last active September 3, 2020 17:31
Useful Git Commands

Useful Git Commands

Some useful commands for Git.

Creating Tags

git tag -a v1.0.0 -m 'v1.0.0'
git push origin --tags # To push tags to Github