Skip to content

Instantly share code, notes, and snippets.

View sebagomez's full-sized avatar
:octocat:
World's okayest tech lead

Sebastián Gómez sebagomez

:octocat:
World's okayest tech lead
View GitHub Profile

Keybase proof

I hereby claim:

  • I am sebagomez on github.
  • I am sebagomez (https://keybase.io/sebagomez) on keybase.
  • I have a public key whose fingerprint is 0136 EA14 4F1F 8437 81DA 8960 EF52 5CE1 E71B A0CD

To claim this, I am signing this object:

Verifying that "sebagomez.id" is my Blockstack ID. https://onename.com/sebagomez
@sebagomez
sebagomez / BinarySearch.cs
Last active February 13, 2017 18:00
C# Binary Search implementation
const int NOT_FOUND = -1;
static int Find(int[] arr, int num)
{
if (arr.Length == 0)
return NOT_FOUND;
if (arr.Length == 1)
return arr[0] == num ? 0 : NOT_FOUND;
int m = arr.Length / 2;
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
choco install 7zip /y
choco install docker-for-windows /y
choco install dotpeek /y
choco install git /y
choco install git-desktop /y
choco install googlechrome /y
choco install brave /y
choco install mousewithoutborders /y
@sebagomez
sebagomez / sqlserver.bat
Created March 14, 2018 19:50
Start SQL Server 2017 Docker instance
docker run --rm -p 1533:1433 -e ACCEPT_EULA=Y -e MSSQL_SA_PASSWORD=dbPassword! -e MSSQL_PID=Developer -d --name sqlserver microsoft/mssql-server-linux:2017-GA
@sebagomez
sebagomez / cleanup.bat
Created January 30, 2019 15:05
Remove danlging (<none>) docker images in Windows
powershell -Command "docker rmi $(docker images -q -f dangling=true)"
@sebagomez
sebagomez / GeneXusM.dockerfile
Last active February 8, 2019 15:43
Windows Container dockerfile
# escape=`
FROM microsoft/dotnet-framework:4.7.2-runtime
LABEL MAINTAINER="Seba Gómez <[email protected]>"
# GeneXus
COPY GeneXus/ c:/GeneXus
RUN C:/GeneXus/Genexus.com /install && `
powershell -Command "Copy-Item C:/Users/ContainerAdministrator/AppData/Roaming/GeneXus C:/Windows/SysWOW64/config/systemprofile/AppData/Roaming -Recurse"
@sebagomez
sebagomez / enable_https.ps1
Created February 1, 2019 15:23
Enable https via PowerShell
$cert = (New-SelfSignedCertificate -DnsName localhost -CertStoreLocation cert:Localmachine\My).Thumbprint
New-WebBinding -Name "Default Web Site" -IP "*" -Port 443 -Protocol https
Get-Item cert:\LocalMachine\MY\$cert | New-Item IIS:\SslBindings\0.0.0.0!443
@sebagomez
sebagomez / clean_kb.ps1
Last active March 13, 2019 14:15
Remove a Knwoledge Base (or many) with this PowerShell scipt
param(
[Parameter(Mandatory = $true)]
[string]$folder,
[Parameter(Mandatory = $false)]
[switch]$batch,
[Parameter(Mandatory = $false)]
[string]$sqlInstance=".\SQL2016"
@sebagomez
sebagomez / FlightNumParse.cs
Last active May 5, 2019 16:11
Flight number parser
public static (string airline, string number) Parse(string flightNumber)
{
string airline = "", number = "";
flightNumber = flightNumber.Trim().Replace(" ", "");
for (int i = 0; i < flightNumber.Length; i++)
{
char c = flightNumber[i];
if (c > 64 && string.IsNullOrEmpty(number))
airline += c;