Skip to content

Instantly share code, notes, and snippets.

View rwcarlsen's full-sized avatar

Robert Carlsen rwcarlsen

View GitHub Profile
#!/bin/bash
# run this script with one or more arguments that are the directories that hold the code files for
# the objects you want to update.
dirs=$@
appname='YourAppName'
objs='
PotentialAdvection

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

#!/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby
# This script installs to /usr/local only. To install elsewhere you can just
# untar https://github.com/Homebrew/brew/tarball/master anywhere you like or
# change the value of HOMEBREW_PREFIX.
HOMEBREW_PREFIX = "/usr/local".freeze
HOMEBREW_REPOSITORY = "/usr/local/Homebrew".freeze
HOMEBREW_CACHE = "#{ENV["HOME"]}/Library/Caches/Homebrew".freeze
HOMEBREW_OLD_CACHE = "/Library/Caches/Homebrew".freeze
BREW_REPO = "https://github.com/Homebrew/brew".freeze
CORE_TAP_REPO = "https://github.com/Homebrew/homebrew-core".freeze
@rwcarlsen
rwcarlsen / gist:23bc16b57feeb82e0fb86cf681ee14bf
Created October 10, 2016 05:39
start of acme script for opening complementary header/cc file.
#!/bin/bash
function findh {
filename=$(basename "$1")
extension="${filename##*.}"
name="${filename%.*}"
dir=$2
echo $(cat <(find $dir | grep "$name"'\.\(c\|cc\|C\|cpp\|h\|H\|hpp\)$') <(echo $filename) | sort | uniq -u | head -n1)
}
@rwcarlsen
rwcarlsen / gist:3c35df49b8db6a7de0b5
Created February 19, 2016 17:06
hdf5 unit test failures
[==========] Running 65 tests from 2 test cases.
[----------] Global test environment set-up.
[----------] 62 tests from Hdf5BackTests
[ RUN ] Hdf5BackTests.ShapeSegfault
[ OK ] Hdf5BackTests.ShapeSegfault (24 ms)
[ RUN ] Hdf5BackTests.ReadWriteBool
[ OK ] Hdf5BackTests.ReadWriteBool (10 ms)
[ RUN ] Hdf5BackTests.ReadWriteInt
[ OK ] Hdf5BackTests.ReadWriteInt (10 ms)
[ RUN ] Hdf5BackTests.ReadWriteFloat
@rwcarlsen
rwcarlsen / diff.sh
Created February 12, 2016 16:52
latex annotated diff generation from git revisions
#!/bin/bash
oldref=$1
olddir=/tmp/latexdiff1
newref=HEAD
newdir=/tmp/latexdiff2
if [[ $# -ge 2 ]]; then
newref=$2
diff --git a/Makefile b/Makefile
index 007b170..b4912db 100644
--- a/Makefile
+++ b/Makefile
@@ -49,7 +49,7 @@ help:
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
html-docker gh-preview-docker:
- docker run -w /cyclus.github.com -v $(PWD):/cyclus.github.com cyclus/fuelcycle.org-deps make gh-preview
+ docker run -w /cyclus.github.com -v $(PWD):/cyclus.github.com cyclus/fuelcycle.org-deps bash -c "make gh-preview && chmod -R 777 gh-build"
@rwcarlsen
rwcarlsen / statevars.cc
Created July 23, 2015 15:13
storage facility state
#pragma cyclus {}
std::vector<std::string> in_commods;
#pragma cyclus {"default": []}
std::vector<double> in_commod_prefs; // optional with {default: []}
#pragma cyclus {}
std::string out_commod;
#pragma cyclus {"default": ""}
@rwcarlsen
rwcarlsen / fix.diff
Created April 6, 2015 20:16
fix cycpp
diff --git a/cli/cycpp.py b/cli/cycpp.py
index ddad106..d966876 100755
--- a/cli/cycpp.py
+++ b/cli/cycpp.py
@@ -1260,7 +1260,7 @@ class InfileToDbFilter(CodeGeneratorFilter):
s += ind + 'int n = sub->NMatches("{0}");\n'.format(alias[1])
s += ind + '{0} {1};\n'.format(type_to_str(t), member)
s += ind + '{0}.resize(n);\n'.format(member)
- s += ind + 'for (i = 0; i < n; ++i) {\n'
+ s += ind + 'for (int i = 0; i < n; ++i) {\n'
@rwcarlsen
rwcarlsen / PKGBUILD
Created March 6, 2015 21:37
arch pkgbuild for hdf5 1.8.13
pkgname=hdf5-old
pkgver=1.8.13
pkgrel=1
arch=('i686' 'x86_64')
pkgdesc="General purpose library and file format for storing scientific data"
url="http://www.hdfgroup.org/HDF5/"
provides=('hdf5')
conflicts=('hdf5')
license=('custom')