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
//http://fullsaas.blogspot.com/2011/02/tip-for-aspnet-mvc-3-in-jquery-mobile.html | |
//entering the following: | |
@Html.ActionLink("My team", "UsersList", "Home", null, | |
new { data_theme = "b", data_transition = "fade", | |
data_icon = "star" }) | |
//#shows | |
<a data-icon="star" data-theme="b" data-transition="fade" |
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
//http://john.katsiotis.com/blog/asp.net-mvc---passing-a-flag-enum-to-an-action-as-parameter | |
[Flags] | |
public enum enDays | |
{ | |
None = 0, | |
Monday = 1, | |
Tuesday = 2, | |
Wednesday = 4, | |
Thursday = 8, |
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 script = ((IObjectContextAdapter)context).ObjectContext.CreateDatabaseScript(); |
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
def full_name | |
"#{first_name} #{last_name}".trim | |
end | |
def friendly_name | |
return full_name unless full_name.blank? | |
end |
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
//dump repo from svn | |
svnadmin dump foo > foo_full.dmp | |
//filter by project | |
svndumpfilter include --drop-empty-revs --renumber-revs --skip-missing-merge-sources FooBarCom < foo_full.dmp > foo_root_dir.dmp | |
//edit dmp files using text editor | |
//(suggest vim to not munge text and automatically convert end-of-line characters to the native format) | |
//... | |
//load dmp back into seperate repo |
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
//http://haacked.com/archive/2011/03/19/fixing-binding-to-decimals.aspx | |
//protected void Application_Start() { | |
//ModelBinders.Binders.Add(typeof(decimal), new DecimalModelBinder()); | |
// Your other stuff goes here. | |
//} | |
public class DecimalModelBinder : IModelBinder { | |
public object BindModel(ControllerContext controllerContext, | |
ModelBindingContext bindingContext) { |
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
[DisplayFormat(DataFormatString = "{0:d}", ApplyFormatInEditMode = true)] |
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
#parse a newline deliminated document that has an uppercase | |
#primary 'header' and several lines of secondary 'items' | |
Function Parse-Document{ | |
param([string]$path) | |
$text = gc $path | |
foreach($line in $text){ | |
if(IsUpperCase $line){ | |
#"Primary: $line"; | |
$spec = new-object PSObject -property @{ Primary = $line; Secondary = @() } | |
[void]$foreach.MoveNext(); |
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 EFCodeFirstMethods | |
{ | |
public static void DumpDbCreationScriptToFile(DbContext context) | |
{ | |
var script = CreateDbScript(context); | |
// C:\Users\james\code\work\impact\phyweb\src\IRX.Web.UI\ | |
var appDomainPath = AppDomain.CurrentDomain.BaseDirectory; | |
var scriptPath = GetScriptsDirectory(appDomainPath); |
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
.input-validation-valid { border: 1px solid green; background-color: #CCFFCC; } |
OlderNewer