Skip to content

Instantly share code, notes, and snippets.

View AKRFranko's full-sized avatar

Franko AKRFranko

View GitHub Profile
@AKRFranko
AKRFranko / AsyncSDServer.ino
Created November 6, 2020 15:08 — forked from pim-borst/AsyncSDServer.ino
Serve files from an SD-card using Me No Dev's async webserver for the ESP8266.
/*
* Example how to serve files from an SD-card using Me No Dev's async webserver for the ESP8266.
* See https://github.com/me-no-dev/ESPAsyncWebServer
*
* Basically I copied the code for serving static files from SPIFFS and modified it for the SD library.
* To resolve conflicts between SPIFFS and SD File classes I had to include the sd namespace in SD.h and SD.cpp in packages/esp8266/hardware/esp8266/2.3.0/libraries/SD/src.
* So in SD.h put "namespace sd { ... }; using namespace sd;" around everything excluding the # preprocessor directives.
* And in SD.cpp put "namespace sd { ... };" around everything excluding the # preprocessor directives.
*
* Also, don't forget to fill in your WiFi SSID and password and put an index.htm file on your SD card.
# This script work on any system using systemd as the init process.
# It works on Debian/Raspbian Jessie.
# If you have Debian/Rapbian Wheezy and want to use this script with systemd
# follow the information here : https://wiki.debian.org/systemd
# To easily download, install and set at startup:
# wget -O /tmp/download https://gist.github.com/Belphemur/3f6d3bf211b0e8a18d93/download && sudo tar -zxf /tmp/download --strip-components 1 -C /etc/systemd/system/ && sudo systemctl --reload-daemon && sudo systemctl enable Node-RED
# To consult the log : journalctl -u Node-RED
[Unit]
@AKRFranko
AKRFranko / google_spreadsheets_create_update_example.py
Created September 26, 2017 18:31 — forked from pahaz/google_spreadsheets_create_update_example.py
Python Google spreadsheets v4 API example. Google spreadsheet access management example. Use google drive v3 API for access management
"""Google spreadsheet related.
Packages required: oauth2client, google-api-python-client
* https://gist.github.com/miohtama/f988a5a83a301dd27469
"""
from oauth2client.service_account import ServiceAccountCredentials
from apiclient import discovery
def get_credentials(scopes: list) -> ServiceAccountCredentials:
@AKRFranko
AKRFranko / specification.js
Created April 9, 2016 01:07 — forked from acanimal/specification.js
Specification pattern in JavaScript
"use strict";
/**
* Specification base class
* @class
*/
var Specification = {
and: function(spec) {
return new AndSpecification(this, spec);
},
@AKRFranko
AKRFranko / lets-chat-with-a-hubot.sh
Created March 20, 2016 11:46
Install lets-chat, create two rooms, and a hubot that joins both of the rooms.
#!/bin/bash
# Install lets-chat, create two rooms, and a hubot that joins
# both of the rooms. Tested on an AWS EC2 instance using the Linux AMI.
# Pete Thomas <pete.thomas@gmail.com>, @peterthomas
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
We couldn’t find that file to show.