Skip to content

Instantly share code, notes, and snippets.

View MathyV's full-sized avatar

Mathy Vanvoorden MathyV

View GitHub Profile
@MathyV
MathyV / cmake.rs
Last active February 21, 2023 21:15
A snippet of (what I believe) it currently takes to build a cmake project from Rust using esp-idf-sys
use std::env;
use anyhow::{anyhow, Result};
use embuild::{cargo, path_buf};
use embuild::cmake;
// This function is derived from the build system used in esp-idf-sys. Because esp-idf-sys is a
// dependency certain configuration is already propagated in ENV variables which is then reloaded by
// embuild using the try_from_env functions.
pub fn build(module: &str) -> Result<()> {
@MathyV
MathyV / jira_docker-compose.yml
Last active October 10, 2018 07:32
Jira setup with docker-compose, nginx proxy and letsencrypt
# Replace _ with / in filenames
version: '2'
services:
jira:
image: draca/atlassian-jira-software:7.7.0
environment:
# - DISABLE_NOTIFICATIONS=TRUE
- JIRA_ARGS=-Datlassian.plugins.enable.wait=300
- JIRA_PROXY_NAME=support.draca.be
- JIRA_PROXY_PORT=443
@MathyV
MathyV / push.py
Created March 22, 2018 19:30
Force push with pygit2
# I had a need to force update and push the master branch
# Took me a while to find this so I thought I'd share
# Just add a + in front of the branch name and it will work
branch = "refs/heads/master"
repo.create_reference(branch, "refs/heads/develop", force=True)
repo.remotes['origin'].push(['+' + branch], callbacks=callbacks);
@MathyV
MathyV / DoubleEquals.h
Created November 24, 2017 23:15
Double comparison with configurable precision in C++
#ifndef DOUBLEEQUALS_H
#define DOUBLEEQUALS_H
#include <cmath>
class DoubleEquals
{
private:
static constexpr int defaultPrecision = 8;
@MathyV
MathyV / keybase.md
Created October 2, 2014 18:27
keybase.md

Keybase proof

I hereby claim:

  • I am MathyV on github.
  • I am mathy (https://keybase.io/mathy) on keybase.
  • I have a public key whose fingerprint is EAF9 CAA6 BB83 3FE0 246C 9D14 E3A2 02FB 3E91 E3A7

To claim this, I am signing this object: