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 / install.bat
Last active September 26, 2016 13:57
Application Insights
mkdir C:\temp
@powershell -NoProfile -ExecutionPolicy Bypass -Command "(New-Object System.Net.WebClient).DownloadFile('http://download.microsoft.com/download/F/4/2/F42AB12D-C935-4E65-9D98-4E56F9ACBC8E/wpilauncher.exe', 'C:\\temp\\wpilauncher.exe')"
C:\temp\wpilauncher.exe
cd "C:\Program Files\microsoft\Web Platform Installer"
WebPICMD.exe /Install /Products:"ApplicationInsightsStatusMonitor" /AcceptEULA
@AlbertoMonteiro
AlbertoMonteiro / badge.svg
Last active September 22, 2016 14:48
SVG Badge
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@AlbertoMonteiro
AlbertoMonteiro / readme.md
Last active August 17, 2021 02:50
AWS Importing and Exporting SQL Server Databases
@AlbertoMonteiro
AlbertoMonteiro / EnableQueryCustomAttribute.cs
Last active July 30, 2016 14:25
Custom EnableQueryAttribute to enable odata $inlinecount
using System;
using System.Linq;
using System.Net.Http;
using System.Web.Http.Filters;
using System.Web.Http.OData;
using static System.Activator;
using static System.Net.HttpStatusCode;
namespace Conecta2.Web.Infraestrutura.Filter
{
@AlbertoMonteiro
AlbertoMonteiro / config.json
Last active June 20, 2016 02:54
TypeScript com JSPM
{
"paths": {
"github:*": "../wwwroot/jspm_packages/github/*",
"npm:*": "../wwwroot/jspm_packages/npm/*"
},
"packages": {
"../wwwroot/src": {
"defaultExtension": "ts",
"meta": {
mkdir c:\cfn
mkdir c:\cfn\log
mkdir "c:\Program Files\Amazon\ElasticBeanstalk\Tools"
:loop
powershell.exe -Command "(New-Object System.Net.WebClient).DownloadFile('https://s3.amazonaws.com/elasticbeanstalk-env-resources-us-east-1/stalks/eb_iis_v1_4.0.4.23.1/lib/Bootstrap.ps1', 'c:\Program Files\Amazon\ElasticBeanstalk\Tools\Bootstrap.ps1')"
if %errorlevel% neq 0 goto loop
powershell.exe -ExecutionPolicy Bypass -File "C:\Program Files\Amazon\ElasticBeanstalk\Tools\Bootstrap.ps1" us-east-1 cloudformati url
set /p HANDLE=<c:\cfn\wait-condition-handle.txt
c:\"Program Files"\Amazon\cfn-bootstrap\cfn-signal -e 0 "%HANDLE%" > c:\cfn\log\cfn-signal-call-log 2>&1
@AlbertoMonteiro
AlbertoMonteiro / validacaoCpfCnpj.js
Created May 27, 2016 19:02
Validação CPF/CNPJ em Javascript
function validaCnpj(cnpj) {
var multiplicadores = [6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2];
return isValidCP(cnpj, multiplicadores, 14);
}
function validaCpf(cpf) {
var multiplicadores = [11, 10, 9, 8, 7, 6, 5, 4, 3, 2];
return isValidCP(cpf, multiplicadores, 11);
}
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Data.Entity.Validation;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using NSubstitute;
using Xunit;