This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
char buf[32]; | |
std::string ReadExpirationDate(X509* certificate) | |
{ | |
std::string timeString; | |
BIO* bmem = BIO_new(BIO_s_mem()); | |
if (ASN1_TIME_print(bmem, X509_get_notAfter(certificate))) { | |
BUF_MEM* bptr; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The author disclaims copyright to this source code. In place of | |
// a legal notice, here is a blessing: | |
// | |
// May you do good and not evil. | |
// May you find forgiveness for yourself and forgive others. | |
// May you share freely, never taking more than you give. | |
class YourViewController : UIViewController { | |
// add this method. | |
func sendDiscreetNotification(message: String) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Arduino.h> | |
#include <ArduinoNvs.h> | |
const bool LOG = true; | |
uint16_t minutesSinceBoot = 0; | |
bool doLogging = false; | |
void setup() | |
{ | |
// put your setup code here, to run once: | |
Serial.begin(115200); | |
pinMode(2, OUTPUT); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "soc/rtc_wdt.h" | |
void __attribute__((noreturn)) call_start_cpu0(void) | |
{ | |
rtc_wdt_protect_off(); //Disable RTC WDT write protection | |
//Set stage 0 to trigger a system reset after 1000ms | |
rtc_wdt_set_stage(RTC_WDT_STAGE0, RTC_WDT_STAGE_ACTION_RESET_RTC); // RTC_WDT_STAGE_ACTION_RESET_SYSTEM for regular reset. | |
rtc_wdt_set_time(RTC_WDT_STAGE0, 4000); | |
rtc_wdt_enable(); //Start the RTC WDT timer | |
rtc_wdt_protect_on(); //Enable RTC WDT write protection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Arduino.h> | |
#include <U8x8lib.h> | |
#include <Wire.h> | |
U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8(/* clock=*/PIN_WIRE_SCL, /* data=*/PIN_WIRE_SDA, /* reset=*/U8X8_PIN_NONE); // OLEDs without Reset of the Display | |
#define REED_SWITCH D10 | |
unsigned long rpms = 0; | |
void tick() | |
{ | |
static uint64_t previousTick = 0; |