Instantly share code, notes, and snippets.

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"
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>
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));
View Program.cs
using System;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
namespace ConsoleApp2
{
class Program
{
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();
View disableconstraints.sql
EXEC sp_msforeachtable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
EXEC sp_msforeachtable 'ALTER TABLE ? WITH CHECK CHECK CONSTRAINT all'
View docker events output.md
2017-12-13T15:00:18.059385800-03:00 container create 07b3ae560d416356673e4fa8ae1a2bd4fe6ebf69a3f5e35fd015fb30f3236d52 (image=microsoft/dotnet-framework, name=sleepy_gates)
2017-12-13T15:00:18.066377500-03:00 container attach 07b3ae560d416356673e4fa8ae1a2bd4fe6ebf69a3f5e35fd015fb30f3236d52 (image=microsoft/dotnet-framework, name=sleepy_gates)
2017-12-13T15:00:18.129877400-03:00 network connect e47d6abe799d43547cad0f7bb60ee0ab0525b169af5da925fa2d2fcf789f9afd (container=07b3ae560d416356673e4fa8ae1a2bd4fe6ebf69a3f5e35fd015fb30f3236d52, name=none, type=null)
2017-12-13T15:00:47.920780100-03:00 container start 07b3ae560d416356673e4fa8ae1a2bd4fe6ebf69a3f5e35fd015fb30f3236d52 (image=microsoft/dotnet-framework, name=sleepy_gates)
2017-12-13T15:00:50.979503000-03:00 container die 07b3ae560d416356673e4fa8ae1a2bd4fe6ebf69a3f5e35fd015fb30f3236d52 (exitCode=0, image=microsoft/dotnet-framework, name=sleepy_gates)
2017-12-13T15:00:51.000501000-03:00 network disconnect e47d6abe799d43547cad0f7bb60ee0ab0525b169af5da925fa2d2