Skip to content

Instantly share code, notes, and snippets.

View unixunion's full-sized avatar

Kegan Holtzhausen unixunion

View GitHub Profile
/*
Copyright (c) 2023 Kegan Holtzhausen
Foot controls for common translation software, back, pause/play, advance
Requires a hoodloader2 flashed UNO or other suitable microcontroller
Switches are wired to the ICSP header of the 16u2 on the UNO ( official models ).
Some knockoffs do not have the second header.
*/
#include <Arduino.h>
#include <EEPROM.h>
#include <Sparkfun_TB6612.h>
// motor driver pins
#define PWMA 9
#define AIN2 8
#define AIN1 7
#define STBY 6
#define BIN1 5
@unixunion
unixunion / merge.rs
Created February 22, 2019 15:34
Rust merging json
#[macro_use]
extern crate serde_json;
use serde_json::Value;
fn merge(a: &mut Value, b: &Value) {
match (a, b) {
(&mut Value::Object(ref mut a), &Value::Object(ref b)) => {
for (k, v) in b {
merge(a.entry(k.clone()).or_insert(Value::Null), v);
@unixunion
unixunion / haproxy_exporter
Last active January 18, 2019 08:58
haproxy_exporter init script for systemd
#!/bin/sh
### BEGIN INIT INFO
# Provides: haproxy
# Required-Start: $local_fs $network $remote_fs $syslog $named $haproxy
# Required-Stop: $local_fs $remote_fs $syslog $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: fast and reliable load balancing reverse proxy
# Description: This file should be used to start and stop haproxy.
### END INIT INFO
@unixunion
unixunion / upgrade-requirements.sh
Created March 27, 2017 09:07
pip upgrade all packages
pip install --upgrade pip
pip freeze | awk -F "==" '{print $1;}' | xargs -I{} pip install --upgrade {}
package com.deblox.greatsnipe.git.impl;
import com.deblox.greatsnipe.git.GitServerProvider;
import io.vertx.core.Handler;
import io.vertx.core.Vertx;
import io.vertx.core.json.JsonObject;
import io.vertx.core.logging.Logger;
import io.vertx.core.logging.LoggerFactory;
import org.gitlab.api.GitlabAPI;
import org.gitlab.api.models.GitlabProject;
package com.deblox.greatsnipe.git;
import io.vertx.core.Handler;
import io.vertx.core.Vertx;
import java.io.IOException;
import java.net.MalformedURLException;
/**
* provider to be extended / implemented in specific supported API's
package com.deblox.greatsnipe.git.impl;
import com.deblox.greatsnipe.git.GitServerProvider;
import io.netty.handler.codec.http.HttpHeaders;
import io.vertx.core.Handler;
import io.vertx.core.Vertx;
import io.vertx.core.http.HttpClient;
import io.vertx.core.http.HttpClientRequest;
import io.vertx.core.json.JsonObject;
import io.vertx.core.logging.Logger;
package com.deblox.clustering;
import io.vertx.core.Handler;
import io.vertx.core.eventbus.Message;
import io.vertx.core.http.HttpServerRequest;
import io.vertx.core.json.JsonArray;
import io.vertx.core.json.JsonObject;
/**
package com.deblox.clustering;
import com.deblox.Boot;
import io.vertx.core.AbstractVerticle;
import io.vertx.core.Future;
import io.vertx.core.Handler;
import io.vertx.core.eventbus.DeliveryOptions;
import io.vertx.core.eventbus.EventBus;
import io.vertx.core.eventbus.Message;
import io.vertx.core.eventbus.MessageConsumer;