Skip to content

Instantly share code, notes, and snippets.

View alexsandro-xpt's full-sized avatar

Alexsandro Souza Pereira alexsandro-xpt

View GitHub Profile
@giggio
giggio / docker-compose.yml
Last active January 25, 2024 15:23
Mirror Docker hub with Docker-compose
version: '3.7'
services:
dockerregistrymirror:
container_name: docker-registry-mirror
image: registry:2
ports:
- "443:443"
volumes:
- ./data/docker/var/lib/registry:/var/lib/registry
- ./data/certs:/certs
@davidfowl
davidfowl / Multitenancy.cs
Last active May 15, 2023 05:30
Multitenancy
using System;
using System.Collections.Generic;
using System.Threading;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
/*
- Don't need to support different services per tenant.
- Tenant services lifetime outlasts the request.
@vkhorikov
vkhorikov / 1.cs
Last active October 7, 2020 17:36
Value Object
public abstract class ValueObject<T>
where T : ValueObject<T>
{
public override bool Equals(object obj)
{
var valueObject = obj as T;
if (ReferenceEquals(valueObject, null))
return false;
@benaadams
benaadams / Microservice.cs
Last active May 20, 2020 13:11
Microservice Lib + App
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using System;
namespace MicroserviceLib
{
public class Microservice : Controller, IStartup
@benaadams
benaadams / Microservice.cs
Last active August 20, 2017 16:03
Microservice
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
public class Microservice : Controller
{
[HttpGet("/")]
public string Hello() => "Hello World";
@aggieben
aggieben / dotnet-versions
Last active July 20, 2017 21:52
List installed .NET Core SDK versions
#!/bin/sh
# Benjamin Collins <aggieben@gmail.com>
# Requires GNU readlink (get on macOS with `brew install coreutils`)
READLINK=${READLINK:-readlink}
cliPath=$(which dotnet)
netDir=$(dirname $($READLINK -f $cliPath))
ls -1 "$netDir/sdk"
@gutocosta
gutocosta / docker-compose.yml
Last active November 3, 2016 14:24
Docker Compose para Gitlab
version: '2'
services:
gitlab-eteabs:
image: 'gitlab/gitlab-ce:latest'
restart: always
hostname: 'xxxxx.intranet.xxxx.com.br'
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'https://xxxxx.intranet.xxxx.com.br'
@Dalmirog-zz
Dalmirog-zz / script.ps1
Last active November 28, 2016 13:51
Set App Pool Managed Pipeline Mode
$AppPoolName = "" #Name of your app pool
$Mode = "" #For "Integrated" set this value to "0" and for "Classic" set it to "1"
Import-Module WebAdministration
Get-ChildItem IIS:\AppPools | ?{$_.Name -eq $AppPoolName} | Select-Object -ExpandProperty PSPath | %{ Set-ItemProperty $_ managedPipelineMode $mode -Verbose}
@koistya
koistya / Schema.cs
Last active June 9, 2017 17:59
GraphQL with .NET Core, C#
namespace Example
{
public class RootQueryType
{
public Func<string> Hello { get; set; } = () => "world";
}
public class Schema
{
public RootQueryType Query { get; set; }