Skip to content

Instantly share code, notes, and snippets.

View edhowland's full-sized avatar

Ed Howland edhowland

  • Grand Rapids, Mi
View GitHub Profile
@rwcitek
rwcitek / homebrew.md
Last active April 16, 2024 19:57
Installing and running Homebrew under Ubuntu in Docker
@rwcitek
rwcitek / htmlq.docker.md
Last active June 1, 2023 00:34
Installing and running htmlq within Docker
@edhowland
edhowland / ruby_reline_leaves_voice_over_and_terminal_in_bad_state.md
Last active March 10, 2023 21:11
Ruby Reline module leaves Terminal in bad state after the last thing was a print without a newline affecting MacOS VoiceOver screenreader users

If using a screenreader like VoiceOver for the Mac and you use Reline.readmultiline , for example in a loop , say in a REPL, and you output a string without terminating the line with a newline, funny things happen to your screenreader. Like, it no longer outputs the characters you type.

This can be easily demonstrated using Docker and 2 images: ruby:2.6 and ruby:3.2 In ruby:2.6 and before, the same program 'irb', Ruby's own REPL does not experience this problem. But in Ruby 2.7 and above, irb was changed to use the new Reline module instead of the venerable Readline, a wrapper around the venerable GNU readline library.

@rwcitek
rwcitek / Docker.Python.Compile.md
Last active February 19, 2023 01:37
Compiling Python in a Docker image.

This is a collection of bash commands that builds a Python binary for a specific Linux environment using Docker. Environment variables are used to set default values, e.g. Python version and compile options. Using those environment variables, a HERE-DOC command creates a Dockerfile. Docker then uses the Dockerfile to build the Python binary within a Docker image.

To see what the latest Python version is, visit https://www.python.org/ftp/python/.

set environment variables ( optional )

Only if you want to use something different from the defaults.

@lazywithclass
lazywithclass / blog-post.md
Last active April 26, 2024 18:22
Looking at the most beautiful program ever written - part 1

Looking at the most beautiful program ever written - part 1

I am going to have a look at what William Byrd presented as The most beautiful program ever written.

Beauty here refers to computer programs, specifically about Lisp. There might be errors as this is something I wrote to make sense of that interpreter, proceed at your own risk.

Thanks a lot to Carl J. Factora for the help.

The program

@acook
acook / keypress.rb
Created December 2, 2012 18:42
Read keypresses from user in terminal, including arrow keys using pure Ruby. This has since been folded into a much more robust gem called Remedy. https://rubygems.org/gems/remedy & https://github.com/acook/remedy
require 'io/console'
# Reads keypresses from the user including 2 and 3 escape character sequences.
def read_char
STDIN.echo = false
STDIN.raw!
input = STDIN.getc.chr
if input == "\e" then
input << STDIN.read_nonblock(3) rescue nil