This file contains hidden or 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
<TemplatesExport family="File Templates"> | |
<Template uid="188d3b0a-987e-48b4-b42a-2ebaa25b21fb" shortcut="" description="Fluent Migration" text="using FluentMigrator;

namespace $NAMESPACE$
{
 [Migration($MIGRATIONNUMBER$)]
 public class $CLASS$$MIGRATIONNUMBER$ : Migration
 {
 public override void Up()
 {
 $END$
 }

 public override void Down()
 {

 }
 }
}
" reformat="True" shortenQualifiedReferences="True"> | |
<Scopes> | |
<Scope type="Everywhere" /> | |
</Scopes> | |
<Categories /> | |
<Variables> | |
<Variable name="NAMESPACE" expression="fileDefaultNamespace()" initialRange="0" /> | |
<Variable name="MIGRATIONNUMBER" expression="getCurrentTime("yyyymmddhhss")" initialRange="0" /> | |
<Variable name="CLASS" expression="getFileNameWithoutExtension()" initialRange=" |
This file contains hidden or 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
// Shamelessly stolen and adapted from http://stackoverflow.com/questions/506096/comparing-object-properties-in-c | |
public static class Comparisons | |
{ | |
public static bool PublicInstancePropertiesEqual<T>(this T self, T to, params string[] ignore) where T : class | |
{ | |
if (self != null && to != null) | |
{ | |
var type = typeof(T); | |
var ignoreList = new List<string>(ignore); | |
foreach (System.Reflection.PropertyInfo pi in type.GetProperties(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance)) |
This file contains hidden or 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
TFS | |
Pros | |
• Familiar to current team | |
• Has a UI tool within Visual Studio | |
• Close tie in to Work Items | |
Cons | |
• Slow to pull, check in and branch | |
• Merge conflicts are frequent | |
• Encourages infrequent check in due to merge conflicts and slow performance | |
• Branching frequently leads to time consuming conflicts |
This file contains hidden or 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
*.obj | |
*.pdb | |
*.user | |
*.aps | |
*.pch | |
*.vspscc | |
*_i.c | |
*_p.c | |
*.ncb | |
*.suo |
This file contains hidden or 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 class IndexController : Controller | |
{ | |
[Authorize] | |
public ActionResult Index() | |
{ | |
return View(); | |
} | |
} |
This file contains hidden or 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 class WindsorControllerFactory : DefaultControllerFactory | |
{ | |
private readonly IKernel kernel; | |
public WindsorControllerFactory(IKernel kernel) | |
{ | |
this.kernel = kernel; | |
} | |
public override void ReleaseController(IController controller) |
This file contains hidden or 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 void Install(IWindsorContainer container, IConfigurationStore store) | |
{ | |
foreach (var type in Assembly.GetExecutingAssembly().GetTypes()) | |
{ | |
if (typeof(IController).IsAssignableFrom(type) && !type.IsAbstract) | |
container.Register(Component.For(type).ImplementedBy(type).Named(type.FullName.ToLower()).LifeStyle.Transient); | |
} | |
} |
This file contains hidden or 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
require File.expand_path(File.dirname(__FILE__) + '/edgecase') | |
# Greed is a dice game where you roll up to five dice to accumulate | |
# points. The following "score" function will be used to calculate the | |
# score of a single roll of the dice. | |
# | |
# A greed roll is scored as follows: | |
# | |
# * A set of three ones is 1000 points | |
# |
This file contains hidden or 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
require 'benchmark' | |
class Gary | |
# https://gist.github.com/1089115 | |
def score(dice) | |
score_counts(dice).inject(0) {|score, pair| score + frequency_score(pair)} | |
end | |
def frequency_score(pair) | |
triple_score(pair) + single_score(pair) |
This file contains hidden or 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
*.obj | |
*.pdb | |
*.user | |
*.aps | |
*.pch | |
*.vspscc | |
*_i.c | |
*_p.c | |
*.ncb | |
*.suo |