Skip to content

Instantly share code, notes, and snippets.

View Brad-Christie's full-sized avatar

Brad Christie Brad-Christie

View GitHub Profile
@Brad-Christie
Brad-Christie / File Locations
Last active October 30, 2020 06:02
Links to various files that may be helpful to have direct web references to (e.g. use in a dockerfile)
IIS / URL Rewrite Module 2.1
Info: https://www.iis.net/downloads/microsoft/url-rewrite
Installer (x86)
Filename: rewrite_x86_en-US.msi
Resulting URI: http://download.microsoft.com/download/6/8/F/68F82751-0644-49CD-934C-B52DF91765D1/rewrite_x86_en-US.msi
Unattended: msiexec /i rewrite_x86_en-US.msi /quiet /norestart
Installer (x64)
Filename: rewrite_amd64_en-US.msi
Resulting URI: http://download.microsoft.com/download/D/D/E/DDE57C26-C62C-4C59-A1BB-31D58B36ADA2/rewrite_amd64_en-US.msi
Unattended: msiexec /i rewrite_amd64_en-US.msi /quiet /norestart
@Brad-Christie
Brad-Christie / MongDB(aaS).bat
Last active June 14, 2017 17:33
Run MongoDB as a windows service.
@ECHO OFF
TITLE MongoDB as a Service
REM Change to your installation dir.
SET MONGODIR=%ProgramFiles%\MongoDB\Server\2.7\bin
REM Change to where you'd like the databases and logs.
SET LOGDIR=%MONGODIR%\data\log
SET DBDIR=%MONGODIR%\data\db
SET LOGFILE=%LOGDIR%\mongod.log
@Brad-Christie
Brad-Christie / MailExample.cs
Created March 14, 2017 16:37
Demonstrating attaching an image to a MailMessage from a url.
var url = "https://chart.googleapis.com/chart?chs=250x250&cht=qr&chl=abc%20123%20456&choe=UTF-8";
var attachment = MailMessageHelper.GetUrlAsAttachment(url, "qrcode.png");
message += string.Format("<img src='{0}' />", attachment != null ? "cid:" + attachment.ContentId : url);
using (SmtpClient client = new SmtpClient("xxx.xxx.x.xx"))
{
MailAddress to = new MailAddress("john@example.com");
MailAddress from = new MailAddress("email@example.com");
MailMessage email = new MailMessage(from, to);