This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class HtmlHelperExtensions | |
{ | |
private static readonly char Separator = '/'; | |
private static readonly string TemplateFolder = HttpContext.Current.Server.MapPath("~/App/templates"); | |
private static readonly IViewEngine ViewEngine = new HandlebarsRazorViewEngine(); | |
public static MvcHtmlString RenderEmber(this HtmlHelper helper, string path = "", bool noTemplateName = false) | |
{ | |
if (HttpRuntime.Cache[path] == null) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
class C | |
{ | |
static void Main() | |
{ | |
const long x = -1; | |
long y = x; | |
Console.WriteLine(unchecked(long.MinValue / x)); | |
Console.WriteLine(unchecked(long.MinValue / y)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Dapper; | |
using Oracle.ManagedDataAccess.Client; | |
using System; | |
using System.Collections.Generic; | |
using System.Data; | |
using System.Linq; | |
public class OracleDynamicParameters : Dapper.SqlMapper.IDynamicParameters { | |
private static Dictionary<SqlMapper.Identity, Action<IDbCommand, object>> paramReaderCache = new Dictionary<SqlMapper.Identity, Action<IDbCommand, object>>( ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public struct Maybe<T> | |
{ | |
public static readonly Maybe<T> NoValue; | |
public Maybe(T value, bool hasValue = true) : this() | |
{ | |
HasValue = hasValue; | |
Value = value; | |
} |