Skip to content

Instantly share code, notes, and snippets.

View graywolfcorp's full-sized avatar

Park Espenschade graywolfcorp

View GitHub Profile
@graywolfcorp
graywolfcorp / spMSforeachtable.sql
Last active October 8, 2018 11:30
spMSforeachtable
CREATE proc [dbo].[sp_MSforeachtable]
@command1 nvarchar(2000), @replacechar nchar(1) = N'?', @command2 nvarchar(2000) = null,
@command3 nvarchar(2000) = null, @whereand nvarchar(2000) = null,
@precommand nvarchar(2000) = null, @postcommand nvarchar(2000) = null
AS
declare @mscat nvarchar(12)
select @mscat = ltrim(str(convert(int, 0x0002)))
if (@precommand is not null)
exec(@precommand)
exec(N'declare hCForEachTable cursor global for select ''['' + REPLACE(schema_name(syso.schema_id), N'']'', N'']]'') + '']'' + ''.'' + ''['' + REPLACE(object_name(o.id), N'']'', N'']]'') + '']'' from dbo.sysobjects o join sys.all_objects syso on o.id = syso.object_id '
@graywolfcorp
graywolfcorp / sp_MSforeach_worker.sql
Last active July 12, 2023 16:58
sp_MSforeach_worker
CREATE proc [dbo].[sp_MSforeach_worker]
@command1 nvarchar(2000), @replacechar nchar(1) = N'?', @command2 nvarchar(2000) = null, @command3 nvarchar(2000) = null, @worker_type int =1
as
create table #qtemp ( /* Temp command storage */
qnum int NOT NULL,
qchar nvarchar(2000) COLLATE database_default NULL
)
set nocount on
@graywolfcorp
graywolfcorp / gist:67da03a085090c4c58d96a50e1496549
Created January 5, 2019 16:17
Azure web.config for Angular app
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="spa" stopProcessing="true">
<match url="^(?!.*(.js|.css|.png|.jpg|.ico|.svg)).*$" />
<conditions logicalGrouping="MatchAll">
</conditions>
<action type="Rewrite" url="/" appendQueryString="true" />
@graywolfcorp
graywolfcorp / tde-copy-tofile.au3
Last active February 1, 2024 20:35
AutoIt macro to save easylanguage code locally
#include <FileConstants.au3>
#include <MsgBoxConstants.au3>
#include <StringConstants.au3>
HotKeySet("{F1}", "openTabs")
HotKeySet("{F7}", "copyELD")
HotKeySet("{F6}", "terminate")
Func copyELD()
$window_title = WinGetTitle("[active]")
@graywolfcorp
graywolfcorp / GitHubGistSnippet.txt
Last active February 2, 2024 19:20
Suppress gist footer to prevent X-Origin errors from iframe links
Original idea can be found at https://stackoverflow.com/questions/70732135/how-to-embed-github-gist-in-blazor-wasm
Modified for Blazor server and MudBlazor
Usage:
<GithubGistSnippet Title="Test" UserId="graywolfcorp" FileName="08cafafda5d51ccdac25a8b45afd3d77"></GithubGistSnippet>
GitHubGistSnippet.razor.cs
@graywolfcorp
graywolfcorp / gist:6c4bb4ff517927531b068dc9db8d1ba3
Last active February 7, 2024 16:48
yaml for repo outside project folder
steps:
- name: checkout Blazor web - primary solution - need to place one folder down so relative refs in sln file work
uses: actions/checkout@v4
with:
path: './app'
- name: check out httprequest - external project library
uses: actions/checkout@v4
with:
token: ${{ secrets.TOKEN }}
@graywolfcorp
graywolfcorp / dev-publish.yml
Created February 13, 2024 22:41
yml to build a web app and web job from the same repo and publish to Azure
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions
name: gwcblazor - dev
on:
push:
branches:
- dev
workflow_dispatch:
@graywolfcorp
graywolfcorp / gist:78e9927b6204b49b7a5034c85c96a065
Created February 13, 2024 22:58
SeriLog config to exclude null messages from misc webjob actions
Log.Logger = new LoggerConfiguration()
.Enrich.FromLogContext()
.MinimumLevel.Override("System.Net.Http.HttpClient", LogEventLevel.Warning)
.MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
.MinimumLevel.Override("Microsoft.Hosting.Lifetime", LogEventLevel.Warning)
.WriteTo.Logger(x => x
.Filter.ByExcluding("StartsWith(@m, 'The next 5 occurrences')")
.Filter.ByExcluding("StartsWith(@m, 'Executing ''Functions')")
.Filter.ByExcluding("StartsWith(@m, 'Executed ''Functions')")
.Filter.ByExcluding("StartsWith(@m, 'null')") //suppress null messages from webjobs internal actions at INFO level https://github.com/Azure/azure-webjobs-sdk/issues/1968