Skip to content

Instantly share code, notes, and snippets.

View Configuration.cs
ResourceSpace.Has
.ResourcesOfType<Stream>()
.AtUri("/content/{path}")
.And.AtUri("/content/images/{path}")
.And.AtUri("/content/colors/{path}")
.HandledBy<EmbeddedResourceHandler>()
.TranscodedBy<ApplicationOctetStreamCodec>().ForMediaType("text/html").ForExtension(".html")
.And.TranscodedBy<ApplicationOctetStreamCodec>().ForMediaType("text/javascript").ForExtension(".js")
.And.TranscodedBy<ApplicationOctetStreamCodec>().ForMediaType("text/css").ForExtension(".css")
.And.TranscodedBy<ApplicationOctetStreamCodec>().ForMediaType("image/png").ForExtension(".png");
@liddellj
liddellj / DateTimeExtensions.cs
Created May 19, 2011
C# DateTime to Unix Timestamp Extension Method
View DateTimeExtensions.cs
public static class DateTimeExtensions
{
public static long ToUnixTimestamp(this DateTime d)
{
var duration = d - new DateTime(1970, 1, 1, 0, 0, 0);
return (long)duration.TotalSeconds;
}
}