Skip to content

Instantly share code, notes, and snippets.

RodH257 / gist:4045370
Created Nov 9, 2012
View gist:4045370
public static Mock<IUnitOfWork> SetupAllObjectSets(this Mock<IUnitOfWork> mock)
var properties = typeof(IUnitOfWork).GetProperties();
foreach (var property in properties)
//IObjectSet<Of Something>
var genericType = property.PropertyType.GetGenericTypeDefinition();
if (genericType == typeof(System.Data.Objects.IObjectSet<>))
//Gets the <T> out of IObjectSet<T>
View gist:4472165
static int[] Detach<TEntity>(
this IUnitOfWork unitOfWork, Func<TEntity, bool> where, Func<TEntity, int> getKey = null)
where TEntity : EntityObject
if (!(unitOfWork is ObjectContext))
return new int[0];
var objectContext = ((ObjectContext)unitOfWork);
RodH257 / gist:142314f2c60afca4b2de
Created Sep 7, 2014
Referencing full image path in Xamarin iOS apps
View gist:142314f2c60afca4b2de
public static class GetFullImagePath
public static string ForFileName (string fileName)
//Any old images with a full file path stored should have the front part removed
if (fileName.Contains ("/"))
fileName = fileName.Substring (fileName.LastIndexOf ("/") + 1);
var docsDir = Environment.GetFolderPath (Environment.SpecialFolder.Personal);
RodH257 / vogels-dates-problem.js
Created Apr 10, 2016
Demonstration of Vogels issue saving dates inside objects inside arrays
View vogels-dates-problem.js
const vogels = require('vogels');
const Joi = require('joi');
const AWS = require('aws-sdk');
// setup Vogels
region: 'us-west-1',
View gist:0781d4e48b9ccb704760fd784826a73b
### Keybase proof
I hereby claim:
* I am rodh257 on github.
* I am rodh257 ( on keybase.
* I have a public key ASC991rqSF5IdhmoplmPbuAw_WSI61Zp_7iR-vXlYNwbggo
To claim this, I am signing this object: