Skip to content

Instantly share code, notes, and snippets.

@eduherminio
eduherminio / DockerCheatsheet.md
Last active September 23, 2021 13:34
Docker commands and shortcuts

Disclaimer: use under your own responsibility

Containers

Enter a container

docker exec -it <container> bash / docker exec -it <container> cmd

Attach standard input/output to container process, preventing ctrl+c to close it

docker attach --sig-proxy=false <container>

@eduherminio
eduherminio / ExtractVersion.ps1
Created February 6, 2020 23:02
Extract package version from .csproj using powershell
$packageToFind = "Xxxxx"
$found = (cat .\Project.csproj | Where { $_.Contains($packageToFind) }) -match '\d*\.\d*\.\d*'
if ($found) {
$packageVersion = $matches[0]
Write-Host "Package version for ${packageToFind}: $packageVersion"
}
else{
Write-Host "Package version for ${packageToFind} not found"
}
@eduherminio
eduherminio / nswag.json
Last active July 19, 2020 22:25
config.nswag sample
{
"runtime": "NetCore31",
"defaultVariables": null,
"documentGenerator": {
"aspNetCoreToOpenApi": {
"project": null,
"msBuildProjectExtensionsPath": null,
"configuration": null,
"runtime": null,
"targetFramework": null,
@eduherminio
eduherminio / gist:dfcd663a78a8ae2bc2602265d29e9c8e
Created September 22, 2018 12:53 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@eduherminio
eduherminio / Template.cpp
Last active February 12, 2017 01:07
C++ Competitive Programming Template
/*
* C++ Competitive Programming Template.
*
* Author: Eduardo Cáceres de la Calle
*
* Feel free to fork it and adapt it to your needs:
* https://gist.github.com/eduherminio/3466a18f8569460fe1012e67c1f58015
*/
#include <iostream>