Skip to content

Instantly share code, notes, and snippets.

@Keith-S-Thompson
Keith-S-Thompson / long-lines.md
Last active March 4, 2025 12:05
long-lines.md
@Keith-S-Thompson
Keith-S-Thompson / README.md
Last active February 23, 2025 00:41
1875 Social Security rumor

On 2025-02-11, Elon Musk made some remarks in the Oval Office, including the following:

I think it's really just saying, let's look at each of these expenditures and say is this actually in the best interest of the people? And if it is, it's approved. If it's not, we should think about it. So, crazy things like just cursory examination of Social Security and we've got people in there that are 150 years old.

Now, do you know anyone who's 150? I don't, OK. They should be on

#!/bin/sh
cat > test_script_name <<EOF
#!/bin/bash/sh
echo It worked
EOF
chmod +x test_script_name
./test_script_name
#!/usr/bin/perl
use strict;
use warnings;
my %saved_env = %ENV;
my $term = $ENV{TERM};
my $error_count = 0;
foreach my $var (sort keys %saved_env) {
return (
  <div className="App">
    <h1>Quantum Pilot</h1>
      <div className="content">
        <div className="box"><About/></div>
        <div className="box">HnnYoutube</div>
        <div className="box">{buy}</div>
        <div className="box">{mykeys}</div>
      </div>

Demo program for a bug that appears under Termux on Android.

The %n format for printf does not work.

Files:

  • percent-n-test.c is the test program.
  • correct-output.txt is the correct output
  • incorrect-output.txt is the output under Termux on my Nexus 9, Android 7.1.1
@Keith-S-Thompson
Keith-S-Thompson / README.md
Last active September 21, 2016 22:54
How to use {{ }} with Markdown

I would like to write {{ ... }} inside a code block using Markdown.

For example:

{{ var }}  

I don't know why it disappears. However I can write it outside a block of code: \ {\ { var \ } \ }.

Reference: http://stackoverflow.com/q/39627452/827263

@Keith-S-Thompson
Keith-S-Thompson / README.md
Last active August 27, 2016 21:35
"Array ints not returning correctly"
@Keith-S-Thompson
Keith-S-Thompson / README.md
Last active November 9, 2015 22:50
Demonstration of Ctrl-Z bug, bash 4.4-beta

This gist contains strace output for bash 4.4-beta on Debian 6.0.10. It demonstrates a problem with the handling of Ctrl-Z (SIGTSTP).

For some unknown reason, the behavior differs depending on whether I use xterm (where it works correctly) or rxvt (where it doesn't).

The commands I used are:

xterm -e strace -o xterm_bash.strace /usr/local/bin/bash --norc