Skip to content

Instantly share code, notes, and snippets.

@mumrah
mumrah / reviewers.py
Last active Jul 7, 2021
Simple Python3 script to help with the "Reviewers" line in Apache Kafka PRs. Must be run from within the Git repo
View reviewers.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from collections import defaultdict
import operator
import os
import re
def prompt_for_user():
@mumrah
mumrah / Either.java
Created Feb 11, 2021
Java implementation of Scala's Either
View Either.java
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;
View keybase.md

Keybase proof

I hereby claim:

  • I am mumrah on github.
  • I am mumrah (https://keybase.io/mumrah) on keybase.
  • I have a public key ASCd-jLyG5wl65kfDGn0RH73xKpV1lRjUvs2eOHe876OzAo

To claim this, I am signing this object:

View meterswr.ino
#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
mumrah / run.py
Created Nov 9, 2017
Python script to decode AX.25 from KISS frames over a serial TNC
View run.py
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
mumrah / rotary.ino
Created Nov 6, 2017
Sketch for a KY-040 rotary encoder
View rotary.ino
/**
* 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
View vent-pipe-ascii
|
|
|
|
|
|
|
| antenna
|
..|
View himawari.py
#!/usr/bin/python
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
View IndexPipelineGuiceModule.java
package com.lucidworks.apollo;
import com.google.inject.AbstractModule;
import com.google.inject.Singleton;
import com.google.inject.TypeLiteral;
import com.google.inject.assistedinject.FactoryModuleBuilder;
import com.google.inject.multibindings.MapBinder;
import com.lucidworks.apollo.common.pipeline.PipelineDocument;
import com.lucidworks.apollo.component.ItemStore;
import com.lucidworks.fusion.pipeline.*;
@mumrah
mumrah / RegexFilterConfig.java
Created Oct 27, 2015
Things that must match up:
View RegexFilterConfig.java
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;