This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// File: AspireNServiceBusExamples.cs | |
// This file contains sample code snippets demonstrating: | |
// 1) Using Azurite to emulate Azure Storage Queues locally | |
// 2) Configuring NServiceBus for local Azurite Storage Queues transport | |
// 3) Configuring NServiceBus for production Azure Service Bus transport | |
// | |
// Note: | |
// - Azurite is a local Azure Storage emulator you run via npm: | |
// npm install -g azurite | |
// azurite --queue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DEL /F/Q/S *.* > NUL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Reflection; | |
public class TypeSafeEnum<T> where T : class | |
{ | |
TypeSafeEnum(string name, T typeSafeEnum) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sing System.Collections.Concurrent; | |
using System.IO; | |
using System.Security.Cryptography; | |
using System.Text; | |
using System.Web; | |
/** | |
* Solution from https://stefanolsen.com/posts/cache-busting-with-asp-net-mvc/ | |
* https://www.madskristensen.net/blog/cache-busting-in-aspnet/ | |
* https://stefanolsen.com/posts/cache-busting-2-0-an-update-for-asp-net-core/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- ============================================= | |
-- Author: Hair, Bryson | |
-- Create date: 4/27/2021 | |
-- Description: This stored procedure will send an email from the database with the query results as an html table in the email. | |
-- ============================================= | |
ALTER PROCEDURE [dbo].[CFT_SendDBEmailwithTabularQuery] | |
( | |
@qSELECT NVARCHAR(100), --The select part of the sql statement, which can include top X | |
@fieldlist NVARCHAR(MAX), --Pipe delimited list of fields, which can include aliases | |
@qFROM NVARCHAR(MAX), --The from part of the sql statment, which can include joins |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT SESSION.login_name AS 'Database User Name' | |
,MAX(SESSION.login_time) AS 'Login Time' | |
,SESSION.host_name AS 'PC Name' | |
,SESSION.program_name AS 'Program Using' | |
,SESSION.client_interface_name AS 'Interface' | |
,UM.USER_NAME AS 'User' | |
FROM master.sys.dm_exec_Sessions SESSION | |
WHERE SESSION.session_id >= 51 -- All user Sessions | |
GROUP BY SESSION.login_name | |
,SESSION.host_name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = app || {}; | |
app.google = app.google || {}; | |
app.google.map = (function ($) { | |
var model = { | |
markers: [], | |
initialized: ko.observable(false), | |
infoWindow: null, | |
apiLoaded: ko.observable(false) | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Make sure your page is using <script type="text/javascript" src="http://www.google.com/recaptcha/api/js/recaptcha_ajax.js"></script> | |
* or if you're using <script src="https://www.google.com/recaptcha/api.js" async defer></script> then comment out | |
* Recaptcha.create and uncomment the grecaptcha.render. | |
* based on http://jsfiddle.net/jaGWY/ | |
* docs: https://developers.google.com/recaptcha/intro & http://recaptchamvc.apphb.com/Home/Document | |
*/ | |
var app = app || {}; | |
app.knockout = app.knockout || {}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//given an object and a white list; reset all knockout observables to undefined | |
var reset = function (obj, whitelist) { | |
for (var prop in obj) { | |
if ( obj.hasOwnProperty(prop) && ko.isObservable(obj[prop]) && !ko.isComputed(obj[prop]) && whitelist.indexOf(prop) === -1 ) { | |
obj[prop](undefined); | |
} | |
} | |
}; | |
//useful for when an object is used for the value property of a dropdown. Usage: "optionsAfterRender: setOptionValue('propertyName')" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ($) { | |
$.fn.confirmModal = function (opts) { | |
var body = $('body'); | |
var unique = Math.floor(Math.random() * (1e+9)); | |
var clickedOutside = true; | |
// the innerFrameId allows a body of markup to be inserted w append in lieu of message | |
// use detach first if the nodes are already in the dom | |
var defaultOptions = { | |
confirmModalId: "confirmModal" + unique, | |
confirmInnerFrameId: "confirmInnerFrame" + unique, |
NewerOlder