Skip to content

Instantly share code, notes, and snippets.

View robertdfrench's full-sized avatar
🌥️
Ask me about Doors!

Robert D. French robertdfrench

🌥️
Ask me about Doors!
View GitHub Profile

Paragraph Formatting

80-char wrap

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam porttitor condimentum efficitur. Duis porta nunc vel sem luctus laoreet. Donec tempus lobortis lectus, fringilla lobortis felis tristique vel. Aliquam erat volutpat. Suspendisse condimentum quis lorem vel pellentesque. Mauris condimentum mi ac magna viverra, et fermentum massa pretium. Cras at odio a elit fermentum scelerisque. Quisque semper, turpis quis dignissim interdum, diam tellus euismod diam, at pulvinar leo nisl ut velit.

@robertdfrench
robertdfrench / exception-escape.cpp
Created January 1, 2020 19:41
C++ Exceptions vs clang-tidy bugprone-exception-escape
#include <stdexcept>
void f() {
throw exception();
}
class C {
C() {
throw exception();
}
@robertdfrench
robertdfrench / htpasswd_request.sh
Created August 8, 2019 03:00
Request a new entry in an htpasswd database
#!/bin/ksh
# Assume /tmp is memory mapped
(echo -n "robert:"; (openssl rand -base64 48 | tee /tmp/pass)) | htpasswd -I /var/www/authentication.db
cat /tmp/pass && rm /tmp/pass
@robertdfrench
robertdfrench / flatten.bash
Created July 11, 2019 23:44
Flatten an arbitrarily-nested array of integers
#!/bin/bash
pad_response_in_brackets() {
echo -n "["
cat < /dev/stdin
echo "]"
}
strip_brackets() {
gsed 's/\[//g' | gsed 's/\]//g'
}
{
"email": "cooldude@example.org"
}

Keybase proof

I hereby claim:

  • I am robertdfrench on github.
  • I am robertdfrench (https://keybase.io/robertdfrench) on keybase.
  • I have a public key ASBR3H7cZgNAa4wn18qNJbFzoldxdV_s_6LoPdG3Xj7BIQo

To claim this, I am signing this object:

@robertdfrench
robertdfrench / test_py-netcdf4.sh
Created August 30, 2017 02:08
Test py-netcdf4
#!/bin/bash
module load py-netcdf
module load py-numpy
module load py-matplotlib
module load py-scipy
python -c "import netCDF4"
@robertdfrench
robertdfrench / craype-nagtest.sh
Created August 8, 2017 13:02
Demonstrate Nag Environment on SLES12 CrayPE
#!/bin/bash
module unload nag
module unload PrgEnv-intel PrgEnv-gnu PrgEnv-pgi PrgEnv-pathscale
module load PrgEnv-pgi
module load nag/fl24
ftn -I$NAGDIR/nag_interface_blocks/ -L$NAGDIR/lib -lnag_nag -o test_cmplx $NAGDIR/examples/source/a02aafe.f90 $NAGDIR/lib/libnag_nag.a
@robertdfrench
robertdfrench / zappa-py35-syntax-error.txt
Created November 5, 2016 14:04
Syntax error when attempting "zappa init" in python 3.5.w
text
goes
here
#!/bin/bash