Skip to content

Instantly share code, notes, and snippets.

@hagenw
hagenw / narginchk.m
Last active December 17, 2015 16:59
narginchk() for Matlab <2011b
function narginchk(minargs, maxargs)
if (nargin ~= 2)
error('%s: Usage: narginchk(minargs, maxargs)',upper(mfilename));
elseif (~isnumeric (minargs) || ~isscalar (minargs))
error ('minargs must be a numeric scalar');
elseif (~isnumeric (maxargs) || ~isscalar (maxargs))
error ('maxargs must be a numeric scalar');
elseif (minargs > maxargs)
error ('minargs cannot be larger than maxargs')
load(draw);
draw_polar(expr,range) :=
block([theta_var: range[1]],
draw2d(background_color = black,
xtics = 'none,
ytics = 'none,
axis_top = false,
axis_bottom = false,
axis_left = false,
-e git+https://github.com/sfstoolbox/sfs-documentation-theme.git#egg=SfsDoc
@hagenw
hagenw / install_zopflipng.sh
Created September 14, 2017 21:35
Install the lossless png compressor zopflipng
#!/bin/bash
git clone https://github.com/google/zopfli.git
cd zopfli/
make zopflipng
@hagenw
hagenw / install_python_matlab_engine.sh
Created September 28, 2017 09:06
Install Matlab Engine API for python without root permissions
#!/bin/bash
# Go to $MATLABROOT/extern/engines/python and run the following line to build the python engine without root permissions.
# See https://uk.mathworks.com/help/matlab/matlab_external/install-matlab-engine-api-for-python-in-nondefault-locations.html
python setup.py build --build-base=$HOME/tmp/build install
@hagenw
hagenw / katex_align.html
Last active November 24, 2017 14:34
Highlighting a problem with the aligned environment in KaTeX (https://github.com/Khan/KaTeX/issues/985)
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.9.0-alpha1/katex.min.css" type="text/css" />
</head>
@hagenw
hagenw / pip-error.log
Last active April 10, 2018 10:39
pip error (pypa/pip/#4935)
Created temporary directory: /tmp/pip-install-jd1y17b6
Collecting git+https://github.com/hagenw/sphinxcontrib-katex@math_numfig
Created temporary directory: /tmp/pip-req-build-tyoiow_a
Cloning https://github.com/hagenw/sphinxcontrib-katex (to revision math_numfig) to ./pip-req-build-tyoiow_a
Running command git clone -q https://github.com/hagenw/sphinxcontrib-katex /tmp/pip-req-build-tyoiow_a
Running command git show-ref math_numfig
14ec302f3b73b0a4e177617ab72c3881fa786a74 refs/remotes/origin/math_numfig
Running command git rev-parse HEAD
f4aaf369b0b932a801aa26e1a311add0784624bf
Running command git fetch -q https://github.com/hagenw/sphinxcontrib-katex 14ec302f3b73b0a4e177617ab72c3881fa786a74