Skip to content

Instantly share code, notes, and snippets.

Avatar

Iván Stepaniuk istepaniuk

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

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 Nov 2, 2018
Docker command line cheatsheet
View docker.md

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)

View isputty.sh
#!/bin/bash
REPLY="noputty"
echo -e "\005"
read -n 5 -t 1
if [ "$REPLY" == "PuTTY" ] ; then
echo " :Terminal is PuTTY"
TERM=linux
echo
fi
View gist:afd7808b03915875e211
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-
View gist:21d00a38a0b05ac48a28
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 Dec 10, 2015
Exception cheking using FluentAssertions
View FluentExceptionCheck.cs
[TestMethod()]
public void ThrowsAnExceptionIfItIsNotAFruit()
{
var service = new FruitColorService();
Action action = () => service.GetColorOf(new Tomato());
action.ShouldThrow<InvalidFruitException>();
}