Skip to content

Instantly share code, notes, and snippets.

View angus-g's full-sized avatar

Angus Gibson angus-g

  • The Australian National University
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/bin/bash
# source config variables
. ../gen_build.sh
# recursively expand globs
shopt -s globstar
cat << 'EOF' > build.ninja
include ../config.ninja
#include <array>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <vector>
using namespace std;
using Float = double;
using mat = array<array<Float, 3>, 3>;
%!
72 dup scale
1 72 div setlinewidth
8.5 2 div 11 2 div translate
0 0 1 1 rectclip
newpath
<<
;; prevent gc during startup
(setq gc-cons-threshold 402653184)
(add-hook 'after-init-hook #'(lambda ()
(setq gc-cons-threshold 800000)))
;; customization
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
@angus-g
angus-g / gen_build.sh
Last active December 12, 2017 00:35
Bash script to generate build.ninja for a Fortran codebase
#!/bin/bash
. ../gen_build.sh
# recursively expand globs
shopt -s globstar
cat <<'EOF' > build.ninja
include ../config.ninja
import std.container.dlist, std.digest.md, std.format, std.stdio, std.typecons;
struct Coord {
int x, y;
Coord opBinary(string op)(Coord rhs)
{
return mixin("Coord(x"~op~"rhs.x, y"~op~"rhs.y)");
}
}
#include <iostream>
#include <cstring>
#include <qpdf/QPDF.hh>
#include <qpdf/QPDFWriter.hh>
#include <qpdf/QUtil.hh>
static char const *whoami = 0;
void usage() {
(use comparse srfi-14)
(declare (unit parser))
(define sp
(is #\space))
(define crlf
(char-seq "\r\n"))