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
return session.Query<PageContent>() | |
.Where(x => x.Menu.Id == menuId) | |
.ProjectAs(x => new Link(x.UrlName, x.Name, x.ShowInMenu)); |
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 linq | |
private bool HasCorrectCheckDigit(string uci) { | |
const string checkDigits = "ABCDEFGHKLMRTVWXY"; | |
try { | |
int remainder = uci.Substring(0, 12) | |
.Aggregate(Pair.Create(0, 0), (progress, character) => { | |
int multiplier = 16 - progress.Second; | |
int value = Convert.ToInt32(uci[progress.Second].ToString()) * multiplier; | |
return Pair.Create(progress.First + value, progress.Second + 1); |
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
$("#caption").css("filter", "alpha(opacity=75)"); | |
$("#block").fadeIn(3000, function(){ $("#caption").fadeIn(2500)}); |
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
//Option 1: | |
RuleFor(x => x.Surname).Cascade.StopOnFirstFailure.NotNull()..... | |
//Option 2: | |
RuleFor(x => x.Surname).Cascade(CascadeMode.StopOnFirstFailure).NotNull().... |
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
<script type="text/javascript"> | |
var person = { Name: "Jeremy", Id: 1 }; | |
</script> | |
<input type="text" sys:value="{binding path=Name, source={{person}} }" /> |
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
var handlerInterface = typeof(MyHandler).GetInterfaces()[0]; //This implements IHandle<T> (eg IHandle<Foo>) | |
var commandType = handlerInterface.GetGenericArguments()[0]; //this is the type being handled, eg Foo | |
var maker = GetType().GetMethod("ResolveHandler", BindingFlags.Static | BindingFlags.Public | BindingFlags.Instance); | |
var compiledDelegate = (Func<object>)Delegate.CreateDelegate(typeof(Func<object>), maker); |
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
target copyFiles: | |
FileList.Create def(fl): | |
fl.Include("src/Phantom/bin/${configuration}/*.{dll,exe}") | |
fl.Include("License.html") | |
fl.ForEach def(file): | |
file.CopyTo("build") |
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
with FileList(): | |
.Include("src/Phantom/bin/${configuration}/*.{dll,exe}") | |
.Include("License.html") | |
.ForEach def(file): | |
file.CopyToDir("build/${configuration}") |
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
var cfg = Fluently.Configure() | |
.Database(MsSqlConfiguration.MsSql2005 | |
.ProxyFactoryFactory(typeof(ProxyFactoryFactory).AssemblyQualifiedName) | |
.ConnectionString(conn => conn.FromConnectionStringWithKey("Web")) | |
).BuildConfiguration(); |
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
Clone as normal... | |
git clone git://...url... | |
Create and check out a local branch that tracks the remote branch | |
git checkout -b <branch name> --track origin/<remote branch name> | |
Pull changes into the branch: | |
git pull origin <remote name> |
OlderNewer