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 / README.md
Last active December 14, 2018 17:38
BrickLink - The LEGO Christmas Ornaments Book (by Chis McVeigh)
@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);