Skip to content

Instantly share code, notes, and snippets.

View briandonahue's full-sized avatar

Brian Donahue briandonahue

View GitHub Profile
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
var async = require('async');
var AWS = require('aws-sdk');
var gm = require('gm');
var request = require('superagent');
var dateFormat = require('dateformat');
var sdbDomain = 'timesync';
console.log("Function loaded...");
[
{
"eventId": "fbf4a1a1-b4a3-4dfe-a01f-ec52c34e16e4",
"eventType": "event-type",
"data": { "a": "1" },
"metadata": {
"$causationid": "guid1",
"$correlationid": "guid2"
}
}
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Globalization;
using System.IO;
using Hercules.Infrastructure.Search.Mapping;
using Lucene.Net.Analysis.Standard;
using Lucene.Net.Index;
using Lucene.Net.QueryParsers;
using Lucene.Net.Search;
@briandonahue
briandonahue / gist:1987483
Created March 6, 2012 16:58
git warnings
warning: CRLF will be replaced by LF in blah.cs.
The file will have its original line endings in your working directory.
SearchView = Backbone.View.extend({
el: "#search",
initialize: function() {
return console.log(this);
}
})
view = new SearchView() // fails TypeError: undefined is not a function
// looks like I need to look at unminified backbone source to find what's up
@briandonahue
briandonahue / ImageResizing.cs
Created October 13, 2011 20:50
Image Resizing
Bitmap targetBitmap = new Bitmap(sourceImage, imageSize);
Bitmap canvas = new Bitmap(imageSize.Width, imageSize.Height);
// Set appropriate resolution
targetBitmap.SetResolution(72F, 72F);
Graphics g = Graphics.FromImage(canvas);
// Makes resized image have a higher quality
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
@briandonahue
briandonahue / gregyoung.textile
Created September 8, 2011 21:14
Greg Young's CQRS Class - Random Notes

CQRS – Greg Young – 8/26/2011

Insurance Domain – Value to Business Model (S-M-L)

  • Claims – L
  • Sales – S-M
  • Accounting – S
  • Actuarials – S
  • Intranet – S
  • Public Web – M-L
if (model.IsPotential)
{
// do some stuff
}
if (!model.IsPotential)
{
// do something else
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
namespace My.Infrastructure.Security
{
public class MyPrincipal: IPrincipal
{
public string Name { get; set; }