Include the following tag into _viewImports.cshtml file
@addTagHelper *, WebOptimizer.Corethis enables the cachebuster
| // Following on from: http://stackoverflow.com/q/7661953/235644 | |
| // | |
| // Observations: | |
| // Should consider using UTC for better globalization support | |
| // | |
| // Usage: | |
| DateTimeExtensions.SetNowFunction(() => date1); | |
| /// <summary> | |
| /// Allow custom generation of Now times. |
| -- Sneaky way to select from a specific table using a config value | |
| -- Views do not support IF or anything else useful | |
| -- Obviously the table schemas need to match otherwise the UNION will fail | |
| SELECT t.* FROM ATable t | |
| INNER JOIN Config c on 'ConfigKeyToMatch' = c.ConfigKey | |
| WHERE c.ConfigValue = 'True' | |
| UNION | |
| SELECT t.* FROM DifferentTable t |
| kernel.Bind<IMyPrincipal>().ToMethod(c => Convert(HttpContext.Current.User)); | |
| private static IMyPrincipal Convert(IPrincipal principal) | |
| { | |
| if (principal is Common.CustomPrincipal) | |
| return (Common.CustomPrincipal)principal; | |
| else | |
| return new Common.AnonymousPrincipal(principal); | |
| } |
| public class MustBeEmptyAttribute : ValidationAttribute | |
| { | |
| public override bool IsValid(object value) | |
| { | |
| if (value == null) | |
| { | |
| return true; | |
| } | |
| if (value is string) | |
| { |
| public static class HtmlHelperExtensions | |
| { | |
| public static MvcHtmlString EmptyRow(this HtmlHelper helper, string emptyTextMessage, int rowCount) | |
| { | |
| return new MvcHtmlString(string.Format("<tr class=\"emptyRow\"><td colspan=\"{0}\">{1}</td></tr>", rowCount, emptyTextMessage)); | |
| } | |
| } |
| \curl -L https://get.rvm.io | bash -s stable --autolibs=3 --rails |
| if (%1)==(NOPAUSE) goto :eof | |
| pause |
| let rec repeatString stringToRepeat numberOfTimesToRepeat = | |
| if numberOfTimesToRepeat = 0 then "" | |
| else | |
| stringToRepeat + (repeatString stringToRepeat (numberOfTimesToRepeat - 1)) |
A test repo for trialing branching strategies and confirming our adoption and standards. We aim to use GitFlow as our primary strategy.
Guidance is largely stolen from the following articles: