Skip to content

Instantly share code, notes, and snippets.

View ennerperez's full-sized avatar
💭
If Coffee Then Code

Enner Pérez ennerperez

💭
If Coffee Then Code
View GitHub Profile
@ennerperez
ennerperez / dbo_getlocaldate.sql
Last active October 29, 2019 16:56
SA Pacific Standard Time
CREATE FUNCTION GETLOCALDATE()
RETURNS datetime
AS
BEGIN
DECLARE @D datetimeoffset;
SET @D = CONVERT(datetimeoffset, SYSDATETIMEOFFSET()) AT TIME ZONE 'SA Pacific Standard Time';
RETURN(CONVERT(datetime,@D));
END
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
@ennerperez
ennerperez / WixApplicationGenerator.cs
Last active July 11, 2019 06:00
Wix Application File Autogenerator
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text.RegularExpressions;
using System.Xml.Serialization;
internal class Program
{
@ennerperez
ennerperez / DynamicProcessor.cs
Created June 8, 2019 17:11
Dynamic C# Runtime Code Processor
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.Loader;
using System.Text.RegularExpressions;
//
// Microsoft.CodeAnalysis.CSharp
@ennerperez
ennerperez / General.cs
Created March 28, 2019 19:32
Database Test
using EFCore.BulkExtensions;
using Infraestructura.Datos;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Nucleo.Administracion.Entidades;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using Xunit;
@ennerperez
ennerperez / initrepo.ps1
Last active September 19, 2019 15:20
Repo Initializer
param (
[string]$folder = $( Read-Host "Input repo folder" )
)
# folders
new-item $folder\src -itemtype directory
new-item $folder\src\.files -itemtype directory
new-item $folder\docs -itemtype directory
# gitignore+gitattributes
@ennerperez
ennerperez / build.cake
Last active September 10, 2019 16:27
Generic Build Cake Script
param (
[string]$folder = $( Read-Host "Input repo folder" )
)
# folders
new-item $folder\src -itemtype directory
new-item $folder\src\.files -itemtype directory
new-item $folder\docs -itemtype directory
# gitignore+gitattributes
@ennerperez
ennerperez / BrandingSchema.xsd
Last active August 1, 2018 05:50
Product Branding Schema
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="BrandingSchema"
targetNamespace="http://www.w3.org/2018/brandingSchema"
elementFormDefault="qualified"
xmlns="http://www.w3.org/2018/brandingSchema"
xmlns:mstns="http://www.w3.org/2018/brandingSchema"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:annotation>
<xs:documentation>
@ennerperez
ennerperez / RemoveWin10DefaultApps.ps1
Last active May 10, 2018 14:04 — forked from tkrotoff/RemoveWin10DefaultApps.ps1
Remove Windows 10 default apps
# See Remove default Apps from Windows 10 https://thomas.vanhoutte.be/miniblog/delete-windows-10-apps/
# See Debloat Windows 10 https://github.com/W4RH4WK/Debloat-Windows-10
# Command line to list all packages: Get-AppxPackage -AllUsers | Select Name, PackageFullName
Get-AppxPackage Microsoft.Windows.ParentalControls | Remove-AppxPackage
Get-AppxPackage Windows.ContactSupport | Remove-AppxPackage
Get-AppxPackage Microsoft.Xbox* | Remove-AppxPackage
Get-AppxPackage microsoft.windowscommunicationsapps | Remove-AppxPackage # Mail and Calendar
#Get-AppxPackage Microsoft.Windows.Photos | Remove-AppxPackage
Get-AppxPackage Microsoft.WindowsCamera | Remove-AppxPackage
@ennerperez
ennerperez / MSSQLPaths.sql
Created June 29, 2017 14:57
Microsoft SQL Server TSQL Paths
SET NOCOUNT ON;
DECLARE @key NVARCHAR(MAX)= N'Software\Microsoft\MSSQLServer\'+@@servicename+'';
CREATE TABLE #paths
([value] NVARCHAR(MAX),
[data] NVARCHAR(MAX)
);
INSERT INTO #paths
EXEC master.dbo.xp_instance_regread
N'HKEY_LOCAL_MACHINE',
N'Software\Microsoft\MSSQLServer\Setup',