Skip to content

Instantly share code, notes, and snippets.

View egomesbrandao's full-sized avatar
🏠
Working from home

Emmanuel G. Brandão egomesbrandao

🏠
Working from home
View GitHub Profile
Public Class Fornecedor
Implements IContrato
End Class
Public Interface IContrato
End Interface
Imports Ninject.Modules
@egomesbrandao
egomesbrandao / RunGallioTestsPS.ps1
Created May 2, 2011 20:08
Script Powershell para rodar os testes do MbUnit usando Gallio gerando e abrindo os relatórios em HTML
if ( (Get-PSSnapin -Name Gallio -ErrorAction SilentlyContinue) -eq $null )
{
Add-PsSnapin Gallio
}
$result = Run-Gallio "c:\[CAMINHO]\Test.dll" -ReportDirectory "c:[CAMINHO]\TestReports" -ReportTypes "Html" -ShowReports -Filter Type:@args[0]
if ($result.Statistics.FailedCount -gt 0)
{
Write-Warning "Some unit tests have failed."
@egomesbrandao
egomesbrandao / JQueryFnToRefac
Created July 6, 2012 01:48
Você consegue fazer Refactoring no código abaixo?
jQuery(function($) {
$('#new-status').on('submit', function() {
$.ajax({
url: '/statuses',
type: 'POST',
dataType: 'json',
data: {text: $(this).find('textarea').val()},
success: function(data) {
$('#statuses').append('<li>' + data.text + '</li>');
}
@egomesbrandao
egomesbrandao / PowershellRunnerHiddenConsole.vbs
Created July 13, 2012 13:12
VBScript para executar um script Powershell sem abrir a janela console
Dim objShell
Set objShell = CreateObject("WScript.Shell")
strCMD = "powershell -sta -noProfile -NonInteractive -nologo -command " & Chr(34) & "C:\Script.ps1" & Chr(34)
objShell.Run strCMD,0
'Fonte: http://www.leporelo.eu/blog.aspx?id=run-scheduled-tasks-with-winform-gui-in-powershell
@egomesbrandao
egomesbrandao / gist:4032533
Created November 7, 2012 16:16
Cara da informática e gestor

(Em português de Portugal, mas...)

Um homem está a conduzir o seu carro, quando a certa altura percebe que se perdeu. Dá conta de outro homem que passa por perto, encosta ao passeio e chama-o:

  • Desculpe, pode dar-me uma ajuda? Prometi a um amigo encontrar-me com ele às 14h, estou meia hora atrasado e não sei onde me encontro.
  • Claro que o posso ajudar. O senhor encontra-se num automóvel, entre os 38 e os 39 graus de latitude norte e os 9 e 10 graus de longitude oeste, são 14 horas, 23 minutos e 42 segundos, hoje é quarta-feira e estão 27 graus centígrados.
  • O senhor é informático?
  • Exatamente! Como é que sabe?
  • Porque tudo o que me disse está correto do ponto de vista técnico, mas é inútil do ponto de vista prático. De facto, não sei o que fazer com a informação que me deu e continuo aqui perdido.
  • Então o senhor deve ser um gestor, certo? - responde o informático
  • Na realidade sou mesmo. Mas. como percebeu?
@egomesbrandao
egomesbrandao / CIPE0001.cs
Created September 17, 2013 14:01
Série: Código idiota... programador estúpido!
public static bool verificaArquivoTxt()
{
return (File.Exists(System.Configuration.ConfigurationManager.AppSettings["ArqTxt"].ToString()));
}
bool verif = verificaArquivoTxt();
if (verif == true)
{
dt = LeituraTXT();
Obj.EnviarDados(dt);
@egomesbrandao
egomesbrandao / CIPE0002.cs
Created September 24, 2013 17:42
Série: Código idiota... programador estúpido!
Data.BusinessData.Resource resource =
Data.BusinessData.Resource.Get(dataContext, SOResource.resource);
if (resource.serialNumber == null)
{
Data.BusinessData.Resource resource_ =
new Data.BusinessData.Resource();
resource_.serialNumber = Convert.ToString("");
resource.serialNumber = resource_.serialNumber;
}
@egomesbrandao
egomesbrandao / ParcialWIT.xml
Last active August 29, 2015 14:16
One Team Project... ou usando o campo Team field - Adicionando campo team field nos WIT's
<FIELDS>
. . .
<FIELD name="Team" refname="MinhaEmpresa.Team" type="String" reportable="dimension">
<HELPTEXT>Name of the Project.</HELPTEXT>
<ALLOWEXISTINGVALUE />
<ALLOWEDVALUES >
<GLOBALLIST name="Teams" />
</ALLOWEDVALUES >
<DEFAULT from="value" value="Não Cadastrado" />
</FIELD>
@egomesbrandao
egomesbrandao / GlobalList.xml
Last active August 29, 2015 14:16
One Team Project... ou usando o campo Team field - Global List
<?xml version="1.0" encoding="utf-8"?>
<gl:GLOBALLISTS xmlns:gl="http://schemas.microsoft.com/VisualStudio/2005/workitemtracking/globallists">
<GLOBALLIST name="Teams">
<LISTITEM value="Não cadastrado" />
<LISTITEM value="01234 - Projeto XYZ" />
<LISTITEM value="98765 - Projeto ABC" />
<LISTITEM value="Projeto de teste" />
</GLOBALLIST>
</gl:GLOBALLISTS>
@egomesbrandao
egomesbrandao / gist:1bef0ebe6fcf34006e6e
Created March 10, 2015 05:02
One Team Project... ou usando o campo Team field - Exportando WIT's
witadmin exportwitd /collection:http://localhost:8080/tfs/DefaultCollection /p:"Minha empresa OTP" /n:"User story" /f:c:\YTemp\TeamfieldCustom\UserStory.xml
witadmin exportwitd /collection:http://localhost:8080/tfs/DefaultCollection /p:"Minha empresa OTP" /n:"Bug" /f:c:\YTemp\TeamfieldCustom\Bug.xml
witadmin exportwitd /collection:http://localhost:8080/tfs/DefaultCollection /p:"Minha empresa OTP" /n:"Task" /f:c:\YTemp\TeamfieldCustom\Task.xml
witadmin exportwitd /collection:http://localhost:8080/tfs/DefaultCollection /p:"Minha empresa OTP" /n:"Test Plan" /f:c:\YTemp\TeamfieldCustom\TestPlan.xml