Skip to content

Instantly share code, notes, and snippets.

💭
Looking for a job in the San Diego area

Keith Thompson Keith-S-Thompson

💭
Looking for a job in the San Diego area
View GitHub Profile
View test.sh
#!/bin/sh
cat > test_script_name <<EOF
#!/bin/bash/sh
echo It worked
EOF
chmod +x test_script_name
./test_script_name
View check-env
#!/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) {
View testwrap.md
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>
      <MetamaskPrompt enabled={this.state.metamask}/>
View README.md

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 Sep 21, 2016
How to use {{ }} with Markdown
View README.md

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 Aug 27, 2016
"Array ints not returning correctly"
@Keith-S-Thompson
Keith-S-Thompson / README.md
Last active Nov 9, 2015
Demonstration of Ctrl-Z bug, bash 4.4-beta
View README.md

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
View README.md

This is a CVS demo script for this question posted by Paul Bunch on Stack Overflow.

The cvs annotate command prints a message on standard error of the form:

Annotations for hello.txt
***************

The questioner is trying to redirect that message when invoking cvs annotate from a Perl script. I have so far been unable to reproduce the problem. I ask Paul Bunch to try running this script on his own system.

You can’t perform that action at this time.