Skip to content

Instantly share code, notes, and snippets.

View alexander-williamson's full-sized avatar

Alexander Williamson alexander-williamson

View GitHub Profile
@alexander-williamson
alexander-williamson / gist:4f0726f3d31f38c16c284f164b46c5f9
Created November 27, 2017 21:12 — forked from efbenson/gist:4259486
Automapper for MongoDB ObjectIds
Mapper.CreateMap<List<ObjectId>, List<string>>().ConvertUsing(o => o.Select(os => os.ToString()).ToList());
Mapper.CreateMap<List<string>, List<ObjectId>>().ConvertUsing(o => o.Select(os => ObjectId.Parse(os)).ToList());
Mapper.CreateMap<ObjectId, string>().ConvertUsing(o => o.ToString());
Mapper.CreateMap<string, ObjectId>().ConvertUsing(s => ObjectId.Parse(s));
@alexander-williamson
alexander-williamson / patiently.rb
Created July 6, 2016 16:38 — forked from avanderberg/patiently.rb
retry wrapper for cucumber steps
def patiently(&block)
cycles = 0
begin
yield
rescue => e
cycles += 1
sleep 0.1
if cycles < 10
retry
else