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
@echo off | |
pushd "%PROGRAMFILES%\IIS Express" | |
for /F %%i in ('appcmd list sites /text:NAME') do ( | |
echo %%i | |
appcmd delete site %%i | |
) | |
popd |
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
@echo off | |
@set path=%PATH%;"%PROGRAMFILES\IIS EXPRESS"; | |
:: echo current directory is: %~dp0 | |
:: echo argument 1 is: %1 | |
set "HTTPPORT=9901" | |
set "PUBLIC=%~dp0%wwwroot" | |
set "HOME=%~dp0%iishome" | |
if not [%1]==[] ( | |
set httpport=%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
/* | |
* read-only date display with momentjs | |
* use like this: data-bind="moment: dateVar, format: 'YYYY-MM-DD'" | |
* The "format" is optional and will default to "MM/DD/YYYY" | |
*/ | |
ko.bindingHandlers.moment = { | |
update: function (element, valueAccessor, allBindingsAccessor, viewModel) { | |
var val = valueAccessor(); | |
var date = moment(ko.utils.unwrapObservable(val)); |
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 systemJsLoader = { | |
loadComponent: function (name, templateConfig, callback) { | |
if (templateConfig.systemjs) { | |
SystemJS.import(templateConfig.systemjs) | |
.then(function (viewModelCtor) { | |
callback({ | |
createViewModel: function (params, componentInfo) { | |
return viewModelCtor.viewModel(params, componentInfo); | |
}, | |
template: ko.utils.parseHtmlFragment(viewModelCtor.template) |
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 class Dto | |
{ | |
public int Formato1 { get; set; } | |
public int Formato2 { get; set; } | |
public Embalagem Embalagem { get; set; } | |
public string Produto { get; set; } | |
public decimal QtdeTotal { get; set; } | |
public static IEnumerable<Dto> Teste(ArmazemCtx context) | |
{ |
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> | |
/// Firebird possui limitação de 31 caracteres em nomes de tabelas, constraints, etc. | |
/// Esta convenção limita o nome do AssociationSet para 28 caracteres pois o Script SQL gerado para criação utiliza o AssociationSet.Name para | |
/// formar a constraint de chave estrangeira FK_{0}, associationSet.Name | |
/// </summary> | |
public class AssociationSetNamingConvention : IStoreModelConvention<AssociationSet> | |
{ | |
public void Apply(AssociationSet item, DbModel model) | |
{ | |
if (item.Name.Length <= 28) |
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
/********************************** | |
* Title: DataGridViewColumn Hosting MaskedTextBox | |
* Author: Juergen Thomas, Berlin (Germany) | |
* Email: [email protected] | |
* Environment: WinXP, NET 2.0 | |
* Keywords: DataGridViewColumn, | |
* DataGridViewMaskedTextColumn, | |
* DataGridViewMaskedTextCell, | |
* DataGridViewMaskedTextControl, | |
* DataGridViewTextBoxColumn, |
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
@if (TempData.ContainsKey("error")) | |
{ | |
<script>alert('@Html.Raw(TempData["error"].ToString())')</script> | |
} |
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 class Funcionario | |
{ | |
private ICalculadorDeBonus _calculador; | |
// setter público para a dependência possa ser alterada | |
public ICalculadorDeBonus Calculador { | |
get { | |
return _calculador ?? (_calculador = new BonificacaoPadrao()); | |
} | |
set { |
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
routes.IgnoreRoute("{*staticfile}", new { staticfile = @".*\.(css|js|txt|png|gif|jpg|jpeg|bmp)(/.*)?" }); | |
routes.IgnoreRoute("{*staticfile}", new { staticfile = ".*\\.(?i)(css|js|xml|txt|png|gif|jpg|jpeg|bmp|ico|woff|svg|ttf|eot)(\\/.*)?" }); | |
var error = Server.GetLastError(); //filterContext.Exception | |
var exception = error as HttpException ?? new HttpException("Error", error); | |
if (exception.GetHttpCode() == 404) | |
return; |