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 / profiles.json
Created March 19, 2020 20:53
Windows Terminal Configuration
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"alwaysShowTabs": true,
"initialCols": 120,
"initialRows": 30,
"profiles": [
{
@AlbertoMonteiro
AlbertoMonteiro / defaultInterface.cs
Created January 28, 2020 16:45
Default Interface Implementation C# 8
interface ICalculator
{
int Add(int a, int b) => a + b;
}
interface ISuperCalculator
{
int Add(int a, int b) => a * 2 + b * 2;
}
@AlbertoMonteiro
AlbertoMonteiro / lich_plumb_guid_alex_targaryen.md
Last active May 9, 2019 21:10
Lich plumb guid by Alex Targaryen

Lich siege guide

In the current meta, the lich siege is a very efficient way to take down ANY defense for nothing. Even if your opponent is a huge whale, all you need is energy and revive pots. Now how does it work?

There are several variants to the lich siege so I will start by explaining you the most basic one.

Frontline full of silver marauders, backline silver acolytes and heroes. Why is it so strong? Firstly, undead troops don’t lose morale, are many, and they also don’t get affected by poison. Their only counter are zone damage troops, but gazul will anyways resurrect them once they get killed. Secondly, even if your skeletons die, they are extremely cheap and your acolytes will plunder ressources like crazy so you won’t suffer any losses. Moreover, their training time is very low so you can just use free rush to build them again and again. The most important and difficult part is to choose the heroes. You might need or not need some of them depending on your target.

I will tell you how to build

"C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\SQLCMD.EXE" -S localhost -i "C:\Users\Alberto\Documents\SQL Server Management Studio\RestoreDb.sql"
@AlbertoMonteiro
AlbertoMonteiro / Directory.Build.props
Created May 9, 2018 17:48
Build props to all visual studio projects
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<LangVersion>7.1</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
</Project>
@AlbertoMonteiro
AlbertoMonteiro / restoredb.bat
Created March 14, 2018 12:48
Restore Sql Server database from a script using sqlcmd
"C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\SQLCMD.EXE" -S ".\sqlexpress" -i "C:\temp\RestoreDb.sql"
File.WriteAllLines(@"e:\resumo.txt", Directory.EnumerateFiles(@"E:\dados", "*.txt", SearchOption.AllDirectories)
.SelectMany(File.ReadLines)
.Select(s => s.Trim())
.Where(s => !string.IsNullOrWhiteSpace(s))
.Distinct()
.OrderBy(x => x));
@AlbertoMonteiro
AlbertoMonteiro / Program.cs
Last active March 3, 2018 18:21
IEnumerable and Entity Framework
using System;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
namespace ConsoleApp2
{
class Program
{
@AlbertoMonteiro
AlbertoMonteiro / nurble.cs
Last active February 15, 2018 17:47
Nurble PHP vs C#
using System;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
class Nurblizador
{
private static string[] _nouns = File.ReadAllText("nouns.txt").Split("\n");
static string Nurble(string text)