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
/* Bindings */ | |
ko.bindingHandlers.selectPicker = { | |
init: function(element, valueAccessor, allBindingsAccessor) { | |
if ($(element).is('select')) { | |
if (ko.isObservable(valueAccessor())) { | |
if ($(element).prop('multiple') && $.isArray(ko.utils.unwrapObservable(valueAccessor()))) { | |
// in the case of a multiple select where the valueAccessor() is an observableArray, call the default Knockout selectedOptions binding | |
ko.bindingHandlers.selectedOptions.init(element, valueAccessor, allBindingsAccessor); | |
} else { | |
// regular select and observable so call the default value binding |
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 model = @Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(Model)); |
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 abstract class AbstractViewModel<T> | |
{ | |
public AbstractViewModel<T> PreventNulls() | |
{ | |
// Verifica se alguma propriedade eh nula e insere um valor valido | |
var properties = GetType().GetProperties(); | |
foreach (var property in properties ) | |
{ | |
var value = property.GetValue(this, 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
// String.js - liberated from MicrosoftAjax.js on 03/28/10 by Sky Sanders | |
/* | |
Copyright (c) 2009, CodePlex Foundation | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without modification, are permitted | |
provided that the following conditions are met: | |
* Redistributions of source code must retain the above copyright notice, this list of conditions |
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
/// <summary> | |
/// Wrapper for SaveChanges adding the Validation Messages to the generated exception | |
/// </summary> | |
/// <param name="context">The context.</param> | |
private void SaveChanges(DbContext context) | |
{ | |
try | |
{ | |
context.SaveChanges(); | |
} |
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 override int SaveChanges() | |
{ | |
// var auditUser = HttpContext.Current.User.Identity.Name; | |
DateTime auditDate = DateTime.UtcNow; | |
foreach (DbEntityEntry<IAuditable> entry in ChangeTracker.Entries<IAuditable>()) | |
{ | |
if (entry.State == EntityState.Added) | |
{ | |
entry.Entity.CreatedOn = auditDate; | |
entry.Entity.ModifiedOn = auditDate; |
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
[color] | |
diff = auto | |
status = auto | |
[color "diff"] | |
meta = yellow bold | |
frag = magenta bold | |
old = red bold | |
new = green bold | |
[color "status"] | |
added = cyan bold |
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
Para armazenar credenciais: | |
git config credential.helper store | |
Para remover credenciais: | |
git config --unset credential.helper |
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
msbuild Web.csproj /P:DeployIisAppPath="Default Web Site" /P:Configuration=Release /P:Platform="AnyCPU" /P:DeployOnBuild=True /P:DeployTarget=MSDeployPublish /P:MsDeployServiceUrl=https://xxxx/MsDeploy.axd /P:AllowUntrustedCertificate=True /P:MSDeployPublishMethod=WMSvc /P:CreatePackageOnPublish=True /P:UserName=xx\xxxx /P:Password=xxxxx |
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
# USE IF YOU HAVE | |
#export JAVA15_HOME="/System/Library/Java/JavaVirtualMachines/1.5.0/Contents/Home/" | |
#export PATH=${JAVA15_HOME}/bin:$PATH | |
#export JAVA_HOME=$(/usr/libexec/java_home) | |
#export PATH=${JAVA_HOME}/bin:$PATH | |
#export MAVEN_OPTS="-Xmx1024m -Xms1024m -XX:MaxPermSize=1162m" | |
#export M2_HOME=/usr/local/apache-maven-2.2.1 | |
#export M2=$M2_HOME/bin | |
#export PATH=$M2:$PATH |
OlderNewer