This file contains hidden or 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 <WiFiManager.h> // https://github.com/tzapu/WiFiManager | |
// select which pin will trigger the configuration portal when set to LOW | |
// ESP-01 users please note: the only pins available (0 and 2), are shared | |
// with the bootloader, so always set them HIGH at power-up | |
#define TRIGGER_PIN 0 | |
const char* modes[] = { "NULL", "STA", "AP", "STA+AP" }; | |
// WiFiManager wifiManager; |
This file contains hidden or 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 "WiFiManager.h" //https://github.com/tzapu/WiFiManager | |
#if defined(ESP32) | |
#include <WebServer.h> | |
using my_WebServer = WebServer; | |
#else | |
#include <ESP8266WebServer.h> | |
using my_WebServer = ESP8266WebServer; | |
#endif |
This file contains hidden or 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
// .h | |
#ifdef whatnot | |
std::unique_ptr<classA> theclass; | |
#else | |
std::unique_ptr<classB> theclass; | |
#endif | |
// .cpp | |
// How can I avoid using the actual classnames here | |
#ifdef whatnot |
This file contains hidden or 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
Adafruit_NeoMatrix matrix = Adafruit_NeoMatrix(4, 4, PIN, | |
NEO_MATRIX_TOP + NEO_MATRIX_LEFT + | |
NEO_MATRIX_ROWS + NEO_MATRIX_ZIGZAG, | |
NEO_GRB + NEO_KHZ800); |
This file contains hidden or 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
<?php | |
// This plugin is licensed under the GNU GPLv3 license | |
if(!defined("IN_MYBB")) | |
{ | |
die("Direct initialization of this file is not allowed."); | |
} | |
$plugins->add_hook("parse_message_end", "AddNoFollow_hook"); | |
function AddNoFollow_info() |
This file contains hidden or 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
<?php | |
/* ---------------------------------------------------------------------- | |
This code fragment and addition to the GetSimple config file is designed to provide the capability to use SMTP mail when sending from | |
the GetSimple core application, not from plugins. For example, when sending a mail generated by a user request to "Reset Password" | |
GetSimple uses the built in PHP Mail() function only. Many hosting environments are now requiring that PHP scripts only use SMTP for | |
security reasons and thus this suggested change... | |
------------------------------------------------------------------------- | |
STEP #1 - | |
Add the following 2 lines to GSConfig.php: |
This file contains hidden or 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
/** | |
* detect mutiple resets in order to trigger events using resets or power cycles alone | |
* reset board within resettimeout(5000ms) after boot and do so resetcnt(4) times | |
* has led indicator of reset window and serial output for better clarity | |
* | |
* This is blocking using a delay for timeout, can easily be changed to use a timer | |
* This is not wear leveled, but you could replace with spiffs(slower), or use a ring counter to level it | |
* You could also add a smaller window for reset by adding a pre-delay, to prevent reduce flash writes during glitchy or fast power cycles | |
* either way USE WITH CAUTION as you are writing twice every time your reset or repower the board, soft resets and wdt should not trigger this however. | |
* |
This file contains hidden or 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
uint8_t *pixels; // global pixel array | |
uint8_t NUMPIXELS = 8; // number of leds/pixels | |
uint8_t NUMBYTES = 3; // bytes per pixel, RGBW = 4, RGB = 3 | |
uint16_t BUFFBYTES = NUMPIXELS*NUMBYTES; // bytes to allocate for pixel array | |
void allocPixelArray(uint8_t numPixels,uint8_t numBytes){ | |
NUMPIXELS = numPixels; | |
NUMBYTES = numBytes; | |
BUFFBYTES = numPixels*numBytes; | |
Serial.println("allocating " + (String)BUFFBYTES + " bytes"); |
This file contains hidden or 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
// add to config.js editorconfig section. you can add ?path= query to this to use a subfolder | |
config.imageUploadUrl = "../admin/upload.php" | |
// add to config.js | |
CKEDITOR.on( 'instanceReady', function( ev ) { | |
// code for fileupload and response | |
ev.editor.on( 'fileUploadRequest', function( evt ) { | |
var fileLoader = evt.data.fileLoader, | |
formData = new FormData(), | |
xhr = fileLoader.xhr; |
This file contains hidden or 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
/** | |
* Arduino ESP8266 telnet server with some ansi experiments | |
* @author: shawn_a | |
*/ | |
#include <ESP8266WiFi.h> | |
#include <Arduino.h> | |
/* Set these to your desired AP credentials. */ | |
const char *APssid = "ESPap"; |