Skip to content

Instantly share code, notes, and snippets.

View drfloob's full-sized avatar

AJ Heller drfloob

  • Google
  • Santa Cruz, CA
View GitHub Profile
// ==UserScript==
// @name Github gRPC status check sort
// @namespace https://github.com/
// @version 1.0.2
// @description Sort the status checks on a PR by Required status, Success status (errors first), and then by name
// @author hork
// @match https://github.com/*/*/pull/*
// @icon https://github.githubassets.com/favicons/favicon.svg
// @grant none
// @updateURL https://gist.github.com/drfloob/870e63b9e0ce479d88ab1d9a18886f9e/raw/github-grpc-status-check-sort.user.js
@drfloob
drfloob / is_branch_merged.sh
Last active November 18, 2021 22:36
A script to check if branch A has been squash-merged to branch B (default: master) by evaluating diffs of branch A vs diff of all commits on branch B
#!/bin/bash
set -e
function cleanup {
rm $DIFF_FILE $TMPFILE
}
trap cleanup EXIT
@drfloob
drfloob / Makefile
Last active May 6, 2021 16:18
Minimal build files for SoftDevice 110 version of the nrf51 blinky peripheral example - armgcc on Linux, Waveshare ble400 board
# Environment Variables required for this to run
# NRF_SDK_INSTALL_DIR=/path/to/nrf51_sdk_10
PROJECT_NAME := blinky_s110_play
export OUTPUT_FILENAME
#MAKEFILE_NAME := $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
MAKEFILE_NAME := $(MAKEFILE_LIST)
MAKEFILE_DIR := $(dir $(MAKEFILE_NAME) )
@drfloob
drfloob / Makefile
Created April 20, 2021 15:29
Makefile for nrf51 blinky-blank example, Posix-only
# Environment Variables
# NRF_SDK_INSTALL_DIR=/path/to/nrf51_sdk_10
PROJECT_NAME := blinky_blank_ble400
export OUTPUT_FILENAME
MAKEFILE_NAME := $(MAKEFILE_LIST)
MAKEFILE_DIR := $(dir $(MAKEFILE_NAME) )
TEMPLATE_PATH = $(NRF_SDK_INSTALL_DIR)/components/toolchain/gcc
private static final char[] ALPHABET = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
'0', 'a', 'b', 'c', 'd', 'e', 'f' };
private static final int LENGTH = 12;
public static String __MISSING_NAME__(final String s) {
final StringBuilder stringBuilder = new StringBuilder(s);
var express = require('express');
var session = require('express-session')
var SQLiteStore = require('connect-sqlite3')(session);
var app = express();
app.use(session({
store: new SQLiteStore,
secret: "secret",
resave: false,

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2

Results

# Dumb Guy's Statistical Analysis of the Diehard RNG Suite's Craps Test
## Test Description
Craps is a series of rolls of 2 dice, where you win on the first roll
when the sum of the dice is 7 or 11, or lose when it's 2, 3, or 12. If
you roll any other number on the first roll, that is the point you
have to make on subsequent rolls. If you hit that number again, you
win. Otherwise, if you roll 7 you lose.
@drfloob
drfloob / flag.svg
Last active December 19, 2015 10:09 — forked from azundo/flag.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.