Skip to content

Instantly share code, notes, and snippets.

View abrugsch's full-sized avatar

Alistair abrugsch

  • UK
View GitHub Profile
replaces about 75% of moq calls with NSubstitute equivalents (taken from the moq issue thread discussing open source funding)
Replace "using Moq;" with "using NSubstitute;" (non-regex)
Replace "new Mock<(.*?)>()" with "Substitute.For<$1>()" (Regex)
Replace "Mock<(.*?)>" with "$1" (Regex)
Replace ".Setup(x => x." with "." (non-regex)
Replace ").ReturnsAsync(" with ".Returns(" (non-regex)
Replace "It.IsAny<" with "Arg.Any<" (non-regex)
Replace "It.IsAny<" with "Arg.Any<" (non-regex)
Replace "(\w+.)Verify(x => x.(\w+)((.*?)), Times.Once())" with "await $1Received(1).$2($3)" (Regex)
@abrugsch
abrugsch / RPiPinout.py
Last active May 24, 2018 20:54
raspberry pi pinout dictionary
#from reddit user /u/Grorco and thread https://www.reddit.com/r/raspberry_pi/comments/8lrgsk/raspberry_pi_pinout_dictionary/
def pinoutdict():
"""This returns a dictionary for Raspberry Pi 3 Model B, B+, RPI2 40Pin GPIO pinout.
Keys are ints of the GPIO.BOARD value, values are a list of pin properties."""
pinout = {1:['3.3v'],
2:['5v'],
3:['GPIO','02','SDA1','I2C'],
4:['5v'],
5:['GPIO','03','SCL1','I2C'],
6:['GND'],