Skip to content

Instantly share code, notes, and snippets.

😎
Writting every day lines fo happy code

Alberto Monteiro AlbertoMonteiro

😎
Writting every day lines fo happy code
Block or report user

Report or block AlbertoMonteiro

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@AlbertoMonteiro
AlbertoMonteiro / lich_plumb_guid_alex_targaryen.md
Last active May 9, 2019
Lich plumb guid by Alex Targaryen
View lich_plumb_guid_alex_targaryen.md

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

View RestoreBackup.bat
"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
Build props to all visual studio projects
View Directory.Build.props
<?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 Mar 14, 2018
Restore Sql Server database from a script using sqlcmd
View restoredb.bat
"C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\SQLCMD.EXE" -S ".\sqlexpress" -i "C:\temp\RestoreDb.sql"
View MergeCsvFiles.cs
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 Mar 3, 2018
IEnumerable and Entity Framework
View Program.cs
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 Feb 15, 2018
Nurble PHP vs C#
View nurble.cs
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)
View ObjectSpread.cs
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
namespace Playground
{
public class Program
View IUnitOfWork.cs
public interface IUnitOfWork : IDisposable
{
#region UoW
Database Database { get; }
DbChangeTracker ChangeTracker { get; }
DbContextTransaction Transaction { get; }
DbContextConfiguration Configuration { get; }
DbSet Set(Type entityType);
DbSet<T> Set<T>() where T : class;
int SaveChanges();
You can’t perform that action at this time.