Skip to content

Instantly share code, notes, and snippets.

@ridencww
ridencww / gist:c1d82c76966c68f3b011
Created August 15, 2015 03:44
JUnit test that verifies that a class cannot be instantiated
Given class...
public class MyClass {
private MyClass() throws InstantiationException {
throw new InstantiationException("Instances of this type are forbidden.");
}
...
@ridencww
ridencww / SerialPrintf.txt
Last active June 12, 2023 19:12
Basic printf functionality for the Arduino serial ports
/*
* Simple printf for writing to an Arduino serial port. Allows specifying Serial..Serial3.
*
* const HardwareSerial&, the serial port to use (Serial..Serial3)
* const char* fmt, the formatting string followed by the data to be formatted
*
* int d = 65;
* float f = 123.4567;
* char* str = "Hello";
* serial_printf(Serial, "<fmt>", d);