Skip to content

Instantly share code, notes, and snippets.

View AlbertoMonteiro's full-sized avatar
😎
Writting every day lines fo happy code

Alberto Monteiro AlbertoMonteiro

😎
Writting every day lines fo happy code
View GitHub Profile
@AlbertoMonteiro
AlbertoMonteiro / iframe.html
Last active April 30, 2016 16:38
Blocked a frame with origin
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Index</title>
</head>
<body>
<div>
<h1>This is a IFrame</h1>
public sealed class GeradorDeRelatorio : ServiceControl
{
private readonly CancellationTokenSource _cancellationTokenSource;
public GeradorDeRelatorio()
{
_cancellationTokenSource = new CancellationTokenSource();
}
public bool Start(HostControl hostControl)
@AlbertoMonteiro
AlbertoMonteiro / ChocolateyInstall.ps1
Created April 9, 2016 15:27
Install MsSqlServer2014Express Powershell
$packageName = "MsSqlServer2014Express"
$chocolateyTempDir = Join-Path (Get-Item $env:TEMP).FullName "chocolatey"
$tempDir = Join-Path $chocolateyTempDir $packageName
$fileFullPath = "$tempDir\SQLEXPR.exe"
$extractPath = "$tempDir\SQLEXPR"
$setupPath = "$extractPath\setup.exe"
$silentArgs = "/IACCEPTSQLSERVERLICENSETERMS /Q /ACTION=install /INSTANCEID=SQLEXPRESS /INSTANCENAME=SQLEXPRESS /UPDATEENABLED=FALSE"
$url = "https://download.microsoft.com/download/1/5/6/156992E6-F7C7-4E55-833D-249BD2348138/ENU/x86/SQLEXPR_x86_ENU.exe"
$url64 = "https://download.microsoft.com/download/1/5/6/156992E6-F7C7-4E55-833D-249BD2348138/ENU/x64/SQLEXPR_x64_ENU.exe"
@AlbertoMonteiro
AlbertoMonteiro / Requirements.md
Last active August 2, 2016 13:27
Requirements

Machine HD Size

At least 50 GB

Chocolatey Install

@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
choco feature enable -n allowGlobalConfirmation
@AlbertoMonteiro
AlbertoMonteiro / CalculoFator.md
Created March 18, 2016 12:36
Calculo de Fator

Novo fator = Novo valor * (1 + Fator antigo / 100)

@AlbertoMonteiro
AlbertoMonteiro / EnableIISCompresion.bat
Created January 26, 2016 04:26
Enable IIS Compresion
dism /online /get-features | MORE
dism /online /enable-feature /FeatureName:IIS-HttpCompressionDynamic /All
@AlbertoMonteiro
AlbertoMonteiro / Program.cs
Created January 13, 2016 20:06
LinhasDuplicadas no TeamCity
using System;
using System.Linq;
using System.Xml.Linq;
namespace Temp
{
public class Program
{
public static void Main(string[] args)
{
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
namespace Temp
{
public class Program
{
public static void Main(string[] args)
@AlbertoMonteiro
AlbertoMonteiro / DecompileMigrationScript.csx
Last active August 1, 2017 19:54
Decompile migration
#r "System.Xml"
#r "System.Xml.Linq"
#r "System.IO.Compression"
#r "System.Data"
using System.Xml.Linq;
using System.IO.Compression;
using System.Data.SqlClient;
public void DecompressDatabaseMigration(string migrationName, string databaseName)