Skip to content

Instantly share code, notes, and snippets.

View istepaniuk's full-sized avatar

Iván Stepaniuk istepaniuk

View GitHub Profile
@istepaniuk
istepaniuk / REST-DDD-charla-connectsai.md
Last active October 19, 2020 22:37
Domain-driven Design & REST: ¿Amigos o enemigos?

REST vs. DDD

Al implementar DDD, solemos chocar de frente con cómo se diseñan habitualmente las APIs REST. ¿Estamos haciendo algo mal?

Hemos debatido un poco sobre los puntos en los que choca la expresividad de nuestro dominio con el diseño de una API realmente RESTful (no RESTish).

Se han expuesto varias alternativas:

1. Hacer POST /commands

@istepaniuk
istepaniuk / docker.md
Last active November 2, 2018 03:20
Docker command line cheatsheet

Docker cheatsheet

Run a new container in the foregrond

docker run -ti image

Stop, delete all docker containers

docker stop $(docker ps -a -q)

docker rm $(docker ps -a -q)

#!/bin/bash
REPLY="noputty"
echo -e "\005"
read -n 5 -t 1
if [ "$REPLY" == "PuTTY" ] ; then
echo " :Terminal is PuTTY"
TERM=linux
echo
fi
@istepaniuk
istepaniuk / gist:afd7808b03915875e211
Created November 2, 2015 12:53
Intel wifi XPS13
02:00.0 Network controller: Intel Corporation Wireless 7265 (rev 59)
Subsystem: Intel Corporation Dual Band Wireless-AC 7265
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin A routed to IRQ 49
Region 0: Memory at f7000000 (64-bit, non-prefetchable) [size=8K]
Capabilities: [c8] Power Management version 3
Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold+)
Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
with description('something'):
with before.each:
self.something = Something()
with description('when we wanna reproduce the bug'):
with before.each:
self.something.do_work()
with it('swallows exceptions'):
pass
@istepaniuk
istepaniuk / FluentExceptionCheck.cs
Last active December 10, 2015 01:58
Exception cheking using FluentAssertions
[TestMethod()]
public void ThrowsAnExceptionIfItIsNotAFruit()
{
var service = new FruitColorService();
Action action = () => service.GetColorOf(new Tomato());
action.ShouldThrow<InvalidFruitException>();
}