Skip to content

Instantly share code, notes, and snippets.

View BounceProcessor.cs
using System;
using System.Diagnostics;
using System.Linq;
using CyberCoders.Background.Diagnostics;
using CyberCodersEmailProcessor.Bounce.Data;
using CyberCodersEmailProcessor.Bounce.EmailParsing;
using CyberCodersEmailProcessor.Bounce.Exchange;
using Humanizer;
using Microsoft.Exchange.WebServices.Data;
using NLog;
View WIO_Sample_Config.json
"AppStatus": "Enabled",
"ImageDeleteAfterTimeSpan": "7.00:00:00",
"WallpaperOverrideUrl": "",
"Search": {
"DefaultOptions": {
"Filters": "Size:Large",
"Adult": "Moderate",
"MinWidth": 1920,
"MinHeight": 1080,
View gist:7536950
// left join as a safety precaution
jobAdPosts = (from b in SqlContext.JobBoards
join jap in SqlContext.JobAdPosts on new { JobBoardId = b.Id, JobAdId = vm.JobAd.Id } equals new { jap.JobBoardId, jap.JobAdId } into j1
from jap in j1.DefaultIfEmpty()
where b.IsActive
orderby b.SortOrder ascending
select jap).ToList();
View gist:7536991
System.Data.SqlTypes.SqlNullValueException was unhandled by user code
Message=Data is Null. This method or property cannot be called on Null values.
at System.Data.SqlClient.SqlBuffer.get_Int32()
at System.Data.SqlClient.SqlDataReader.GetInt32(Int32 i)
at HibernatingRhinos.Profiler.Appender.ProfiledDataAccess.ProfiledDataReader.GetInt32(Int32 ordinal)
at System.Data.Entity.Core.Objects.Internal.ShapedBufferedDataRecord.ReadInt(DbDataReader reader, Int32 ordinal)
at System.Data.Entity.Core.Objects.Internal.ShapedBufferedDataRecord.Initialize(DbDataReader reader, DbSpatialDataReader spatialDataReader, Type[] columnTypes, Boolean[] nullableColumns)
View NLogOutOfMemory2.xml
<sectionGroup name="common">
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
<section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog" />
<!-- ... -->
View NLogOutOfMemory.xml
<nlog xmlns:xsi="" throwExceptions="false">
<targets async="true">
<!-- size in bytes: 10485760 = 10 MB - set to 5 for most -->
<!-- master/all/combined log file -->
<target name="allTarget" xsi:type="File" fileName="${basedir}/logs/log-all.txt" layout="${time}|${level:uppercase=true}|${threadid}|${logger}|${message}" archiveAboveSize="10485760" archiveNumbering="Sequence" archiveFileName="${basedir}/logs/archive/log-all.{#####}.txt" maxArchiveFiles="3" keepFileOpen="false" deleteOldFileOnStartup="true" />
<!-- logs scheduling/job/quartz related separately -->
<target name="scheduleTarget" xsi:type="File" fileName="${basedir}/logs/log-schedule.txt" layout="${time}|${level:uppercase=true}|${threadid}|${logger}|${message}" archiveAboveSize="5242880" archiveNumbering="Sequence" archiveFileName="${basedir}/logs/archive/log-schedule.{#####}.txt" maxArchiveFiles="3" keepFileOpen="false" deleteOldFileOnStartup="true" />
View NLogOutOfMemory2.xml
<nlog xmlns:xsi=""
<!-- size in bytes: 10485760 = 10 MB - set to 5 for most -->
<!-- master/all/combined log file -->
<target name="asyncAllTarget"
View ExecuteDeploymentScript.bat
REM This is intended to be run only via the self-extracting zip exe created by build.
REM It copies extracted files to a known location in the event of an error, re-deploy, logging output etc.
REM It then hands off the real work to PowerShell for the deployment
@echo off
mode con cols=120
echo You are here: %~dp0
echo Copying extracted files to a known location
thnk2wn / My-GitUtilities.psm1
Last active Sep 7, 2017
Misc. Git Utility Module - Help, Applying Stash by Message, Deleting Merged Branches etc.
View My-GitUtilities.psm1
$instructionColor = "green"
$headerColor = "yellow"
$cheatCategories = @("branch", "commit", "diff", "history", "remote", "stage", "stash", "undo")
function Get-GitCheatSheet
[Parameter(Mandatory=$false, Position=0)]
View Zip-Install-Create.bat
@echo off
if "%1" == "" goto usage
REM Expecting trailing \ on folders passed in
set artifactsFolder=%1
set folderToBackup=%artifactsFolder%deployPackage\
set zipLocation=%artifactsFolder%
set buildFolder=%~dp0