Skip to content

Instantly share code, notes, and snippets.

@ashald
ashald / main.cpp
Created February 17, 2022 05:10
Monochrome drawing with epdiy
#include <Arduino.h>
#include "esp_log.h"
extern "C" {
#include "display_ops.h"
#include "epd_driver.h"
#include "lut.h"
}
#define FRAME_BUFFER_SIZE EPD_WIDTH*EPD_HEIGHT/8
@ashald
ashald / ble_address.h
Created January 19, 2022 23:14
ESPHome-based data exchange between nodes over BLE
#include "esphome.h"
#include <BLEDevice.h>
class BleAddress : public PollingComponent, public TextSensor {
public:
// constructor
BleAddress() : PollingComponent(15000) {}
float get_setup_priority() const override { return esphome::setup_priority::LATE; }
@ashald
ashald / Prepositions.md
Created August 31, 2019 09:26 — forked from hynek/Prepositions.md
Why English is Difficult vol. 42

From “Simply English – An A to Z of Avoidable Errors” by Simon Heffer:

Here are some of the most common mistakes with the choice of prepositions: they are often made when a demotic usage seeps into the consciousness of supposedly educated people. A person is absorbed in a task, not by it; but liquid may be absorbed by a sponge. One acquiesces in something, not with it, and one connives at something, not in it. One aims at something, not for it. One becomes angry with someone, not at him. One is ashamed of bad behaviour, not by it. A decision is between one thing and another, not one thing or another. One is bored by or with something, never of it. Something is different from something else, not to it or, even more abominable, than it. One is disgusted with something, not by it. One becomes fed up with things, not of them. Something is identical to something else, not with it. One inculcates something on somebody, one does not inculcate somebody with something;

@ashald
ashald / zipapp.md
Created November 28, 2018 16:03 — forked from lukassup/zipapp.md
Python zipapp

Python zipapp web apps

What's a zipapp?

This concept is very much like .jar or .war archives in Java.

NOTE: The built .pyz zipapp can run on both Python 2 & 3 but you can only build .pyz zipapps with Python 3.5 or later.

Initial setup

@ashald
ashald / test.sh
Created June 12, 2017 19:06 — forked from lianyi/test.sh
solr testing Transfer-Encoding: chunked
export SOLRUPDATE='http://localhost:8983/solr/testingCore/update?wt=json&commit=true'
export SOLRQUERY='http://localhost:8983/solr/testingCore/select?wt=json&q=*:*'
curl $SOLRUPDATE --data-binary '[{"id": "1"},{"id": "2"}]' -H 'Content-Type: application/json' -X POST -H "Transfer-Encoding: chunked"
#>> response {"responseHeader":{"status":0,"QTime":295}}
curl $SOLRQUERY
#>> {"responseHeader":{"status":0,"QTime":15,"params":{"q":"*:*","wt":"json"}},"response":{"numFound":2,"start":0,"maxScore":1.0,"docs":[{"id":"1","_version_":1570026155898044416},{"id":"2","_version_":1570026155878121472}]}}
@ashald
ashald / test.sh
Created June 12, 2017 19:06 — forked from lianyi/test.sh
solr testing Transfer-Encoding: chunked
export SOLRUPDATE='http://localhost:8983/solr/testingCore/update?wt=json&commit=true'
export SOLRQUERY='http://localhost:8983/solr/testingCore/select?wt=json&q=*:*'
curl $SOLRUPDATE --data-binary '[{"id": "1"},{"id": "2"}]' -H 'Content-Type: application/json' -X POST -H "Transfer-Encoding: chunked"
#>> response {"responseHeader":{"status":0,"QTime":295}}
curl $SOLRQUERY
#>> {"responseHeader":{"status":0,"QTime":15,"params":{"q":"*:*","wt":"json"}},"response":{"numFound":2,"start":0,"maxScore":1.0,"docs":[{"id":"1","_version_":1570026155898044416},{"id":"2","_version_":1570026155878121472}]}}
@ashald
ashald / ghost.tf
Created March 16, 2017 03:59
Ghost in the Container
variable "socket" {}
variable "BLOG_HOST" {}
variable "EMAIL_LETSENCRYPT" {}
variable "DOCKER_PREFIX" { default = "ghost" }
variable "image_letsencrypt" { default = "jrcs/letsencrypt-nginx-proxy-companion:v1.4" }
variable "image_nginx_proxy" { default = "jwilder/nginx-proxy:alpine" }
variable "image_ghost" { default = "ashald/alpine-ghost:hydrogen" }