Skip to content

Instantly share code, notes, and snippets.

View fglaeser's full-sized avatar

Facundo Glaeser fglaeser

View GitHub Profile
@fglaeser
fglaeser / .editorconfig
Last active October 6, 2020 18:43
files-for-repo
# To learn more about .editorconfig see https://aka.ms/editorconfigdocs
# top-most EditorConfig file
root = true
# All files
[*]
indent_style = space
# cs files
@fglaeser
fglaeser / SqlBuilder.cs
Created November 2, 2018 12:59
DapperExtensions
public string BuildInsert<TEntity>(TEntity entity) where TEntity : class
{
var builder = new SqlBuilder();
var map = DapperExtensions.DapperExtensions.GetMap<TEntity>();
// /**select**/ -- has to be low case
var selectSupplierIdBuilder = builder.AddTemplate(string.Format("INSERT INTO {0} /**select**/ from {0} /**where**/ ", map.TableName));
builder.Select("Id");
builder.Where("Cityity", new { City = "Tokyo" }); // pass an anonymous object
return DapperExtensions.DapperExtensions.InstanceFactory(new DapperExtensionsConfiguration(
public class UnitTestModule : IClassFixture<PlatformApiTestFixture>
{
readonly PlatformApiTestFixture _platformFixture;
public UnitTestModule(PlatformApiTestFixture platformFixture)
{
Environment.SetEnvironmentVariable("ASPNETCORE_HOSTINGSTARTUPASSEMBLIES", "GoogleApiGateway");
_platformFixture = platformFixture;
}
[Fact]
@fglaeser
fglaeser / fix.cs
Created November 2, 2018 11:40
PlatformApiFixture
public class PlatformApiTestFixture : IDisposable
{
public TestServer _testServer;
public PlatformApiTestFixture()
{
}
private void InitServer()
{
@fglaeser
fglaeser / create-platform-repo.ps1
Last active May 22, 2021 19:34
create-platform-repo.ps1
<#
.SYNOPSIS
The script creates a github respository.
.DESCRIPTION
The script will create a github respository and it will add scripts for the correct initialization of a platform project.
#>
Param(
[Parameter(Mandatory=$False, Position=1, HelpMessage="Enter a repository name")]
[string]$Repo = $( Read-Host "Enter a repository name" ),
[Parameter(Mandatory=$False,Position=2)]
@fglaeser
fglaeser / build.cake
Last active March 22, 2019 18:36
build.cake
#tool nuget:?package=NUnit.ConsoleRunner&version=3.4.0
#tool "nuget:?package=GitVersion.CommandLine"
#tool nuget:?package=MSBuild.SonarQube.Runner.Tool
#addin nuget:?package=Cake.Sonar
#addin "nuget:?package=Cake.Incubator&version=3.0.0"
//////////////////////////////////////////////////////////////////////
// ARGUMENTS
//////////////////////////////////////////////////////////////////////
@fglaeser
fglaeser / build.sh
Created October 24, 2018 20:30
build.sh
#!/usr/bin/env bash
##########################################################################
# This is the Cake bootstrapper script for Linux and OS X.
# This file was downloaded from https://github.com/cake-build/resources
# Feel free to change this file to fit your needs.
##########################################################################
# Define directories.
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
@fglaeser
fglaeser / build.ps1
Created October 24, 2018 20:30
build.ps1
<#
.SYNOPSIS
This is a Powershell script to bootstrap a Cake build.
.DESCRIPTION
This Powershell script will download NuGet if missing, restore NuGet tools (including Cake)
and execute your Cake build script with the parameters you provide.
.PARAMETER Target
The build script target to run.
.PARAMETER Configuration
The build configuration to use.
@fglaeser
fglaeser / Jenkinsfile
Last active February 18, 2019 15:25
Jenkinsfile
#!/usr/bin/env groovy
pipeline {
environment {
MSBUILD14 = 'C:\\MSBuild\\14.0\\Bin\\MSBuild.exe'
BUILD_FOLDER = ".\\dist"
}
agent {
@fglaeser
fglaeser / buildenvironment.groovy
Created October 24, 2018 20:14
environment variables for Jenkins
#!/usr/bin/env groovy
// Nombre del servicio
env.SERVICE_NAME = '__SERVICE_NAME__'
//Completar para cada ambiente, nombre del servidor y carpeta de despliegue.
env.SERVER_PROD = "__SERVER_NAME__"
env.FOLDER_PROD = "__FOLDER__\\__SUBFOLDER__"
env.SERVER_TEST = "__SERVER_NAME:__"