Skip to content

Instantly share code, notes, and snippets.

View me-no-dev's full-sized avatar
🎯
Focusing

Me No Dev me-no-dev

🎯
Focusing
View GitHub Profile
class SPIFFSEditor: public AsyncWebHandler {
private:
String _username;
String _password;
bool _uploadAuthenticated;
uint32_t _startTime;
public:
SPIFFSEditor(String username=String(), String password=String()):_username(username),_password(password),_uploadAuthenticated(false),_startTime(0){}
bool canHandle(AsyncWebServerRequest *request){
if(request->method() == HTTP_GET && request->url() == "/edit" && (SPIFFS.exists("/edit.htm") || SPIFFS.exists("/edit.htm.gz")))
#include "ESPAsyncWebServer.h"
#include "SPI.h"
#include "SD.h"
class AsyncSDFileResponse: public AsyncAbstractResponse {
private:
sd::File _content;
String _path;
void _setContentType(String path){
if (path.endsWith(".html")) _contentType = "text/html";
TARGET ?= $(notdir $(shell pwd))
PYTHON ?= python
HOME_DIR ?= $(shell echo ~)
ARDUINO_DIR ?= $(HOME_DIR)/arduino-1.6.8
ARDUINO_HARDWARE ?= $(ARDUINO_DIR)/hardware
ARDUINO_BUILDER ?= $(ARDUINO_DIR)/arduino-builder
ARDUINO_TOOLS ?= $(ARDUINO_DIR)/tools-builder
ARDUINO_LIBS ?= $(ARDUINO_DIR)/libraries
SKETCHBOOK_DIR ?= $(HOME_DIR)/Arduino
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char *argv[]){
FILE * fp;
char *buffer;
long flen;
char *fname;
#include <ESP8266WiFi.h>
#include <time.h>
const char * ssid = "********";
const char * password = "********";
#define getCompileTime() _getCompileTime(__DATE__, __TIME__)
struct tm * _getCompileTime(const char * compile_date, const char * compile_time){
const char * months[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
//File: edit.htm.gz, Size: 4924
#define edit_htm_gz_len 4924
const uint8_t edit_htm_gz[] PROGMEM = {
0x1F, 0x8B, 0x08, 0x08, 0xEC, 0x73, 0xBF, 0x57, 0x00, 0x03, 0x65, 0x64, 0x69, 0x74, 0x2E, 0x68,
0x74, 0x6D, 0x00, 0xC5, 0x1B, 0xE9, 0x7A, 0xD3, 0x48, 0xF2, 0x7F, 0x9E, 0xA2, 0x47, 0xEC, 0x10,
0x79, 0x7C, 0xE6, 0x20, 0x03, 0x4E, 0x02, 0x63, 0x3B, 0x81, 0x04, 0x72, 0x11, 0xDB, 0x30, 0x81,
0x65, 0xE7, 0x93, 0xA5, 0xB6, 0xAD, 0x44, 0x96, 0x84, 0x24, 0xC7, 0x0E, 0x6C, 0xDE, 0x7D, 0xAB,
0xFA, 0x52, 0x4B, 0x96, 0x4D, 0x80, 0xD9, 0x5D, 0x42, 0x62, 0xA9, 0xBB, 0xAA, 0xBA, 0xBA, 0xEE,
0x3E, 0xBC, 0xF7, 0xCB, 0xC1, 0x79, 0xA7, 0x77, 0x75, 0x71, 0x48, 0xC6, 0xC9, 0xC4, 0x7B, 0xBE,
#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"
#ifdef ESP32
#define ILI_CS 22
#define ILI_DC 21
#define ILI_RST 18
#define ILI_SCLK 19
#define ILI_MOSI 23
@me-no-dev
me-no-dev / AsyncTelnetServer.ino
Last active May 29, 2017 00:20
Single Client Telnet Server example
extern "C" {
enum sleep_type {
NONE_SLEEP_T = 0,
LIGHT_SLEEP_T,
MODEM_SLEEP_T
};
bool wifi_set_sleep_type(enum sleep_type type);
void system_set_os_print(uint8 onoff);
void ets_install_putc1(void* routine);
}
#include <WiFi.h>
#include <AsyncTCP.h>
const char* ssid = "your-ssid";
const char* password = "your-pass";
AsyncServer server(23);
typedef struct {
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <ArduinoOTA.h>
#include <FS.h>
#include <ESPAsyncTCP.h>
#include <ESPAsyncWebServer.h>
#include "SPI.h"
#include "SD.h"