Skip to content

Instantly share code, notes, and snippets.

View mplewis's full-sized avatar
🐕
柴犬

Matt Lewis mplewis

🐕
柴犬
View GitHub Profile

Dope Shell Stuff

These are my favorite tools for making my terminal a nice place to work.

Tools

  • bat: cat, with syntax highlighting, git, and diff support
  • chezmoi: Sync your dotfiles using a Git repo
  • diff-so-fancy: better-looking diffs for modern terminals
  • eza: ls, but pretty by default
@mplewis
mplewis / QCL-COC.md
Last active September 29, 2025 20:55

Queer & Connected Longmont Code of Conduct

Our Pledge

We pledge to make our community welcoming, safe, and equitable for all.

We are committed to fostering an environment that respects and promotes the dignity, rights, and contributions of all individuals, regardless of characteristics including race, ethnicity, caste, color, age, physical characteristics, neurodiversity, disability, sex or gender, gender identity or expression, sexual orientation, language, philosophy or religion, national or social origin, socio-economic position, level of education, or other status. The same privileges of participation are extended to everyone who participates in good faith and in accordance with this Covenant.

Encouraged Behaviors

HomeKit Service and Characteristic UUIDs

Thanks to HAP-NodeJS

Service UUID
Accessory Information 0000003E-0000-1000-8000-0026BB765291
Air Quality Sensor 0000008D-0000-1000-8000-0026BB765291
Battery Service 00000096-0000-1000-8000-0026BB765291
Bridging State 00000062-0000-1000-8000-0026BB765291
@mplewis
mplewis / flask-uwsgi-nginx-primer.md
Last active August 3, 2025 16:54
Flask + uWSGI + nginx Primer. I've been having trouble with serving a Flask app via uWSGI and nginx, so I thought I'd put together some of the basics to help out others.

Flask + uWSGI + nginx Primer

I've been having trouble with serving a Flask app via uWSGI and nginx, so I thought I'd put together some of the basics to help out others.

How this shit works

  • Flask is managed by uWSGI.
  • uWSGI talks to nginx.
@mplewis
mplewis / threePipeDemo.c
Created March 31, 2013 01:31
Here's an example of how to pipe three commands together using C. This one uses `ps aux | grep root | grep sbin`. This topic is horribly documented online so hopefully this'll help someone else out.
// This program is an example of how to run a command such as
// ps aux | grep root | grep sbin
// using C and Unix.
#include <stdlib.h>
#include <unistd.h>
int pid;
int pipe1[2];
int pipe2[2];
@mplewis
mplewis / safe_schedule.py
Last active December 19, 2024 08:52
An implementation of Scheduler that catches jobs that fail. For use with https://github.com/dbader/schedule
import logging
from traceback import format_exc
import datetime
from schedule import Scheduler
logger = logging.getLogger('schedule')
@mplewis
mplewis / PTDIntelHex.h
Last active July 17, 2024 01:38
PTD's Intel Hex helper. This converts Intel Hex into NSData suitable for programming to a Bean. License: The MIT License
#import <Foundation/Foundation.h>
@interface PTDIntelHex : NSObject
@property (nonatomic, strong) NSString* name;
+ (PTDIntelHex*)intelHexFromHexString:(NSString*)hexString;
+ (PTDIntelHex*)intelHexFromFileURL:(NSURL*)file;
- (id)initWithHexString:(NSString*)hexString;

How Do I Into Git?

a helpful primer for users sick of git's poorly-named commands

I've used Git since 2011, and this is the stuff that I've always had to Google to remember. I hope it helps you not hate Git so much.

Learning About the Repo

Learning About History

@mplewis
mplewis / android_ble_char_props_cheat_sheet.md
Last active May 15, 2023 17:45
A cheat sheet for the bits in the bitmask of Android characteristic properties.

Characteristic Property Cheat Sheet

for Android Bluetooth Low Energy

Tired of remembering which properties go with which bits in the properties bitmask of a BluetoothGattCharacteristic? Me too. Here's an easy-to-read table. Source.

BluetoothGattCharacteristic

Properties

Bit Value | Meaning

@mplewis
mplewis / chat.go
Created September 23, 2022 21:14
Demo "chat" app which shows how to use Go and carraige returns to show live messages alongside an editable chat input line
package main
import (
"fmt"
"math/rand"
"time"
"github.com/eiannone/keyboard"
)