Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Drawing;
using System.Threading;
using Iot.Device.Ws28xx.Esp32;
namespace AftOverhead
{
public class Program
{
public static void Main()
@mikeobrien
mikeobrien / AutomapperExtensions.cs
Created December 22, 2016 16:11
IoC friendly Automapper
public static class AutomapperExtensions
{
// The following is a friendlier DSL than the one that ships with
// Automapper, for the vast majority of the mapping done in Workforce.
//
// So instead of this:
// .ForMember(x => x.Id, x => x.MapFrom(y => y.Guid))
// You can do this:
// .From(x => x.Guid).To(x => x.Id)
//

Suspectus turbae terra tamen

Authentication

Lorem markdownum formam reicerer adstitit capiunt verbaque hac quam erat, vulnere 💩 gracili! Cui in auxiliaria :shipit: manu primis apertum :trollface: frigora tendimus Agenore miserere, in.

Logo

@mikeobrien
mikeobrien / sticky-headers.js
Created August 16, 2016 22:21
Sticky headers
+function ($) {
var currentHeader = null;
var animating = false;
$(document).scroll(function() {
if (animating) return;
animating = true;
requestAnimationFrame(animateHeader);
animating = false;
@mikeobrien
mikeobrien / ThinFilmMeasurement.cs
Created July 11, 2016 03:18
Thin Film Measurement Proof of Concept
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.Remoting.Messaging;
using System.Windows.Forms;
using OxyPlot;
using OxyPlot.Series;
namespace GraphingTests
@mikeobrien
mikeobrien / GetHandler.cs
Created March 25, 2016 14:34
Automapper 5 + StructureMap
public class GetHandler
{
private readonly IRepository<Job> _jobs;
private readonly IMapper _mapper;
public class Response
{
...
public List<JobModel> Jobs { get; set; }
}
@mikeobrien
mikeobrien / Runner.cs
Created December 28, 2015 17:47
StructureMap Container
using (var container = new Container(x => {
x.AddRegistry<Core.Registry>();
x.AddRegistry<Registry>(); }))
{
try
{
container.GetInstance<SomeRunnerType>().Run();
}
catch (Exception exception)
{
@mikeobrien
mikeobrien / CompositeInterceptor.cs
Last active February 18, 2020 10:06
NHibernate Composite Interceptor
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using MoreLinq;
using NHibernate;
using NHibernate.SqlCommand;
using NHibernate.Type;
public class CompositeInterceptor : IInterceptor
{
@mikeobrien
mikeobrien / SSLHack.cs
Last active October 12, 2015 21:37
Hack to force .NET to accept our self signed certs
// Hack to force .NET to accept our self signed certs
ServicePointManager.ServerCertificateValidationCallback =
((sender, certificate, chain, sslPolicyErrors) => true);
@mikeobrien
mikeobrien / asset-bundler.js
Last active September 28, 2015 01:39
Bundler
var gulp = require('gulp');
var fs = require('fs');
var path = require('path');
var glob = require('glob');
var useref = require('node-useref');
var concat = require('gulp-concat');
var through = require('through2');
// Yes there are gulp plugins out there that do exactly this
// but ran into issues with a number of them so gave up and