Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am agarcian on github.
  • I am agarcian (https://keybase.io/agarcian) on keybase.
  • I have a public key ASB_Br--TuYVeVbKFPMWIdpzEdJk_hn8VVRcAjxTDBuRXgo

To claim this, I am signing this object:

@agarcian
agarcian / MonitorEndpoints.ps1
Created December 11, 2015 16:30 — forked from stefanprodan/MonitorEndpoints.ps1
Calling ASP.NET Web API endpoints at regular intervals can be easily done using Windows Task Scheduler and PowerShell’s Invoke-RestMethod. The following script makes a GET call for each supplied endpoint, if a call fails then the endpoint’s URL and the error details are sent to Windows Application Event Log.
#############################################
##
## Monitor ASP.NET WebAPI Enpoints
## Author: Stefan Prodan
## Date : 7 Apr 2014
## Company: VeriTech.io
#############################################
#Base url
$urlPrefix = "http://localhost/MyApp.Server/";
@agarcian
agarcian / gist:5828445
Created June 21, 2013 02:32
NotificationsHelper used in the code referenced in this question: http://stackoverflow.com/a/7796280/796668
public class NotificationsHelper
{
/// <summary>
/// Sends an email with a validation token to make sure the email is associated to the account for the user. Used when registering users.
/// </summary>
/// <param name="email">The email associated to the user account</param>
/// <param name="controllerContext">The context of the controller. (Required for processing the request)</param>
public static void SendEmailWithValidationToken(string email, System.Web.Mvc.ControllerContext controllerContext)
{
MailMessage message = new MailMessage();