Skip to content

Instantly share code, notes, and snippets.

mumrah /
Last active July 7, 2021 20:45
Simple Python3 script to help with the "Reviewers" line in Apache Kafka PRs. Must be run from within the Git repo
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from collections import defaultdict
import operator
import os
import re
def prompt_for_user():
mumrah /
Created February 11, 2021 16:55
Java implementation of Scala's Either
import java.util.Objects;
import java.util.Optional;
import java.util.function.Consumer;
import java.util.function.Function;
public class Either<L, R> {
private final L left;
private final R right;

Keybase proof

I hereby claim:

  • I am mumrah on github.
  • I am mumrah ( on keybase.
  • I have a public key ASCd-jLyG5wl65kfDGn0RH73xKpV1lRjUvs2eOHe876OzAo

To claim this, I am signing this object:

#include <font6x8.h>
#include <nano_gfx.h>
#include <nano_gfx_types.h>
#include <sprite_pool.h>
#include <ssd1306.h>
#include <tiny_buffer.h>
#include <tiny_ssd1306.h>
mumrah /
Created November 9, 2017 18:11
Python script to decode AX.25 from KISS frames over a serial TNC
import hexdump
import kiss
import struct
def decode_addr(data, cursor):
(a1, a2, a3, a4, a5, a6, a7) = struct.unpack("<BBBBBBB", data[cursor:cursor+7])
hrr = a7 >> 5
ssid = (a7 >> 1) & 0xf
ext = a7 & 0x1
mumrah / rotary.ino
Created November 6, 2017 02:44
Sketch for a KY-040 rotary encoder
* Sketch for KY-040 Encoders
* SW pin _must_ have a pull up resistor on it.
* CLK and DT _should_ have a ~0.1uF for hardware debounce.
int pinSW = 2;
int pinCLK = 3; // Connected to CLK on KY-040
| antenna
from __future__ import print_function
from json import loads
from io import BytesIO
from urllib import urlopen
from time import strptime, strftime
import os
from appscript import app, mactypes
package com.lucidworks.apollo;
import com.lucidworks.apollo.common.pipeline.PipelineDocument;
import com.lucidworks.apollo.component.ItemStore;
import com.lucidworks.fusion.pipeline.*;
mumrah /
Created October 27, 2015 19:12
Things that must match up:
package com.lucidworks.fusion.pipeline.index.config;
import com.lucidworks.apollo.pipeline.schema.Annotations.Schema;
import com.lucidworks.apollo.pipeline.schema.Annotations.SchemaProperty;
import com.lucidworks.apollo.pipeline.schema.validation.RESTValidationError;
import com.lucidworks.apollo.pipeline.schema.validation.SchemaValidator;
import com.lucidworks.fusion.pipeline.Configuration;
import org.codehaus.jackson.annotate.JsonCreator;
import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.annotate.JsonTypeName;