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
HResult=-2146232015
Message=Data is Null. This method or property cannot be called on Null values.
Source=System.Data
StackTrace:
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
<configSections>
<sectionGroup name="common">
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
</sectionGroup>
<section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog" />
</configSections>
<!-- ... -->
View NLogOutOfMemory.xml
<nlog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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="http://www.w3.org/2001/XMLSchema-instance"
throwExceptions="false">
<targets>
<!-- size in bytes: 10485760 = 10 MB - set to 5 for most -->
<!-- master/all/combined log file -->
<target name="asyncAllTarget"
xsi:type="AsyncWrapper"
queueLimit="10000"
timeToSleepBetweenBatches="10"
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
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
{
[CmdletBinding()]
[Alias("Git-Cheat")]
PARAM (
[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