Skip to content

Instantly share code, notes, and snippets.

View mojavelinux's full-sized avatar

Dan Allen mojavelinux

View GitHub Profile
@mojavelinux
mojavelinux / protest-with-proposals-in-hand.md
Last active October 8, 2026 06:43
Protest with Proposals in Hand

Protest with Proposals in Hand

I believe and support the victims of sexual assault. I want justice for them. I also want sexual assault eradicated from our society. Yet it keeps happening. So we’re justifiably angry as hell.

In order to stop sexual assault, or get justice when it happens, though, we must be more precise about what we’re asking for. We need solutions that will actually make things better.

A university, a police department, and a prosecutor have different authorities, responsibilities, standards, and remedies. If we blur those distinctions, we can end up demanding that the wrong institution take action, right or wrong, while failing to demand the things that the right institutions actually can do to affect change.

The more serious the allegation, the more important precision becomes, not less. That doesn’t mean lowering our expectations. It means demanding more precise accountability.

@mojavelinux
mojavelinux / request-a-safety-check.md
Last active October 6, 2026 18:51
Request a Safety Check: A Missing Alternative Between Doing Nothing and Calling 911

Request a Safety Check: A Missing Layer Between Doing Nothing and Calling 911

I recently found myself thinking about incident reporting after the reopening of the 2024 sexual assault case at Cornell. I wrote to Cornell’s president and provost with a concrete idea for improving safety on campus: Request a safety check.

The idea is simple. Give people a way to say:

Something doesn’t seem right over there. I have a bad feeling about this. Please have someone trained take a look.

That’s different from asking someone to report a crime. It’s different from asking someone to call 911 to declare an emergency. It’s a low-threshold way to act on a concern when the person observing the situation doesn’t know, or need to know, exactly what’s happening.

@mojavelinux
mojavelinux / collapsible.md
Created March 31, 2026 16:32
Collapsible block in Markdown with and without markup in the title
title without markup

content

vs

Details title with **bold** markup
@mojavelinux
mojavelinux / app.rb
Created March 4, 2022 11:40
Ruby program to print Hello, World!
puts 'Hello, World!'
@mojavelinux
mojavelinux / module-lookup-paths.js
Created September 17, 2021 06:37
Shows where Node.js is looking to find a module
const Module = require('module')
Module._resolveLookupPaths = new Proxy(Module._resolveLookupPaths, {
apply(target, self, args) {
console.dir(args[1].paths)
return target.apply(self, args)
}
})
require('name-of-module')
const fs = require('fs')
const gs = require('glob-stream')
const File = require('vinyl')
const { Transform } = require('stream')
const map = (transform) => new Transform({ objectMode: true, transform })
const ospath = require('path')
//const isUTF8 = require('is-utf8')
const { pipeline } = require('stream')
function smartStat (path_, callback) {
@mojavelinux
mojavelinux / actual.png
Last active December 7, 2020 10:41
Flexbox alignment challenge: How do we get the green boxes to be flush with the right margin while keeping the wrap behavior the same?
actual.png
@mojavelinux
mojavelinux / jruby-thread-safety-test.rb
Created April 7, 2020 10:34
JRuby thread safety test with Asciidoctor PDF and Rouge
require 'asciidoctor-pdf'
require 'java'
java_import 'java.util.concurrent.Callable'
java_import 'java.util.concurrent.FutureTask'
java_import 'java.util.concurrent.LinkedBlockingQueue'
java_import 'java.util.concurrent.ThreadPoolExecutor'
java_import 'java.util.concurrent.TimeUnit'
class App
include Callable
@mojavelinux
mojavelinux / file.rb
Last active January 23, 2020 08:36
File.absolute_path?
class File
class << self
def absolute_path? path
(path.start_with? '/') || (ALT_SEPARATOR && (path.start_with? (absolute_path path).slice 0, 3))
end unless method_defined? :absolute_path?
end
end
@mojavelinux
mojavelinux / cut-release.sh
Created January 19, 2020 00:04
Script to cut Asciidoctor EPUB3 release
#!/usr/bin/bash
# GEM_VERSION=1.5.0.alpha.10 NEXT_GEM_VERSION=1.5.0.alpha.11.dev ./cut-release.sh -p
PUSH=false
while getopts "p" option; do
case $option in
p) PUSH=true ;;
esac
done