Node.js Eventstore

http://eventstore.js.org/

The project goal is to provide an eventstore implementation for node.js:

load and store events via EventStream object
event dispatching to your publisher (optional)
supported Dbs (inmemory, mongodb, redis, tingodb, azuretable)
snapshot support
query your events

GuidComb

Copied from the NHibernate implementation

https://github.com/nhibernate/nhibernate-core/blob/master/src/NHibernate/Id/GuidCombGenerator.cs

public class GuidCombGenerator
	{

		public static Guid GenerateComb()
		{
			byte[] guidArray = Guid.NewGuid().ToByteArray();

			DateTime baseDate = new DateTime(1900, 1, 1);
			DateTime now = DateTime.Now;

			// Get the days and milliseconds which will be used to build the byte string 
			TimeSpan days = new TimeSpan(now.Ticks - baseDate.Ticks);
			TimeSpan msecs = now.TimeOfDay;

			// Convert to a byte array 
			// Note that SQL Server is accurate to 1/300th of a millisecond so we divide by 3.333333 
			byte[] daysArray = BitConverter.GetBytes(days.Days);
			byte[] msecsArray = BitConverter.GetBytes((long) (msecs.TotalMilliseconds / 3.333333));

			// Reverse the bytes to match SQL Servers ordering 
			Array.Reverse(daysArray);
			Array.Reverse(msecsArray);

			// Copy the bytes into the guid 
			Array.Copy(daysArray, daysArray.Length - 2, guidArray, guidArray.Length - 6, 2);
			Array.Copy(msecsArray, msecsArray.Length - 4, guidArray, guidArray.Length - 4, 4);

			return new Guid(guidArray);
		}
	}

iso 8601 timestamp in swift

func isoTimestamp() -> String
{
   let dateFormatter = NSDateFormatter()
   // dateFormatter.timeZone = NSTimeZone.localTimeZone()
   // C# "yyyy-MM-ddTHH:mm:ss.fffZ"
   dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"
   return dateFormatter.stringFromDate(NSDate())
}