Skip to content

Instantly share code, notes, and snippets.

View ashmckenzie's full-sized avatar

Ash McKenzie ashmckenzie

View GitHub Profile
# Used to graph results from autobench
#
# Usage: ruby autobench_grapher.rb result_from_autobench.tsv
#
# This will generate three svg & png graphs
require "rubygems"
require "scruffy"
require 'csv'
require 'yaml'
@ashmckenzie
ashmckenzie / .port
Created July 12, 2012 05:06 — forked from tommeier/.port
Install local ssl with pow
5000
@ashmckenzie
ashmckenzie / build-tmux.sh
Last active May 17, 2016 01:43 — forked from philipsoutham/build-tmux.sh
Build static tmux
#!/usr/bin/env bash
pushd $(dirname $0) > /dev/null; CURRABSPATH=$(readlink -nf "$(pwd)"); popd > /dev/null; # Get the directory in which the script resides
set -x
MUSLPKG="musl:musl.tgz:http://www.musl-libc.org/releases/musl-1.1.4.tar.gz"
LEVTPKG="libevent:libevent2.tgz:https://cloud.github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz"
TMUXPKG="tmux:tmux.tgz:https://github.com/tmux/tmux/releases/download/1.9a/tmux-1.9a.tar.gz"
NCRSPKG="ncurses:ncurses.tgz:http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz"
TEMPDIR="$CURRABSPATH/tmp"
TMPLIB="tempinstall/lib"
TMPINC="tempinstall/include"
@ashmckenzie
ashmckenzie / CustomSleepComponent.h
Created August 9, 2020 12:15 — forked from ofalvai/CustomSleepComponent.h
Custom ESPHome deep sleep component that's controlled via MQTT (adjustable sleep duration, sleep enter trigger)
#include "esphome.h"
#include "driver/rtc_io.h"
class CustomSleepComponent : public Component, public CustomMQTTDevice {
public:
void setup() override {
subscribe(TOPIC_SLEEP_DURATION, &CustomSleepComponent::on_sleep_duration_message);
subscribe(TOPIC_SLEEP_PREVENT, &CustomSleepComponent::on_prevent_message);
subscribe(TOPIC_SLEEP_ENTER, &CustomSleepComponent::on_enter_message);