Skip to content

Instantly share code, notes, and snippets.

View OhMeadhbh's full-sized avatar

Meadhbh Hamrick OhMeadhbh

View GitHub Profile
@OhMeadhbh
OhMeadhbh / put_in_xresources.txt
Created July 11, 2023 00:50
Put these lines in your ~/.Xresources file to make xterm look like a VT240.
// I'm a fan of old-school VT220 & VT340 terminals. A
// while back I noticed Viacheslav Slavinsky created a
// TrueType typeface you could use with x/windows to
// make xterm look like a VT-whatever. You can download
// the original typeface from:
//
// https://github.com/svofski/glasstty
//
// And there's a web page describing its creation at:
//
@OhMeadhbh
OhMeadhbh / combining.sh
Last active June 15, 2023 18:48
Print out latin characters combined with unicode combining characters
# This *should* print out lower case latin characters along with various
# unicode combining characters. It's somewhat interesting to see how different
# terminals and typefaces handle this.
# Combining Diacritical Marks 0300-036F
for k in 0 1 2 3 4 5 6
do
for j in 0 1 2 3 4 5 6 7 8 9 a b c d e f
do
@OhMeadhbh
OhMeadhbh / path_patch.diff
Last active August 16, 2020 20:41
Update xace emulator to look for rom file at $XACEROM
112c112
< main(argc,argv)
---
> main(argc,argv,envp)
114a115
> char **envp;
128,129c129,130
<      
<   loadrom(mem);
---
@OhMeadhbh
OhMeadhbh / test_002.six
Created June 4, 2020 17:11
Random Sixel File

┌────────────────────────────────────────────┐
│ Through the Looking Glass (TTY Edition) │
├────────────────────────────────────────────┤
│ Alice did not feel encouraged to │
│ ask questions about it so she │
│ turned to the mock turtle and │
│ said "what else had you to learn │
│ when you were in school?" │
└────────────────────────────────────────────┘
@OhMeadhbh
OhMeadhbh / interval.c
Last active April 9, 2020 23:01
Talking Through A Coding Task
/* interval.c
**
** From a coding interview I (OhMeadhbh@gmail.com)
** recently participated in:
**
** Write a function that finds the intersection of two
** intervals. So if you had the intervals 2 - 8 and 5 -
** 12, the intersection would be 5 - 8. */
/* Let's start by defining the function that will
@OhMeadhbh
OhMeadhbh / readme.txt
Last active June 1, 2023 21:48
Print something like a completion bar on terminals that support SIXEL graphics
This is a simple utility that prints a bar on a
terminal screen. It's no different than a thousand
other such utilities except it's output doesn't look
like crap. It uses SIXEL mode, so you'll have to
have a terminal (or terminal emulator) that supports
it. (if you start xterm with `xterm -ti vt340` it
should work.)
This is useful if, like me, you SSH into remote *nix
systems (like on AWS) and you want to get a graphical
@OhMeadhbh
OhMeadhbh / whatever.txt
Created January 8, 2020 18:49
Hosting a Remote FileSystem that can do Links over CIFS
Hosting a Remote FileSystem that can do Links over CIFS
I’m in the process of migrating from one machine to another and it turns out that my home directory has exploded past the size of my largest external drive.
But I have a commercial NAS box that I rather like. But it’s setup to export a CIFS / SMB file system. I sort of like this since Linux, Mac and Windows all have decent support for SMB. But… it has one problem: links. CIFS *does not* like symbolic links.
So the solution I came up with was to create an image file on the NAS and mount it with losetup. Believe it or not, you can actually do this. Losetup will mount an image that’s hosted on a remote filesystem.
First, create an image file on the remote filesystem. You’ll need to know how big you want it. In this example, I’m making it about 370G, and the remote filesystem is mounted on /mnt/remote:
In Defense of Two Spaces After a Period
I spend more time than is healthy worrying about software documentation. Don't get me wrong, I enjoy coding. I enjoy the process of investigating problems, possibly breaking them down into sub-problems and then searching my toolbox of conceptual solutions to find the one that's *just right*. But communicating a developer's intent clearly is an important part of constructing a solution. If you work in a team with other software developers, communicating intent is of vital importance. Even if you work in isolation, documenting your intent is important so that when you eventually come back to your code several years later, you have a chance of understanding what you were trying to do.
And it was while I was in deep thought about documenting software that I thought that maybe, just maybe, there's justification for two spaces after a period in the modern world.
I frequently use EMACS to edit files; sometimes I use VI, I'm not a zealot. So I like to see text files as
@OhMeadhbh
OhMeadhbh / content.txt
Created August 14, 2019 19:12
Know When to Say "No" to Venture Capitalists
This text is taken from LinkedIn, where it was a response to this article by Bret Reckard at
Sequoia. Bret's article is reasonably well written and contains decent advice if you're a software
engineer looking to jump into a startup and become a VP of Engineering. Go check this one out,
it's short and worth a read:
https://www.linkedin.com/pulse/accelerate-your-path-vpe-join-series-startup-bret-reckard/
And now this is my response, which was originally a LinkedIn post plus a number of comments. I'm
reconstructing it here 'cause it's a lot easier to read without trying to guess which order I
originally posted things in.
@OhMeadhbh
OhMeadhbh / xferneutral.txt
Created July 9, 2019 15:53
Describing why a "Neutral Transfer Syntax" is useful
XML, JSON or Binary : Does It Matter?
Of course it matters. But with a tiny amount of effort, it doesn't have to matter much.
This document describes a way of thinking about structured data and it's use in distributed applications. When implementing web-based APIs, developers traditionally use a well-supported message format such as JSON or XML. In applications where there is a perceived need for processing speed, custom binary formats are sometimes utilized. Each format has it's own benefits and drawbacks and this document will not argue their relative merits. It will, however, recommend an approach which abstracts away details of the specific message format (XML, JSON, binary) and focuses the application developer on more important aspects of application design.
We start by examining the benefits and limitations of each message format, then describe an XML DTD and sample tagged binary format which can be mechanically converted into other described formats. We then describe how these formats can be used w