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
FEMNotebookOpen[Filename_] :=
NotebookOpen[
"/Users/cmcknight14/Documents/FEM Pittsburgh/Bamboo/" <> Filename <>
".nb"];
FEMEvaluateNotebook[NotebookHandle_] := (
SelectionMove[NotebookHandle, All, Notebook];
SelectionEvaluate[NotebookHandle];
);
InitializationSection =
#!/bin/bash
@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
@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 / 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"

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 / 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'
}
@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 / 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();
}